Return-Path: Delivered-To: apmail-jakarta-lucene-user-archive@apache.org Received: (qmail 99194 invoked from network); 10 May 2002 16:01:10 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 10 May 2002 16:01:10 -0000 Received: (qmail 14671 invoked by uid 97); 10 May 2002 16:01:04 -0000 Delivered-To: qmlist-jakarta-archive-lucene-user@jakarta.apache.org Received: (qmail 14557 invoked by uid 97); 10 May 2002 16:01:03 -0000 Mailing-List: contact lucene-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Lucene Users List" Reply-To: "Lucene Users List" Delivered-To: mailing list lucene-user@jakarta.apache.org Received: (qmail 13367 invoked by uid 98); 9 May 2002 17:06:53 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Message-ID: <20020509170651.27424.qmail@mailshell.com> Subject: RE: QueryParser question - case-sensitivity Date: Thu, 9 May 2002 10:05:56 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" From: cutting@lucene.com To: lucene-user@jakarta.apache.org X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Define an Analyzer that does not lowercase the id field, e.g., something like: public class MyAnalyzer extends Analyzer { private Analyzer standard = new StandardAnalyzer(); public TokenStream tokenStream(String field, final Reader reader) { if ("id".equals(field)) { return new WhitespaceTokenizer(reader); } else { return standard.tokenStream(field, reader); } } } Then pass this into QueryParser. Doug > -----Original Message----- > From: Landon Cox > [mailto:lcox.at.interactive-media.com@cutting.at.lucene.com] > Sent: Thursday, May 09, 2002 9:52 AM > To: dcutting@grandcentral.com > Subject: QueryParser question - case-sensitivity > > > > I have a QueryParser/Query question. These classes (not sure > which) is > apparently converting my term values into lowercase even though Term's > values are by default case-sensitive. I've got non-word > text, id's, that > are case sensitive and stored/indexed that way, but query > parser is not > respecting my case sensitive search criterion. > > For example, I create a query string: > > id:"templatedata/f2container/data/Course1102043194747042" > > and pass this to the QueryParser.parse() method. When I dump > the Query with > toString() I get: > > +id:templatedata/f2container/data/course1102043194747042 > > Naturally, this query fails as I'm expecting a hit on the id with the > uppercase C. If I create and index an id all lower case, > then the query > succeeds. Case-sensitivity is important to maintain for querying this > element, especially using it once the hit occurs. > > How do I coerce QueryParser/Query to not 'tolower' my query > string? or is > there an alternate method that's more direct which takes my > query string > with no modification? > > > -- > To unsubscribe, e-mail: For additional commands, e-mail: -- To unsubscribe, e-mail: For additional commands, e-mail: