Hi
I've got the Indexed Search engine up and running, but it currently
returns results for all items matching any of the terms in the search
field.
I was wondering if anyone knew whether there's a switch I'm missing so
that it returns all items matching every terms in the search field?
I've been playing around with the IndexableRecord.rb code (l.100 on):
# Search the index. Phrase is expected to be a string of
# one or more words. The phrase will be tokenized with Tokenizer,
# stop words will be removed, and each term will be stemmed.
# This will allow a search for "Running" to return records with
# the terms "run", "ran" and "runner"
def IndexableRecord.search(phrase)
results = []
terms = Tokenizer.tokenize(phrase).collect do |t| t.stem end
terms.empty? ? [] : Context.find(:all, :include => :terms,
:conditions => ["term IN (?)", terms])
end
but am getting in a complete spin trying to sort out the conditions for
a boolean and, partly because MySQL doesn't seem to support intersects.
Any help/suggestions/ideas would be hugely appreciated!
Piers
--
Posted via http://www.ruby-forum.com/.
_______________________________________________
engine-users mailing list
[email protected]
http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org