Circulars: Implement query_string method with fallback #2930
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This changes the search method to
query_string
rather thansimple_query_string
. The former addresses all of the use cases outlined in #2288, but there is the drawback of it not being as tolerant to incorrect syntax as the latter. As a result, I implemented a fallback where opensearch switches tomulti_match
if the query is invalid forquery_string
.Note: this is still behind the
CIRCULARS_LUCENE
feature flagRelated Issue(s)
Resolves #2288
Testing
LIGO
. This should return the results as expected.subject:LIGO AND subject:Swift
. The only results should include circulars with both "LIGO" and "Swift" in the subject.submitter:LIGO
. This should only return a couple of circulars where the submitter has their LIGO association included.submitter:LIGO AND
. Rather than failing due to the incorrect lucene syntax, it should fall back onto themulti_match
method and show results different from the previous test.