QueryParser.parse question

Hi there,

I am stomped as to why QueryParser’s parse method behaves differently
between query ‘a’ and ‘b’.
See Parked at Loopia

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

I am stomped as to why QueryParser’s parse method behaves differently
between query ‘a’ and ‘b’.
See Parked at Loopia

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

see also:

./script/console

Ferret::Analysis::FULL_ENGLISH_STOP_WORDS

Ben

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 :wink:

http://ferret.davebalmain.com/trac/wiki/DonationsFAQ (donate for ferret)
Amazon Wunschliste & Geschenke (jens kraemers amazon wishlist)

Ben

On 9/27/07, Chris S. [email protected] wrote:

-Chris

p.s. I also found ‘i’ produce the same behavour as ‘a’
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

On Thu, Sep 27, 2007 at 03:46:32PM +0200, Benjamin K. 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 :wink:

http://ferret.davebalmain.com/trac/wiki/DonationsFAQ (donate for ferret)

Amazon Wunschliste & Geschenke (jens kraemers amazon wishlist)

Nope, that’s not my whishlist :slight_smile:

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
[email protected] | www.webit.de

Amtsgericht Dresden | HRB 15422
GF Sven Haubold, Hagen Malessa