Skip to content

Instantly share code, notes, and snippets.

@matteomanzo
Created April 18, 2018 08:13
Show Gist options
  • Save matteomanzo/3078fdf4a4656e816e5b460030ef126f to your computer and use it in GitHub Desktop.
Save matteomanzo/3078fdf4a4656e816e5b460030ef126f to your computer and use it in GitHub Desktop.
UffiziIndex::Artwork.all.query(multi_match: {fields: [:title, :author], query: "venus botticelli"}).load.to_a
=> [#<Artwork:0x007fa66eada0b8
id: 3,
museum_id: 15,
title: "Birth of Venus",
author: "Sandro Botticelli (Florence 1445-1510) ",
position: 109>,
#<Artwork:0x007fa66eada360
id: 30,
museum_id: 6,
title: "Adoration of the Magi",
author: "Sandro Botticelli (Florence 1445-1510)",
position: 2>,
#<Artwork:0x007fa66eada1f8
id: 20,
museum_id: 11,
title: "Fortitude",
author: "Sandro Botticelli (Florence 1445 -1510)",
position: 2015>]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment