Hi there, I am stomped as to why QueryParser''s parse method behaves differently between query ''a'' and ''b''. See http://pastie.caboo.se/private/4rlwrecyyow3yl6qtf4tq Could someone please help me understand why that is the case. p.s. I also found ''i'' produce the same behavour as ''a'' Cheers, Andy
''a'' is a stop word by default (so is ''i''). If you instantiate the query parser with an Analyzer with no stop words, thusly: qp3 = Ferret::QueryParser.new( :analyzer => Ferret::Analysis::StandardAnalyzer.new([]) ) Then qp3.parse(''a'') (after the appropriate fields call) will return the desired results. -Chris On Thu, Sep 27, 2007 at 10:41:53PM +1000, Andy Shen wrote:> Hi there, > > I am stomped as to why QueryParser''s parse method behaves differently > between query ''a'' and ''b''. > See http://pastie.caboo.se/private/4rlwrecyyow3yl6qtf4tq > > Could someone please help me understand why that is the case. > > p.s. I also found ''i'' produce the same behavour as ''a'' > > Cheers, > Andy > _______________________________________________ > Ferret-talk mailing list > Ferret-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/ferret-talk
> I am stomped as to why QueryParser''s parse method behaves differently > between query ''a'' and ''b''. > See http://pastie.caboo.se/private/4rlwrecyyow3yl6qtf4tq > > Could someone please help me understand why that is the case. > > p.s. I also found ''i'' produce the same behavour as ''a''hey .. there is a concept called STOP_WORDS .. special words are simply ignored. The QueryParser will strip all STOP_WORDS. You should understand the way STOP_WORDS and QueryParsing works.. I would recommend: http://projects.jkraemer.net/acts_as_ferret/wiki/gotchas http://ferret.davebalmain.com/trac/wiki/FAQ%3AIndexing#HowdoIswitchofstop-wordremoval http://www.oreilly.com/catalog/9780596527853/index.html see also: ./script/console>> Ferret::Analysis::FULL_ENGLISH_STOP_WORDSBen
On 9/27/07, Chris Strom <cstrom at mdlogix.com> wrote:> ''a'' is a stop word by default (so is ''i''). If you instantiate the query > parser with an Analyzer with no stop words, thusly: > > qp3 = Ferret::QueryParser.new( > :analyzer => Ferret::Analysis::StandardAnalyzer.new([]) > ) > > Then qp3.parse(''a'') (after the appropriate fields call) will return the > desired results. > > -Chris > > On Thu, Sep 27, 2007 at 10:41:53PM +1000, Andy Shen wrote: > > Hi there, > > > > I am stomped as to why QueryParser''s parse method behaves differently > > between query ''a'' and ''b''. > > See http://pastie.caboo.se/private/4rlwrecyyow3yl6qtf4tq > > > > Could someone please help me understand why that is the case. > > > > p.s. I also found ''i'' produce the same behavour as ''a'' > > > > Cheers, > > Andy > > _______________________________________________ > > Ferret-talk mailing list > > Ferret-talk at rubyforge.org > > http://rubyforge.org/mailman/listinfo/ferret-talk > _______________________________________________ > Ferret-talk mailing list > Ferret-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/ferret-talk >Thank you guys so much for pointing me to the right direction. I feel embarrassed that I have missed the Gotcha wiki page. Those reference links are very useful. Thanks again. Cheers, Andy
> Thank you guys so much for pointing me to the right direction. I feel > embarrassed that I have missed the Gotcha wiki page. Those reference > links are very useful. Thanks again.You''re welcome, but here''re more useful links ;-) http://ferret.davebalmain.com/trac/wiki/DonationsFAQ (donate for ferret) http://tinyurl.com/2my2dp (jens kraemers amazon wishlist) Ben
On Thu, Sep 27, 2007 at 03:46:32PM +0200, Benjamin Krause wrote:> > > Thank you guys so much for pointing me to the right direction. I feel > > embarrassed that I have missed the Gotcha wiki page. Those reference > > links are very useful. Thanks again. > > You''re welcome, but here''re more useful links ;-) > > http://ferret.davebalmain.com/trac/wiki/DonationsFAQ (donate for ferret)> http://tinyurl.com/2my2dp (jens kraemers amazon wishlist)Nope, that''s not my whishlist :-) If at all, have a look at this one: http://www.amazon.de/gp/registry/M7CN2KCVD1GT cheers, 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 kraemer at webit.de | www.webit.de Amtsgericht Dresden | HRB 15422 GF Sven Haubold, Hagen Malessa