Created
June 11, 2013 15:19
-
-
Save damienalexandre/5757742 to your computer and use it in GitHub Desktop.
Issue 1957
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/pony_index_tmp' | |
curl -XPUT 'http://localhost:9200/pony_index_tmp' -d ' | |
{ | |
"number_of_shards": 1, | |
"number_of_replicas": 1 | |
}' | |
curl -XPUT 'http://localhost:9200/pony_index_tmp/label/_mapping' -d ' | |
{ | |
"label": { | |
"properties": { | |
"name": { | |
"type": "multi_field", | |
"boost": 4, | |
"fields": { | |
"name": { | |
"type": "string", | |
"boost": 30 | |
}, | |
"untouched": { | |
"type": "string", | |
"index": "not_analyzed" | |
} | |
} | |
} | |
} | |
} | |
}' | |
curl -XPOST "http://localhost:9200/pony_index_tmp/label/1" -d ' | |
{ | |
"name":"Ace of spade" | |
} | |
' | |
curl -XPOST "http://localhost:9200/pony_index_tmp/label/2" -d ' | |
{ | |
"name":"Queens of the stone age" | |
} | |
' | |
curl -XPOST "http://localhost:9200/pony_index_tmp/label/3" -d ' | |
{ | |
"name":"Queen" | |
} | |
' | |
curl -XPOST "http://localhost:9200/pony_index_tmp/label/4" -d ' | |
{ | |
"name":"Gypsy Queens" | |
} | |
' | |
curl -XPOST "http://localhost:9200/pony_index_tmp/label/5" -d ' | |
{ | |
"name":"Gypsy - Queens" | |
} | |
' | |
# on the analyzed field | |
curl -XGET 'http://localhost:9200/pony_index_tmp/_search?pretty=true' -d ' | |
{ | |
"query": { | |
"match_all" : { } | |
}, | |
"facets" : { | |
"toto" : { "terms" : {"field" : "name"} } | |
} | |
}' | |
# on the NOT analyzed field | |
curl -XGET 'http://localhost:9200/pony_index_tmp/_search?pretty=true' -d ' | |
{ | |
"query": { | |
"match_all" : { } | |
}, | |
"facets" : { | |
"name" : { "terms" : {"field" : "name.untouched", "size": 12} } | |
} | |
}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment