Hi
I have a model practice_test_result for which I have defined the index as
follows:
ThinkingSphinx::Index.define :practice_test_result, with: :active_record,
delta: true do
indexes [student.first_name, student.last_name], :as => :student_name
set_property :min_infix_len => 1end
Searching for test results returns unexpected results in some cases listed
below:
> PracticeTestResult.search('x').map{|x| x.student.name }
>
=> []
This is as per expectation, as none of the student names have 'x' in it.
> PracticeTestResult.search('p').map{|x| x.student.name }
=> ["Jane Doe", "Jane Doe", "David Doe", "Timothy Doe", "Jane Doe"]
This is not expected, as none of the student names have 'p' in it.
> PracticeTestResult.search('ti').map{|x| x.student.name }
=> ["Jane Doe", "Jane Doe", "David Doe", "Timothy Doe", "Jane Doe"]
Again not as per expectation; should have only one value Timothy Doe
returned.
> PracticeTestResult.search('tim').map{|x| x.student.name }
=> ["Timothy Doe"]
Works as expected.
Any suggestion on how to debug this? Could this be because min_infix_len is
set too low at 1?
Sphinx version : Sphinx 2.1.7-release (rel21-r4638)
Thinking-Sphinx version : 3.1.1
Database : MySql
Rails version: 3.2.13
Posted the same question on Stack Overflow as well:
http://stackoverflow.com/questions/23792862/thinking-sphinx-returning-results-that-dont-fit-the-criteria
Thanks,
Prakash
--
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.