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

4576 Store API search queries #4591

Merged
merged 3 commits into from
Oct 17, 2024
Merged

4576 Store API search queries #4591

merged 3 commits into from
Oct 17, 2024

Conversation

albertisfu
Copy link
Contributor

As requested in #4576, this PR adds support for storing queries from the Search API. It applies to the following scenarios:

  • V3 Search API running on Solr (endpoints still run on Solr)
  • V3 Search API running on Elasticsearch (endpoints running on Elasticsearch, such as People, and future endpoints once we fully transition V3 to Elasticsearch)
  • V4 Search API

Note that hit_cache will always be False on API Search queries. Since we don't have a cache implemented for the API.

For the V3 API running on Elasticsearch, I added error handling since we weren’t previously catching Elasticsearch errors. This allows us to store and flag failed queries. Error messages and status codes remain consistent with those in V4 of the Search API.

Additional changes:

  • Added SearchQueryAdmin with cursor pagination.
  • Removed the use of the ceil method when storing query_time, as times are always integers (milliseconds).

Copy link
Member

@mlissner mlissner left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

@mlissner mlissner merged commit 6ae2865 into main Oct 17, 2024
13 checks passed
@mlissner mlissner deleted the 4576-store-api-search-queries branch October 17, 2024 21:41
@mlissner
Copy link
Member

@legaltextai, note that we'll start saving API queries now too, so you can segment that way if you need to starting in about 20 minutes.

@albertisfu
Copy link
Contributor Author

It seems that the deployment is failing. I think it's due to unapplied no-op migration from:

#4572

@mlissner
Copy link
Member

I'm on it. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants