lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Sch├╝tz <>
Subject Problems with Queries which contain '_' and wildcards
Date Wed, 13 Dec 2006 18:01:52 GMT

first let me explain the situation:

We have to index an document, which contains a field "file" to store  
Sometimes filenames contain an underscore or an minus (_ or -). =>  
e.g. foo_bar.doc
Indexing is'nt the problem so far.

But if we now try to search for "foo_b*" the QueryParser crashes with  
following exception:

org.apache.lucene.queryParser.ParseException: Cannot build  
PrefixQuery with analyzer class - token was consumed

Same problem occurs if i use the StandardAnalyzer.
To replace underscores in filenames is not a solution because we have  
many other fields
which can contain underscores. :(

Is there anybody who knows this problem or knows a solution for this?

thx in advance.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message