koursaros-ai / nboost

NBoost is a scalable, search-api-boosting platform for deploying transformer models to improve the relevance of search results on different platforms (i.e. Elasticsearch)
Apache License 2.0
675 stars 69 forks source link

ES search template support #23

Closed jetnet closed 4 years ago

jetnet commented 4 years ago

first of all - thank you very much for making search better :) Question: are you planning to extend nboost by adding support for search templates? E.g. a query could look like:

POST http://192.168.99.100:8000/index/_search/template
{
  "id": "searchTemplate",
  "params": {
    "query": "my query",
    "from": 0,
    "size": 9
  }
}

Thanks!

colethienes commented 4 years ago

Thanks! We don't have plans for search templates yet. Currently the codex auto-detects the field from the query as per #16. It uses this field to rerank search candidates when the Elasticsearch returns. So maybe could be solved by having a default field?

jetnet commented 4 years ago

yes, it's possible to specify the search field, but Nboost would not be able to re-write the size parameter to fetch more results, would it?

pertschuk commented 4 years ago

It seems like it would be relatively straightforward to re-write the size parameter, I'll add this to TODOs for the next release.

colethienes commented 4 years ago

I just added support for dynamically selecting fields to rerank. You can use the --query_path to dynamically select the query field. This works via jsonpath. For example, you would use nboost --query_path body.params.query for you case.