Created
July 23, 2014 09:22
-
-
Save fredv/503a5a64946cfee0bc9e to your computer and use it in GitHub Desktop.
ElasticSearch query_string parsing quotes on not_analyzed field vs. standard tokenizer
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
PUT http://localhost:9200/_template/txt | |
{ | |
"template": "index_dev", | |
"order": 0, | |
"mappings": { | |
"_default_": { | |
"dynamic_templates": [ | |
{ | |
"template_txt": { | |
"mapping": { | |
"index": "not_analyzed", | |
"type": "string" | |
}, | |
"match_mapping_type": "string", | |
"match": "*_txt" | |
} | |
} | |
] | |
} | |
} | |
} | |
DELETE http://localhost:9200/index_dev | |
POST http://localhost:9200/index_dev/1 | |
{ | |
"content_test_txt": "this is the volume, offered", | |
"content_test": "this is the volume, offered" | |
} | |
GET http://localhost:9200/index_dev/_mapping | |
GET http://localhost:9200/index_dev/_validate/query?explain | |
{ | |
"query": { | |
"query_string": { | |
"query": "content_test_txt:(\"volume, offered\")" | |
} | |
} | |
} | |
GET http://localhost:9200/index_dev/_validate/query?explain | |
{ | |
"query": { | |
"query_string": { | |
"query": "content_test:(\"volume, offered\")" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment