Question

i need your help to solve an issue in Thinking Sphinx.
i am Using 'sphinx-2.0.5-win32' and following gems
gem 'thinking-sphinx', '2.0.13' and gem 'riddle', '1.5.3'

sphinx.yml contains
development:
min_infix_len: 3
charset_table: "0..9, A..Z->a..z, _, a..z, -, U+410..U+42F->U+430..U+44F, U+430..U+44F, ., %, @, #, &, *, $"
binlog_path: '#'

My model file :
Class Rm
define_index do
set_property :delta => true
indexes :code, :as => :rm_code, :sortable => true
has id
end
end


I am searching like this :
Rm.search Riddle.escape('"rm0001"'), :page => params[:page], :per_page => 25, :match_mode => :extended -----------> getting 2 results

Code

rm0001
rm0001N


I want only 'rm0001' in search results,
Please help me

Thanks in advance.
Praveen

Was it helpful?

Solution

You´ve set min_infix_len - which enables part word matches.

But NOT set enable_star=true, which means that querys are automatically part word.

So either remove min_infix_len to disable part word matches, OR set enable_star so that part word matches only happen when include * at star/end of words.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top