Hi-
I'm baffled by this one:
2 models: Words and Phrases
Word < ActiveRecord::Base
define_index do
indexes definition
end
end
Phrase < ActiveRecord::Base
define_index do
indexes text
end
end
I run 'ts:index' and everything works just fine. Config file is
generated, indexes are created without error. the Word model has
14,197 records and the Phrase model has 31,102 records. Now in script/
console:
results = Word.search "love" # returns []
results = Phrase.search "love" # returns 363 results, which is fine
I know for a fact that the words table has matches for the search
string "love". I just don't know why they aren't showing up. Here are
the results from the logfile for these two queries, respectively:
0.001 sec [all/2/rel 0 (0,20)] [*] love
0.002 sec [all/2/rel 363 (0,20)] [*] love
Another odd thing is that if I run this query from the CLI like so:
search -c development.sphinx.conf -i word_core 'love'
It returns 13 documents with 14 hits, which sounds right to me.
Why do I get no results when running Word.search from inside the Rails
environment but get results from CLI? I have tried this with edge
rails (2.2) and older version (2.0.2) with identical results.
Thanks for time and consideration.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Thinking Sphinx" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/thinking-sphinx?hl=en
-~----------~----~----~----~------~----~------~--~---