Consistent query score of path_hierarchy tokenized field

My goal is to be able to search ns1.example.com and get results for
ns1.example.com, ns2.example.com, subdomain.example.com, and example.com.

I indexed the field with a path_hierarchy tokenizer with token order
reversed and the lowercase token filter for the domain names.

I have tried to limit the matches with min_score, and the _score is not
consistent from one search to another.

I think what I need a score based on the parts of the path that match. A
query for ns1.example.com must score ns1.example.com as 3, example.com as
2, ns2.example.com as 2, example2.com as 1, etc.

My idea of how to achieve this goal is to use a match query and then
rescore the search with a script.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/afde9f8b-587e-4bf2-98c9-dbf728475bdd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.