Hello team,
I have an elasticsearch index that contains hostnames and email addresses. When searching the index, my aim is to retrieve all hostnames and emails that contains certain domain
Following examples will explain the problem:
Note the * at the start to make sure it gets all the results:
q=*HOSTNAME&pretty&size=9999
Above query gets all results accurately. But when searching it WITHOUT *, it gets very limited results.
Second example is "host-name" note the HYPHEN in the hostname:
q=*HOST-NAME&pretty&size=9999 (ignore the [.] in the hostname)
The above example gets very limited results, however, when Removing the *, it gets all the results.
That confuses me as some examples works perfectly with * and failed without *, while some other examples (contains -) fails * and works fine without it.
What is the best approach to make sure I get all the results for any hostname no matter it contains hyphen or not?
Thank you