Is there a way to return results from the app search search api with a relevancy score greater than a specific number?

I'm getting some low relevency results that I want to filter out. I am unable to accomplish what I want by filtering weights or the precision toggle (I am already at a level 10).
I'd like to return only results with a score greater than 5, for example.

@agibbles if you're talking about the _meta.score that App Search gives you to provide default sorting, I'd strongly recommend you not filter results based off of a static value.

These scores don't have absolute or even consistent values. They are useful only relative to one another in a given set of results. Said another way, a score of 5 in one search may be more relevant than a score of 10 in a different result set.

This is why the API doesn't have a way to provide a floor for your result scores.

If you absolutely need this feature, I'd suggest using default sorting, and just stop paging when you hit the score floor you've defined. But a better approach would be to look to see when you hit a statistically significant drop in score in your result set, as measured between your highest and lowest score.

Maybe there is a better way of doing what I am trying to accomplish.
The problem that I am having is that when I do a search and sort by a value that is not score, we are seeing very low score items showing at the top of the list. We would like some way of sorting where we could sort by some sort of combination of two different values. It looks like the api allows for sorting by one value then by another as a tiebreaker but we want something a little more complicated than that. Maybe some way of adding a weight to the score and the other field that we are trying to sort by to get items sorted both by how relevant they are and a different value. (Not as a tiebreaker.)

@agibbles So if I understand this correctly, you want to exclude all non-relevant results from your returned results so you can sort on something like name or date and have every result be somewhat relevant (if not the highest score since you're not sorting by score).

One thing you could look at is using the Elasticsearch API. This would open up options such as using custom scorers for example, but you would have to create the query you want to send in. As a starting point you could get the query you're already sending in via the explain API and then tweak it from there.

This would require a bit more work to set up and tune, but it would give you more correct results that are not based on arbitrary scores that won't translate between different queries.

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