lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marten Senkel" <>
Subject Re: Problems with special characters
Date Fri, 02 Jul 2004 10:44:48 GMT

I had a similar problem.
I don't know whether there is a more intelligent solution, but the quickest I had in mind
was to
convert the special characters I needed to look up into a fixed random character string. For
example: prior to indexing I replace all occurences of '+' by 'PLUSsdfaEGsgfAE'.

When searching I intercept the terms the user entered, replace '+' by the same random character
string and search for it instead of the original special character.
This works, of course, only if one constructs the query by oneself giving the user only some
checkbox options to specify 'AND' or 'OR' queries for example.

If you use sth like this users wouldn't be able to write themselves 'advanced' searches like
+bar as the command sign '+' would be converted as well.
A fix for that problem could be to convert 'C+' to a random string and replace only 'C+' by
random string when searching ... this would leave the command '+' intact.

It's a very basic and quick & dirty solution, I know, but it worked well for me.


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

View raw message