Skip to content

Conversation

@yossariano
Copy link
Contributor

Ticket: https://newyorkpubliclibrary.atlassian.net/browse/SCC-5059

  • This fixes the issue where a contains search for New York Public Library Catalog would not pick up the results from the plural search New York Public Library Catalogs. Essentially it just does a per-word prefix search alongside the existing contains conditions.

bool: {
should: [
{ match: { preferredTerm: { query: this.request.querySansQuotes(), operator: 'and', _name: 'preferredTerm' } } },
{ match_bool_prefix: { preferredTerm: { query: this.request.querySansQuotes(), operator: 'and', _name: 'preferredTermMatchBoolPrefix' } } },
Copy link
Contributor

Choose a reason for hiding this comment

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

Does match_bool_prefix make the prefix query redundant?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right- it is redundant, good call. I also realized that match_bool_prefix doesn't properly support out-of-order queries like "library catalog" vs "catalog library" so I updated this PR to support that with a simple list comprehension.

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.

4 participants