Hi i am trying to create a simple query on file extension but somehow the search does not find all the results.
This query returns 8 hits.
{
"from": 0,
"size": 10,
"query": {
"bool": {
"must": [
{
"match":
{
"Datatype": {
"type": "phrase",
"query": "the type"
}
}
}
]
}
}
response:
{
"_source": {
"Datatype": "the type",
"FileName": "a-b.xyz",
},
{
"_source": {
"Datatype": "the type",
"FileName": "b-c.xyz",
},
{
"_source": {
"Datatype": "the type",
"FileName": "d-x.xyz",
},
{
"_source": {
"Datatype": "the type",
"FileName": "aa-aa.xyz",
},
{
"_source": {
"Datatype": "the type",
"FileName": "ddfsdf-ddf.xyz",
},
{
"_source": {
"Datatype": "the type",
"FileName": "1234-sdd.xyz",
},
{
"_source": {
"Datatype": "the type",
"FileName": "31502-sdsd.xyz",
},
{
"_source": {
"Datatype": "the type",
"FileName": "16104-ss.xyz",
}
]
}
}
if I filter on only the FileName
:
I retrieve only 3 hits...
{
"from": 0,
"size": 10,
"query": {
"bool": {
"filter": [ // tried with must/should too
{
"match": {
"FileName": {
"query": "xyz"
}
}
}
]
}
}
}
I only get 3 hits on the 8 hits above while I expect to have 8. I am having a hard time to troubleshoot that.
Any guidance on what could be going wrong?
. does not seem to be a special character. My FileName field is indexed as text and is usually of the form 123-abc.xyz
Thanks,
Jon