Hi.
I have a problem with query. I want to find document by one of the field using term filtered query (I need to find exact match).
I've got index definition:
{
"settings": {
"analysis": {
"default": {
"tokenizer": "standard",
"filter": ["standard", "lowercase", "asciifolding"]
},
"char_filter": {
"&_to_and": {
"type": "mapping",
"mappings": ["&=> and "]
}
},
"analyzer": {
"page_analyzer": {
"type": "custom",
"char_filter": ["&_to_and"],
"filter": ["standard", "lowercase", "asciifolding"],
"tokenizer": "standard"
}
}
}
},
"mappings": {
"assets": {
"_id": {
"path": "assetId"
},
"properties": {
"assetId": {
"type": "string",
"include_in_all": false,
"index": "not_analyzed"
},
"path": {
"type": "string",
"index": "not_analyzed",
"include_in_all": false
}
}
}
}
}
And I try to find a document which has path "/assets/path with spaces.jpg".
I execute following query:
{"filtered" : {"query" : {"match_all" : { }},"filter" : {"term" : {"path" : "/assets/path with spaces.jpg"}}}}
But I don't get any results. I checked mappings for my index and they are correct. What I'm doing wrong? I will add that if I will change that query to mathQueryPrefix then I get my result, but there is a chance that i will get too many results.