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 'http://localhost:9200/test-idx' | |
echo | |
curl -XPUT 'http://localhost:9200/test-idx' -d '{ | |
"mappings" : { | |
"document" : { | |
"properties" : { | |
"tags" : { | |
"type" : "nested", | |
"properties" : { | |
"tag" : { "type" : "string", "index": "not_analyzed" }, |
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 'http://localhost:9200/test-idx' | |
echo | |
curl -XPUT 'http://localhost:9200/test-idx' | |
echo | |
echo | |
echo "**** Standard analyzer ****" | |
curl 'http://localhost:9200/test-idx/_analyze?pretty=true' -d 'This is a test of vamsikrishna@gmail.com' | |
echo | |
curl -XDELETE 'http://localhost:9200/test-idx' | |
echo |
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
#!/bin/sh | |
curl -XDELETE localhost:9200/names | |
curl -XPUT localhost:9200/names -d '{ | |
"settings" : { | |
"index" : { | |
"number_of_shards" : 1, | |
"number_of_replicas" : 0 | |
} | |
}, | |
"mappings" : { |
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 'http://localhost:9200/test-idx' | |
echo | |
curl -XPUT 'http://localhost:9200/test-idx' -d '{ | |
"mappings" : { | |
"type1" : { | |
"properties" : { | |
"obj1" : { | |
"type" : "nested" | |
} | |
} |
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 'http://localhost:9200/test-idx' | |
echo | |
echo "Creating parent mappings" | |
curl -XPUT 'http://localhost:9200/test-idx' -d ' | |
{ | |
"settings": { | |
"index" : { | |
"number_of_shards" : 1, | |
"number_of_replicas" : 0 | |
} |
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 'http://localhost:9200/test-idx' | |
echo | |
curl -XPUT 'http://localhost:9200/test-idx' -d ' | |
{ | |
"mappings": { | |
"doc": { | |
"properties" : { | |
"mixed" : {"type": "string", "store": "yes"} | |
} | |
} |
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
#!/bin/bash | |
echo "Performing a has_child search on contacts" | |
curl -XGET 'http://localhost:9200/contact/_search?pretty=true' -d ' | |
{ | |
"query" : { | |
"filtered" : { | |
"query" : { | |
"match_all" : { } | |
}, | |
"filter" : { |
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
#!/bin/sh | |
# Delete old version to make sure new settings are applied | |
curl -XDELETE "localhost:9200/prefix-test/" | |
echo | |
# Create a new index with custom path_hierarchy analyzer | |
# See http://www.elasticsearch.org/guide/reference/index-modules/analysis/pathhierarchy-tokenizer.html | |
curl -XPUT "localhost:9200/prefix-test" -d '{ | |
"settings": { | |
"analysis": { | |
"analyzer": { |
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
#!/bin/sh | |
curl -XDELETE "http://localhost:9200/test" | |
curl -XPUT "http://localhost:9200/test" -d '{ | |
"mappings" : { | |
"rec" : { | |
"_id" : {"store" : "yes"} | |
} | |
} | |
}' | |
curl -XPUT "http://localhost:9200/test/rec/1" -d '{ |
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
#!/bin/sh | |
curl -XDELETE http://localhost:9200/test-idx && echo | |
curl -XPUT http://localhost:9200/test-idx -d '{ | |
"settings" : { | |
"index" : { | |
"number_of_shards" : 1, | |
"number_of_replicas" : 0, | |
"analysis": { | |
"analyzer" : { | |
"standard_no_pos" : { |