Add 'boost_and' option to Searchkick::Query #1628
Open
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.
First of all, thanks for a wonderful gem.
The "boost_and" option adds a second scoring query to fields that match with "ANY". This boosts the relevance of fields that also match the search query with an "AND" operator.
One of our examples would be e.g. an item in a store with title "cool jacket" with another field (lets call it "tag") equal to "Yellow".
Lets consider a user searches for an item with the query "Yellow jacket". We are using the "ANY" operator as we want to search each field in a document individually (title = jacket, tag = yellow),. However, in these scenarios we would like fields matching both words to be considered more relevant than fields only matching one (e.g. title=yellow jacket, tag=yellow => more relevant)
Please let us know if this might be a use case valid to merge to the repository or if it might be considered "to specific" to our use case.