should i add asterisk " * " before and after "linux", like this:
Article.search :conditions => {:title => ‘*linux*’}
在 2014年3月20日星期四UTC+8下午8时18分55秒,Pat Allan写道:
>
> This should work:
>
> Article.search :conditions => {:title => ‘linux’}
>
> On 20 Mar 2014, at 11:17 pm, Jeremy Li <[email protected] <javascript:>>
> wrote:
>
> i want to get all of data contains "linux" in the field :title, i am not
> sure is below works?
>
> Article.search "linux", :conditions => {:title => ‘*’}
>>
>
> 在 2014年3月20日星期四UTC+8下午8时04分36秒,Pat Allan写道:
>>
>> I’m sorry, I don’t understand your question. Can you please elaborate on
>> what you mean by “I just want to search data from a specific field”?
>>
>> On 20 Mar 2014, at 11:02 pm, Jeremy Li <[email protected]> wrote:
>>
>> but i want to search a specific field without value('something'), i just
>> want to search data from a specific field.
>>
>> 在 2014年3月20日星期四UTC+8下午7时21分44秒,Pat Allan写道:
>>>
>>> Hi Jeremy
>>>
>>> To search on a specific field, you can use the :conditions option:
>>>
>>> Article.search :conditions => {:title => ‘something’}
>>>
>>> http://pat.github.io/thinking-sphinx/searching.html#conditions<http://www.google.com/url?q=http%3A%2F%2Fpat.github.io%2Fthinking-sphinx%2Fsearching.html%23conditions&sa=D&sntz=1&usg=AFQjCNHxx4K6UQCBEcl8KIs0yZuuO-X7-Q>
>>>
>>> Cheers
>>>
>>> —
>>> Pat
>>>
>>> On 20 Mar 2014, at 10:14 pm, Jeremy Li <[email protected]> wrote:
>>>
>>> I create two index(:title, :content) in a model Article, and if i want
>>> to search data only in the :title index, how to do that?
>>>
>>> --
>>> 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 [email protected].
>>> To post to this group, send email to [email protected].
>>> 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 [email protected].
>> To post to this group, send email to [email protected].
>> 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 [email protected] <javascript:>.
> To post to this group, send email to [email protected]<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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/thinking-sphinx.
For more options, visit https://groups.google.com/d/optout.