lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <hossman_luc...@fucit.org>
Subject Re: search on colon ":" ending words
Date Fri, 23 Feb 2007 22:52:06 GMT

:   String newquery = query.replace(query, ": ", " ");

you should be able to usea regex like so...

    String newquery = query.replaceAll(":\\b", "\\\\:");

...(i may have some extra/missing backslashes) to ensure that literal ":"
in your input which are followed by word boundaries are "escaped" fro mteh
query parser ... that way if your analyzer doesn't strip out the ":"
things will still work, and ":" at the end of your input will be properly
escaped (your current string replace will fail in this case)



-Hoss


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message