This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import org.elasticsearch.client.transport.TransportClient; | |
| import org.elasticsearch.common.transport.InetSocketTransportAddress; | |
| public class Test { | |
| public static void main(String[] args) { | |
| TransportClient client = new TransportClient(); | |
| System.out.println(System.currentTimeMillis() + " BEFORE "); | |
| client.addTransportAddress(new InetSocketTransportAddress("localhost", 9300)); | |
| System.out.println(System.currentTimeMillis() + " AFTER: " + client.connectedNodes().size()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mackimchy:0.19.0.RC2 kimchy$ bin/plugin -install xxx/yyy/0.0.1 | |
| -> Installing xxx/yyy/0.0.1... | |
| Trying https://github.com/downloads/xxx/yyy/yyy-0.0.1.zip... | |
| Trying https://github.com/xxx/yyy/zipball/v0.0.1... | |
| Failed to install xxx/yyy/0.0.1, reason: failed to download | |
| mackimchy:0.19.0.RC2 kimchy$ bin/plugin -install xxx/yyy | |
| -> Installing xxx/yyy... | |
| Trying https://github.com/downloads/xxx/yyy/yyy-0.19.0.RC2.zip... | |
| Trying https://github.com/xxx/yyy/zipball/v0.19.0.RC2... | |
| Trying https://github.com/xxx/yyy/zipball/master... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| curl -XPUT localhost:9200/test -d ' | |
| {"settings": { | |
| "analysis" :{ | |
| "analyzer": { | |
| "exact_analyzer": { | |
| "type": "custom", | |
| "tokenizer":"my_pattern_tokenizer", | |
| "filter":[] | |
| } | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import org.elasticsearch.action.count.CountResponse; | |
| import org.elasticsearch.common.settings.ImmutableSettings; | |
| import org.elasticsearch.common.settings.Settings; | |
| import org.elasticsearch.node.Node; | |
| import org.elasticsearch.node.NodeBuilder; | |
| /** | |
| */ | |
| public class Test { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| curl -XGET 'http://localhost:9200/firstindex/node/_search?pretty=true' -d ' {"query" : { | |
| "text" : { | |
| "label" : { | |
| "query" : "american football", | |
| "fuzziness" : 0.5 | |
| } | |
| } | |
| } | |
| } | |
| ' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import org.elasticsearch.action.get.GetResponse; | |
| import org.elasticsearch.client.Client; | |
| import org.elasticsearch.common.settings.ImmutableSettings; | |
| import org.elasticsearch.node.Node; | |
| import org.elasticsearch.node.NodeBuilder; | |
| public class Test { | |
| static final String updateScript = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import org.elasticsearch.action.admin.indices.refresh.RefreshRequest; | |
| import org.elasticsearch.action.bulk.BulkRequestBuilder; | |
| import org.elasticsearch.action.bulk.BulkResponse; | |
| import org.elasticsearch.action.search.SearchRequestBuilder; | |
| import org.elasticsearch.action.search.SearchResponse; | |
| import org.elasticsearch.client.Requests; | |
| import org.elasticsearch.client.transport.TransportClient; | |
| import org.elasticsearch.common.settings.ImmutableSettings; | |
| import org.elasticsearch.common.settings.Settings; | |
| import org.elasticsearch.common.transport.InetSocketTransportAddress; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| curl -XPUT localhost:9200/test/type/1 -d '{ | |
| "field1" : false | |
| }' | |
| curl -XPUT localhost:9200/test/type/2 -d '{ | |
| "field1" : true | |
| }' | |
| curl localhost:9200/test/_search -d '{ | |
| "query" : { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| curl -s localhost:9200/_search -d ' | |
| { | |
| "query" : { | |
| "filtered" : { | |
| "query": { | |
| "query_string": { | |
| "query": "search_string:a" | |
| } | |
| }, | |
| "filter": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| curl -XPUT localhost:9200/test -d '{ | |
| "mappings" : { | |
| "type1" : { | |
| "doc" : { | |
| "type" : "object", | |
| "enabled" : false | |
| } | |
| } | |
| } | |
| }' |