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

Add queryTerms to the search results #241

Merged
merged 1 commit into from
Nov 22, 2023
Merged

Conversation

lucaong
Copy link
Owner

@lucaong lucaong commented Nov 22, 2023

The queryTerms field is useful in order to know which query terms matched in the search result. When performing an exact search, terms and queryTerms are identical. In case of prefix or fuzzy match though, they can be different.

For example, if one searches for "moto" using prefix search, and a document matches because it contains the word "motorcycle", then for that result the terms array will include "motorcycle", while the queryTerms array will include "moto".

Also see #240 for a use case.

The `queryTerms` field is useful to know which query terms matched in
the search result. When performing an exact search, `terms` and
`queryTerms` are identical. In case of prefix or fuzzy match though,
they can be different.

For example, if one searches for "moto" using prefix search, and a
result matches with the word "motorcycle", then for that result the
`terms` array will include "motorcycle", while the `queryTerms` array
will include "moto".
@lucaong lucaong mentioned this pull request Nov 22, 2023
@lucaong lucaong merged commit 0a5e9fa into master Nov 22, 2023
2 checks passed
@lucaong lucaong deleted the add-query-terms-to-results branch November 22, 2023 13:43
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