-
-
Save matteomanzo/743e2486b2375a6f8ab06434a286e017 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] }, # qua definiamo sia il tipo che il boost, solo per questa parola. | |
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