I have a simple Thinking Sphinx index defined on my Account model:
define_index do indexes display_name indexes email_addresses.email_address has created_at set_property :delta => :datetime, :threshold => 2.minutes end
(Ignore the delta for now, I am generating the full index and searching for account_core .)
But I get unexpected results:
>> Account.count
However, on the command line, using the search utility, I can find Lenny:
$ search -c /etc/sphinx/water.sphinx.conf -i account_core drew@example.com index 'account_core': query ' drew@example.com.com ': returned 2 matches of 2 total in 0.759 sec displaying matches: 1. document=3543432, weight=4, sphinx_internal_id=442101, sphinx_deleted=0, class_crc=0, created_at=Mon Apr 11 12:18:08 2011 2. document=5752816, weight=2, sphinx_internal_id=719552, sphinx_deleted=0, class_crc=0, created_at=Tue Dec 27 12:01:12 2011
Indeed, these are Drew account identifiers.
Why can't I find Lenny when searching with Thinking Sphinx? Why is the number of total_entries so much smaller than the full rows of the accounts table?
source share