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
| UffiziIndex::Artwork.all.query(word: {title: "venere"}).query(word: {author: "botticelli"}).load.to_a | |
| => [#<Artwork:0x007fa66ec00a28 | |
| id: 3, | |
| museum_id: 15, | |
| title: "Nascita di Venere", | |
| author: "Sandro Botticelli (Firenze 1445-1510) ", | |
| position: 109>] |
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
| UffiziIndex::Artwork.all.query(word: {title: "venere"}).load.to_a | |
| => [#<Artwork:0x007fa66ec00a28 | |
| id: 3, | |
| museum_id: 15, | |
| title: "Nascita di Venere", | |
| author: "Sandro Botticelli (Firenze 1445-1510) ", | |
| position: 109>] |
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
| class UffiziIndex < Chewy::Index | |
| class << self | |
| def index_name(_suggest = nil) | |
| "#{Rails.env}_uffizi_#{I18n.locale}" | |
| end | |
| end | |
| define_type( | |
| Artwork.includes(:museum), | |
| delete_if: -> { translation_for(I18n.locale).nil? } |
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
| { | |
| "body": { | |
| "query": { | |
| "bool": { | |
| "must": [ | |
| { | |
| "bool": { | |
| "should": [ | |
| { | |
| "bool": { |
NewerOlder