No success with wildcard search

9 views
Skip to first unread message

Seb A.

unread,
Aug 16, 2019, 10:00:04 AM8/16/19
to Thinking Sphinx
Hi !

I'm stuck on a simple case and I can't really know why it doesn't work as expected.

I'm using a 5.2 rails app with TS 4.3.2 and Sphinx 3.1.

For my blog, here : https://milesandlove.com/photos, I'm indexing about 6000 images with only one field which is basically a concatenate of some fields :

ThinkingSphinx::Index.define :image, :with => :real_time do
indexes searchable
has rank, :type => :integer, :as => :rank_sort
end.


Got a searchable method in my image.rb model as follow :

def searchable
[title, tag_list.map(&:downcase).join(" "), of, country, region, city].flatten.join(" ")
end


Thus , this searchable return this kind of content :

"Incroyables formations rocheuses paysages montagnes d'Allemagne Allemagne La Saxe Bastei" 
"Coucher de soleil, vallée de la mort manuelle deserts coucher de soleil du Chili Chili Nord du Chili Valle de la Luna" 
"Regard Granada Nicaragua manuelle du Nicaragua Nicaragua Granada et alentours Granada"

Now, my goal is to be able to search within this content with multiple words. 

If I try : "Seb Montagnes", it return results.

But if I try 'Seb Montagne", it return nothing, even with enable star set to true.

I can't understand how to make this work. Any idea? 

(as a note, sorry for the French words guys...)


Walter Lee Davis

unread,
Aug 16, 2019, 10:16:15 AM8/16/19
to thinkin...@googlegroups.com
I wonder if there’s some configuration needed to set the stemming language? That’s just a guess. 

Walter
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/thinking-sphinx/491ca9e5-c597-4836-9561-c93cd0cfffe1%40googlegroups.com.

Pat Allan

unread,
Aug 16, 2019, 9:47:29 PM8/16/19
to thinkin...@googlegroups.com
Hi Seb,

No need to apologise for the French! :)

You’ll likely need either min_infix_len or min_prefix_len set in config/thinking_sphinx.yml to ensure parts of words are indexed alongside full words:

Walter’s suggestion about stemming is a good one, but I think stemming - for any language - is going to focus on a standard dictionary, rather than proper names? I’m not sure though, perhaps it takes a more general approach.

After changing any of these settings, you’ll need to rebuild your index to have the changes applied to Sphinx.

Give that a shot - in particular, the infix/prefix setting - and let us know if the problem persists!

Cheers,

— 
Pat

Reply all
Reply to author
Forward
0 new messages