Thank you so much Pat, It works like a charm, also your answer was very fast.
Sorry for my poor english. Thanks again, Diego. El sábado, 5 de julio de 2014 04:35:23 UTC-4, Pat Allan escribió: > > Hi Diego > > Your understanding is correct - it is indeed treating ‘@name’ as part of > the search terms to match against. You need to switch to the extended or > extended2 match mode to have the @-syntax work: > > client.match_mode = :extended2 > > If that doesn’t help, or you have further questions, let me know. > > Cheers > > — > Pat > > On 5 Jul 2014, at 2:25 am, Diego Ayuso <day...@gmail.com <javascript:>> > wrote: > > Hi guys, > > I've been trying and searching for examples to search by field with the > riddle gem directly, I've seen many examples of how to search by this way > on php and I think riddle can do it too. I'll put below my code: > > ## BEGIN ## > client = Riddle::Client.new > client.filters << Riddle::Client::Filter.new('years', 1..10) > # working ok > client.filters << Riddle::Client::Filter.new('user_id', [2]) > # working ok > client.sort_by = "price > DESC" # working ok > client.group_by = > "user_id" # working > ok > results = client.query("@name diego", "users") # > NOT WORKING! :( > ### END ### > > So the query is to the index returns the following results: > {:matches=>[], > :fields=>["title", "body"], > :attributes=> > {"user_id"=>1, "title"=>7, "body"=>7, "price"=>5, "created_at"=>2}, > :attribute_names=>["user_id", "title", "body", "price", "created_at"], > :words=> > {"name"=>{:docs=>0, :hits=>0}, > "diego"=>{:docs=>1, :hits=>1}, > > The point is that I think I'm searching by the word name and diego, and > NOT on field name the word "diego". > > Can you give me a hint please. > > Thanks in advance. > > > > > -- > You received this message because you are subscribed to the Google Groups > "Thinking Sphinx" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to thinking-sphi...@googlegroups.com <javascript:>. > To post to this group, send email to thinkin...@googlegroups.com > <javascript:>. > Visit this group at http://groups.google.com/group/thinking-sphinx. > For more options, visit https://groups.google.com/d/optout. > > > -- You received this message because you are subscribed to the Google Groups "Thinking Sphinx" group. To unsubscribe from this group and stop receiving emails from it, send an email to thinking-sphinx+unsubscr...@googlegroups.com. To post to this group, send email to thinking-sphinx@googlegroups.com. Visit this group at http://groups.google.com/group/thinking-sphinx. For more options, visit https://groups.google.com/d/optout.