I am trying to search for an exact match of the date field on the elastic search index, but elastic index returns data that doesn't match search criteria or even when the date field is null.
sorry for providing screenshots for the JSON code. somehow stackoverflow is not letting me to post the question, even when I tried to format the code with ctrl+k, I tried with other tags also without success.
here is the short version of the index.
when I try to search the index using the below query,
search with name and date of birth
elastic is returning data where the name is matching with Tom but the birth date not matching, some results match date of birth, and some results have a birth date of 1998-04-12 where the year or month or day is not matching in the given input query or even returning birth date with null values.
I tried replacing the date query from match to term but got the same result. I tried to replace the date query with a range query (as I know internally elastic search converts date queries to range queries, but I still wanted to try), but I still had the same issue.
is there anything I can do which returns the proper results?
I tried searching on the date field alone by removing the name.
search with just date of birth
even above one resulting in the same issue.
here is the version of elastic I am using.
is this a known issue or is something I am doing wrong? any help would be appreciated.
P.S, the elastic index schema I provided is a small version of what I am using. other date fields also have the same issue.
I have tried with match, term, and range queries and provided date format also in queries without success.
dev.console, I simply make Java Rest API. It has more information on error message part , if the query doesn't generate expected outcome.Kibanainterface in theDev Console. What I mean is, you can write Rest API (comfortable language) and see stack trace more vividly