OR is both a stopword and a reserved word.... In this
case you *probably* are getting hit by it being a stopword.
Changing your analyzer to not use stopwords is probably
the way to go, but beware that you should probably use the
same analyzer at index AND query time.

If you're using StandardAnalyzer, you're getting your case
folded, so if you change analyzers be aware of that.

Get a copy of Luke to see the effects of various analyzers on
queries and to examine the actual contents of your index, it's

PerFieldAnalyzerWrapper may be your friend <G>. It would
allow you to use a different analyzer for your "state" field than
others, which may be very useful.

On Mon, Oct 27, 2008 at 10:20 AM, Bob Rhodes wrote:

Hi all,
I'm hoping this is an easy question. I have a Lucene index that contains
names and states, and I'm having an issue when the state is Oregon,
specifically OR. Below is an example of the query I pass in and the
query string that QueryParser builds below it.

This works for every state except OR.

String I build: lastname:"rhodes" AND state:"AK"
QueryParser output: +lastname:rhodes +state:ak

This is what OR look like:

lastname:"Rhodes" AND state:"OR"

As you can see the state:"OR" is cleaned off by QueryParser. Is there
any way around this?

Thanks for the time.


The information contained in this e-mail message is intended only
for the personal and confidential use of the recipient(s) named
above. This message may be an attorney-client communication and/or
work product and as such is privileged and confidential. If the
reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are
hereby notified that you have received this document in error and
that any review, dissemination, distribution, or copying of this
message is strictly prohibited. If you have received this
communication in error, please notify us immediately by e-mail, and
delete the original message.

Search Discussions

Discussion Posts


Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 3 | next ›
Discussion Overview
groupjava-user @
postedOct 27, '08 at 2:22p
activeOct 27, '08 at 3:33p

2 users in discussion

Bob Rhodes: 2 posts Erick Erickson: 1 post



site design / logo © 2022 Grokbase