Skip to content

Consider use index for db search when it's in memory and search index is not #547

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

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

jtnelson
Copy link
Member

Another alternative is to have them race and return the results from the index while the search cache is populated in the background.

So, if ENABLE_SEARCH_CACHE and the relevant index is in memory

  • do the search in the index and in the corpus concurrently (loading up the search cache)
  • return the first result

The benefit of this is that we return the fastest result while the search cache is being populated (at which point, it would be the fastest result)

It might only make sense to do this when ENABLE_SEARCH_CACHE is enabled as an optimization. Otherwise, the search index is never in memory and the index likely is so the search indexes will never be used. Which might defeat the purpose
@jtnelson
Copy link
Member Author

Implement the comment above

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.

1 participant