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
674 stars 69 forks source link

nboost + elasticsearch query dsl support #30

Closed hellracer closed 4 years ago

hellracer commented 4 years ago

Hey,

I was able to make this to work on a very simple test using lucene search syntax, does nboost support query dsl format?, thanks much appreciated it!

pertschuk commented 4 years ago

we use jsonpath for the following flags on nboost, which gives almost total flexibility to extract the query and candidates from any json object (even if it wasn't elasticsearch).

I've never used query DSL but my understanding it that it's json based and thus would probably work with this. We can help with the specific implementation.

  --capture_path CAPTURE_PATH      the url path to tag for reranking via nboost
  --query_path QUERY_PATH          the jsonpath in the request to find the query
  --topk_path TOPK_PATH            the jsonpath to find the number of requested results
  --cvalues_path CVALUES_PATH      the jsonpath to find the string values of the choices
  --cids_path CIDS_PATH            the jsonpath to find the ids of the choices (for benchmarking)
  --true_cids_path TRUE_CIDS_PATH  the path of the true choice ids in the request
  --choices_path CHOICES_PATH      the jsonpath to find the array of choices to reorder
colethienes commented 4 years ago

I just added new documentation for the dsl. You can find it here.