Skip to content

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