On Thu, Mar 08, 2007 at 02:22:45PM +0100, mix wrote:
> Jens Kraemer wrote:
> > could you please have a look into your application's log file, and look
> > for the query aaf actually runs against the ferret index? the relevant
> > line should start with 'query: '
> >
> > Jens
> >
>
>
> "Query: +all_categories:1 +bought_at_int:<1174655577 +gift:false"
>
> with this and a search '+' it found all books (it changes '+' with ' ')
> same for '?'
>
>
>
>
> now i've changed the query with:
>
> query = "+title:#{query} +all_categories:#{category_id}
> +bought_at_int:<#{15.days.from_now.to_i} +gift:false #{extra}"
> this works, now with '?' it doesn't found anything, but... if i search a
> stop word (my, all, your, etc) it found all books :(
>
> the log:
>
> Query: +title:all +all_categories:1 +bought_at_int:<1174655577
> +gift:false
I guess this is perfectly correct behaviour. The stop word can't be
searched for, since it gets stripped from your query (and it has been
stripped from all your indexed documents, too, so searching for it would
be pointless). What remains is the query
'+all_categories:1 +bought_at_int:<1174655577 +gift:false' which will
then be run against the index.
You can tell ferret to not use any stop words by specifying an empty
list for the stop words:
acts_as_ferret { :fields => { ... } }, { :analyzer => StandardAnalyzer.new([]) }
Jens
--
Jens Krämer
webit! Gesellschaft für neue Medien mbH
Schnorrstraße 76 | 01069 Dresden
Telefon +49 351 46766-0 | Telefax +49 351 46766-66
[EMAIL PROTECTED] | www.webit.de
Amtsgericht Dresden | HRB 15422
GF Sven Haubold, Hagen Malessa
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk