[Ferret-talk] Whitespace Issues

BlueJay
2006-07-14T14:35:42Z

I am trying to build up a filtered search using the logic below.


	bq = Ferret::Search::BooleanQuery.new

bq.add_query(Ferret::Search::TermQuery.new(Ferret::Index::Term.new("section",section.downcase!)),
Ferret::Search::BooleanClause::Occur::MUST)

     	filter = Ferret::Search::QueryFilter.new(bq)
  	 	@vobjects = VoObject.find_by_contents(search_input,:filter =>
filter, :sort => ["section", "sale_category"])


This works fine when the "section" is a single word like
"book" but when
there is white spaces in the query like "paperback book" it does not
find the appropriate result and comes back with zero hits.

I changed this to use FuzzyQuery and it works but I sometimes get
segmentation errors (this was reported in another topic).

Does anyone have a solution to this problem for me?

Thanks very much.

--
Posted via http://www.ruby-forum.com/.