Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[spike] Increase top-k size to 40 by default for relevance queries #2372

Closed
wants to merge 1 commit into from

Conversation

bilbof
Copy link
Contributor

@bilbof bilbof commented Mar 11, 2022

Queries will by default fetch 40 documents from Elasticsearch,
or the K documents specifies by the k query parameter (max: 40).
The reranker will re-rank K documents, and return only the top-k
specified through the count parameter.

This will put greater load on the Elasticsearch cluster but should
improve search quality for relevance queries.

Queries will by default fetch 40 documents from Elasticsearch,
or the K documents specifies by the `k` query parameter (max: 40).
The reranker will re-rank K documents, and return only the top-k
specified through the `count` parameter.

This will put greater load on the Elasticsearch cluster but should
improve search quality for relevance queries.
@@ -94,7 +94,7 @@ def rerank(es_response, search_params)

return { reranked: false, es_response: es_response } if reranked.nil?

es_response["hits"]["hits"] = reranked
es_response["hits"]["hits"] = reranked.first(search_params.count)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If k is 2 * count then might we need to flipflop between first(count) and last(count) depending if start % k is 0 or count? We could end up reranking results out of existence otherwise?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could introduce some jitter here to give some results a chance. Maybe @hannako has some ideas on how we might occassionally swap downranked results into the top-k. 🤔

We could ocassionally return the bottom-k to some users, might be fairer to spread it out a bit among users, since we can assume most of the time the top-k is going to be better.

@sihugh
Copy link
Contributor

sihugh commented May 14, 2024

We're no longer using this fancy stuff 😞

@sihugh sihugh closed this May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants