You can set morphology and prefix options at an index level using the 
set_property method within your index definitions:

  ThinkingSphinx::Index.define :article, :with => :active_record do
    indexes title, content

    set_property :morphology => 'megaphone', :min_prefix_len => 1
  end

-- 
Pat

On 13/09/2013, at 6:26 PM, Hamad M. wrote:

> I probably have to create a separate index and set the morphology (and prefix 
> option) at index level - which seems to be how sphinx works, but the 
> thinking_sphinx.conf seems to combine all options by environment level 
> (development / production). Is there a way out?
> 
> On Thursday, September 12, 2013 4:01:18 AM UTC+3, Pat Allan wrote:
> Might need to take that up with the Sphinx team - I'm not aware of the 
> conflict though, so feel free to share how you're trying the settings and 
> what you're expecting to happen.
> 
> -- 
> Pat
> 
> On 12/09/2013, at 1:35 AM, Hamad M. wrote:
> 
>> That's what I wanted to know. Thanks!
>> 
>> One problem though: it looks like metaphone morphology is mutually exclusive 
>> with prefix (min_prefix_len: 3). Can't get both working at the same time. 
>> Any possible workarounds?
>> 
>>  
>> On Sunday, September 1, 2013 10:05:17 AM UTC+3, Pat Allan wrote:
>> Hi Hamad 
>> 
>> I guess what you'd want to do is create indices for your restaurant and dish 
>> models, and ensure their names are fields. And then a global search can 
>> provide the autocomplete values: 
>> 
>>   ThinkingSphinx.search(params[:query], star: true, ranker: :sph04).collect 
>> &:name 
>> 
>> You will want to enable the star syntax and either infixes or prefixes, plus 
>> whatever morphology you desire - this all happens within 
>> config/thinking_sphinx.yml: 
>> http://pat.github.io/thinking-sphinx/advanced_config.html 
>> 
>> If you need more detail, let me know. 
>> 
>> Cheers 
>> 
>> -- 
>> Pat 
>> 
>> On 25/08/2013, at 5:51 AM, Hamad M. wrote: 
>> 
>> > Hi, 
>> > 
>> > I've read some threads here that discussed integrating autocomplete with 
>> > TS, and I agree with Pat that we typically only need a single column with 
>> > product names or tags, and so TS would be redundant. But I want to 
>> > leverage Sphinx morphology (metaphone), along with SPH04 ranking for 
>> > smarter suggestions. My aim is to index restaurant/dish names as keywords 
>> > instead of objects. 
>> > 
>> > I came across a Sphinx tutorial that shed some light, but I'm not sure how 
>> > TS would fit with this example. This post from Sphinx blog was quite 
>> > informative too, but I still can't close the gap. 
>> > 
>> > I'd appreciate any help. 
>> > 
>> > -- 
>> > 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/groups/opt_out. 
>> 
>> 
>> 
>> -- 
>> 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/groups/opt_out.
> 
> 
> -- 
> 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/groups/opt_out.


-- 
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/groups/opt_out.

Reply via email to