Good day everyone!
I'm a bit new to ES and DSL query lang is a bit terra incognita for me, but I've already over-googled this topic and haven't found any idea. Idea is simple:
- We have search index, did some search query "foo", found some documents (ids) with scores:
[{ "_id": "doc_id_1", "_score": 42 }, ...etc... ]
- Additionally we have big bad index with ranking statistics per search query. It can be organised in tuples like
("foo", [ "doc_id_1": 1.0, "doc_id_2": 2.0 ])
in some index or whatever else. - We need to add (or multiply, or whatever) value for every found document id for given query (if they are presented ofc) to get final ranking score.
I've tried different approaches, terms queries, but I couldn't reach this level of granularity (per every doc id and boosting value for given search string).
Also, stats per query can be arbitrary large and I can't simple POST endless boosting instructions for every doc_id. There's no joins in ES and ranking function can't be represented in analytical form, only in table-based.