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 -XPOST localhost:9200/test/person -d '{ "test" : true }' | |
curl -XGET localhost:9200/_search -d '{ "query": { "field": { "test" : true } } }' |
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
final List<String> stopWords = Arrays.asList( | |
"a", "an", "and", "are", "as", "at", "be", "but", "by", | |
"for", "if", "in", "into", "is", "it", | |
"no", "not", "of", "on", "or", "such", | |
"that", "the", "their", "then", "there", "these", | |
"they", "this", "to", "was", "will", "with" | |
); |
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
public class TestMe { | |
public static void main(String[] args) throws Exception { | |
NodeBuilder nb = NodeBuilder.nodeBuilder().client(true); | |
Node node = nb.node(); | |
Client client = node.client(); | |
XContentBuilder content = XContentFactory.smileBuilder().startObject(); | |
content.field("indexid", "index21"); |
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
time curl -XPOST localhost:9200/test/type1 -d ' | |
{ | |
"test" : "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do e |
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
index: | |
analysis: | |
analyzer: | |
hebrew: | |
type: com.mycompany.HebrewAnalyzerProvider |
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 java.io.IOException; | |
import java.io.UnsupportedEncodingException; | |
import java.math.BigInteger; | |
import java.net.URI; | |
import java.net.URISyntaxException; | |
import java.util.ArrayList; | |
import java.util.Iterator; | |
import java.util.LinkedList; | |
import java.util.List; |
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/rs1050/jobs/_search' -d ' | |
{ | |
"query" : { | |
"filtered" : { | |
"query" : { | |
"query_string" : { | |
"query" : "some query string here" | |
} | |
}, | |
"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/type1/1 -d '{ | |
"value" : 1 | |
}' | |
curl -XPUT localhost:9200/test/type1/2 -d '{ | |
"value" : 2 | |
}' | |
curl -XPUT localhost:9200/test/type1/3 -d '{ | |
"value" : 3 |
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 | |
curl -XPUT localhost:9200/test/type1/_mapping -d '{ | |
"type1" : { | |
"properties" : { | |
"path" : { | |
"type" : "string", | |
"index" : "not_analyzed" | |
} | |
} |
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 'http://localhost:9200/dbparent/metadata/1' -d '{ "user" : "senthil", "Title" : "trying out Elastic Search"}' | |
curl -XPUT 'http://localhost:9200/dbparent/metadata/2' -d '{ "user" : "kumar", "Title" : "Elastic Search"}' | |
curl -XPUT 'http://localhost:9200/dbparent/child/_mapping' -d '{ "child" : { "_parent" : { "type" : "metadata" } }}' | |
curl -XPUT 'http://localhost:9200/dbparent/child/1?parent=1' -d '{ "tag" : "something"}' | |
curl -XGET 'http://localhost:9200/dbparent/_search' -d '{ |