Veera Sundaravel wrote:> Hi all,
>
> I want to search for a keyword in a particular field, for example say I
> want to search for the keyword "rails" in the field title so how
can I
> include the field_name in query string.
>
> s=Ultrasphinx::Search.new(:query => "@title rails")
>
> or
>
> s=Ultrasphinx::Search.new(:query => "title: rails")
>
> or
>
> s=Ultrasphinx::Search.new(:query => "@title: rails")
>
>
> Thanks in advance,
> T.Veeraa.
finally I found
s=Ultrasphinx::Search.new(:query => "title: rails")
above is the write syntax to include the field_name inside search query
as per the documentation.
But when you are using this for exact phrase match, it not working.
s=Ultrasphinx::Search.new(:query => ''title: "ruby on
rails"'')
am searching for the exact phrase "ruby on rails" in title field it
matches exact phrase, thats good, but when am trying the same phrase
with another field also returning the same result. Hence not its not
looking into the field what I specified.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---