Passing min_score to elastic in query


I'm interested in passing the min_score option to elastic when searching via App Search (from javascript), as described in the elastic docs:

When I try to do pass that option in my query, App Search throws with the error:

Options contains invalid key: min_score

Is there a way to pass other options that are available in elastic search but are not necessarily called out in the App Search wrapper? Perhaps there is an escape hatch that I can use to execute a "raw" elastic query like when you're using a DB ORM, can't get it to do what you want, and just want to write the SQL query?

Specifically, I want to do this for 2 reasons...

  1. I don't want to display results that are very far off from the query to my users.
  2. I want to get a list of facets that apply to my results (with counts) but I don't want facets pertaining to results that are far down the list to be returned.... i.e. it would be great to cut off my list at a point that I define using min_score, so I don't get facets pertaining to the 1000th result returned.

Any help appreciated,

1 Like

Assuming that the response from @JasonStoltz in this question:

is the same response I'll get here regarding the min_score function. To @JasonStoltz or someone else who's knowledgable... I can solve the problem of truncating the search results at some score on my end pretty easily. Is there a way to solve the 2nd problem I mentioned above regarding getting facets and counts that apply to a shorter result list?

Hey Dan, to my knowledge, that is not possible.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.