lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From DMGoodst...@lbl.gov
Subject Loss of wildcard when search term is quoted with StandardAnalyzer
Date Wed, 31 Jul 2002 00:46:32 GMT
For an index created with StandardAnalyzer, with fields called "go_desc"
and "pu_desc", I construct the following query using QueryParser with
the StandardAnalyzer:

annotQueryStr = "go_desc:\"intracellular signaling\"";
 Query query = 
		QueryParser.parse(annotQueryStr,"pu_desc", new StandardAnalyzer());
log.writeToLog(Log.DEBUG," query is " + query.toString("pu_desc"));

My log output shows that the Query is parsed as:
         query is go_desc:"intracellular signaling"

So that seems to be working fine, and the query returns the expected
results.

If I construct add a wildcard to the query:
annotQueryStr = "go_desc:\"intracellular signal*ng\"";
 Query query = 
		QueryParser.parse(annotQueryStr,"pu_desc", new StandardAnalyzer());
log.writeToLog(Log.DEBUG," query is " + query.toString("pu_desc"));

My log output shows that the wilcard is replaced by whitespace:
        query is go_desc:"intracellular signal ng"
and this returns no results.

Why should StandardAnalyzer be doing this?  Note that this only happens
with "quoted" search terms.  If I try

annotQueryStr = "go_desc:signal*ng";
My logfile shows that
        query is go_desc:signal*ng

So it's handling wildcards fine in this case.

thanks,
--David Goodstein



--
To unsubscribe, e-mail:   <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>


Mime
View raw message