Skip to content

Instantly share code, notes, and snippets.

@orbanbotond
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save orbanbotond/29d2e2bd72933b63ce6c to your computer and use it in GitHub Desktop.
Save orbanbotond/29d2e2bd72933b63ce6c to your computer and use it in GitHub Desktop.
chewy usage
[["Cseva", ["csevapcsicse"]], ["Cseva", ["masik", "cseva"]], ["Masik", ["harmadik"]], ["Egyik", ["masik"]]]
SearchIndex.delete!
SearchIndex.reset!
SearchIndex.purge!
res = SearchIndex.filter(term: {account_id: 1}).query( multi_match: { query: 'masik', fields: ['name', 'descriptions']})
res.to_a
a = Subscribem::Account.find 1
r = Recipe.scoped_to(a).first
t = r.tasks.first
t.description = 'masik'
t.save
res = SearchIndex.filter(term: {account_id: 1}).query( multi_match: { query: 'masik', fields: ['name', 'descriptions']})
res.to_a
t.description = 'egyik'
t.save
res = SearchIndex.filter(term: {account_id: 1}).query( multi_match: { query: 'masik', fields: ['name', 'descriptions']})
res.to_a
s = AutosuggestSearch.new a
s.execute 'masik'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment