This file contains 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 -XDELETE 'localhost:9200/test?pretty' | |
curl -XPUT 'localhost:9200/test?pretty' -d '{ | |
"mappings" : { | |
"test" : { | |
"properties" : { | |
"name" : { | |
"type" : "multi_field", | |
"path" : "just_name", | |
"fields" : { | |
"name" : {"type" : "string"}, |
This file contains 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
# Create Index | |
curl -XPUT 'http://localhost:9200/survey/' -d '{ | |
"number_of_shards": 1, | |
"number_of_replicas": 0 | |
}' | |
# Put mapping | |
curl -XPUT 'http://localhost:9200/survey/response/_mapping' -d '{ | |
"response" : { |
This file contains 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 -XDELETE 'localhost:9200/prototype_2013.01.03?pretty' | |
echo | |
curl -XPUT 'localhost:9200/prototype_2013.01.03?pretty' -d '{ | |
"mappings" : { | |
"chow-clfg" : { | |
"dynamic" : "true", | |
"_source" : { | |
"enabled" : true | |
}, | |
"_ttl" : { |
This file contains 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 -XDELETE 'localhost:9200/test' | |
echo | |
curl -XPUT 'localhost:9200/test?pretty' -d '{ | |
"mappings" : { | |
"test" : { | |
"properties" : { | |
"text" : { | |
"type" : "string", | |
"term_vector" : "with_positions_offsets", |
This file contains 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
private long loadCurrentVersionFromIndex(Term uid) { | |
Searcher searcher = searcher(); | |
try { | |
List<AtomicReaderContext> readers = searcher.reader().leaves(); | |
Map<String, Map<String, BloomFilter>> testje = BloomFilteringPostingsFormat.testje; | |
for (int i = 0; i < readers.size(); i++) { | |
AtomicReaderContext readerContext = readers.get(i); | |
BloomFilter bloomFilter = testje.get(((SegmentReader)readerContext.reader()).getSegmentName()).get(uid.field()); | |
if (!bloomFilter.isPresent(uid.bytes())) { | |
continue; |
This file contains 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 -XPUT 'localhost:9200/test1' -d '{ | |
"mappings" : { | |
"records" : { | |
"properties" : { | |
"coords" : { | |
"type" : "nested", | |
"properties" : { | |
} | |
} | |
} |
This file contains 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
for (...) { | |
String id = ...; | |
String source = ...; | |
BulkRequestBuilder request = client1.prepareBulk(); | |
for (int j = 0; j < BATCH; j++) { | |
counter++; | |
request.add(Requests.indexRequest("test").type("type1").id(id).source(source); | |
} | |
BulkResponse response = request.execute().actionGet(); |
This file contains 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 -XDELETE 'http://localhost:9200/test-idx' | |
echo | |
curl -s -XPUT 'http://localhost:9200/test-idx' -d '{ | |
"settings": { | |
"index.number_of_shards" : 1 | |
}, | |
"mappings" : { | |
"document" : { | |
"properties" : { | |
"tags" : { |
This file contains 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
{ | |
"query": { | |
"bool": { | |
"should": [ | |
{ | |
"match": { | |
"name": "some name" | |
} | |
}, | |
{ |
This file contains 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 -XPUT localhost:9200/_template/template_tags -d '{ | |
"template" : "tags*", | |
"settings" : { | |
"index.analysis.analyzer.csv.type" : "pattern", | |
"index.analysis.analyzer.csv.pattern" : "," | |
}, | |
"mappings" : { | |
"_default_" : { | |
"properties" : { | |
"tags" : { |