If you're using TS v3.1.0, then you can separately request wildcarding: query = ThinkingSphinx::Query.wildcard(s, /w@:]+/u) results = ThinkingSphinx.search query, :with => filters, :conditions => condition, ... (no :star option)
This isn't available in any earlier versions of TS, though, so if you're not on v3.1.0, you'll need to upgrade (and thus, it's probably worth reading the appropriate release notes: https://github.com/pat/thinking-sphinx/releases/tag/v3.1.0 And if you're on something earlier than 3.0.6: https://github.com/pat/thinking-sphinx/releases/tag/v3.0.6 On 21 Mar 2014, at 3:20 am, mamesaye kane <[email protected]> wrote: > Hi, > > In my DB i have a table with a column named gender and has two values: male > and female. > In my search gender is a conditon and i also use star. > Is there a way to search for male and not have female in my result. > Here is the query : > > condition[:gender] = params[:gender] if params[:gender].present? > > @results = ThinkingSphinx.search s, > :star => /[\w@:]+/u, > :with => filters, > :conditions => condition, > :order => 'model_order ASC ', > #order result by model > :page => params[:page], > :per_page => 1000 > > on the console: > > SELECT * FROM `episode_core`, `episode_delta`, `organization_core`, > `organization_delta`, `person_core`, `person_delta`, `position_core`, > `position_delta`, `profession_core`, `profession_delta`, `segment_core`, > `segment_delta`, `tv_show_core`, `tv_show_delta` WHERE MATCH('@gender > *male*') AND `sphinx_deleted` = 0 ORDER BY `model_order` ASC LIMIT 0, 1000 > OPTION max_matches=10000 > > > Thanks > > > > > -- > 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.
