-
-
Save matteomanzo/0428a73ca8cfe13ae94664c7d72d6034 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
QUERY_FIELDS = { | |
title: { types: [:fuzzy] }, | |
formatted_text: { types: [:word] }, | |
author: { boost: 3.0, types: [:word] }, # we define both the type and the boost, only for this word. | |
abstract_text: { types: [:fuzzy] }, | |
location: { types: [:infix] }, | |
technique: { types: [:prefix] }, | |
}.freeze | |
def matching_text_scope(text) | |
Mastico::Query.new(query: text, fields: QUERY_FIELDS).apply(UffiziIndex::Artwork.all) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment