Skip to content

Instantly share code, notes, and snippets.

@imotov imotov/issue-5388.sh
Created Mar 12, 2014

Embed
What would you like to do?
curl -XDELETE "localhost:9200/test-idx?pretty"
curl -XPUT "localhost:9200/test-idx?pretty" -d '{
"settings": {
"index": {
"analysis": {
"analyzer": {
"dw_docid": {
"type": "custom",
"tokenizer": "dw_docid_tokenizer",
"filter": ["dw_docid_filter"]
}
},
"filter": {
"dw_docid_filter": {
"type": "word_delimiter",
"generate_word_parts": false,
"generate_number_parts": true,
"catenate_words": false,
"catenate_numbers": true,
"catenate_all": false,
"split_on_case_change": false,
"preserve_original": false,
"stem_english_possessive": false
}
},
"tokenizer": {
"dw_docid_tokenizer": {
"type": "path_hierarchy",
"delimiter": "-"
}
}
}
}
},
"mappings": {
"test-type" : {
"dynamic_templates" : [
{
"template_1" : {
"match" : "*",
"mapping" : {
"type" : "multi_field",
"fields" : {
"{name}" : {
"type": "string",
"index" : "not_analyzed"
},
"text" : {
"type": "string",
"index" : "analyzed",
"analyzer": "dw_docid"
}
}
}
}
}
]
}
}
}'
curl -XPUT "localhost:9200/test-idx/test-type/1?pretty" -d '{
"myString": "1111-2222"
}'
curl -XPOST "localhost:9200/test-idx/_refresh?pretty"
curl "localhost:9200/test-idx/test-type/_search?pretty&default_operator=AND&q=myString.text:2222-1111"
curl "localhost:9200/test-idx/_analyze?pretty&field=myString.text" -d '1111-2222'
curl "localhost:9200/test-idx/_validate/query?pretty&explain&default_operator=AND&q=myString.text:2222-1111"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.