lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ken Krugler <>
Subject Re: Is semicolon a character that needs escaping?
Date Fri, 03 Sep 2010 03:42:20 GMT
Hi Michael,

>> But in general escaping characters in a query gets tricky - if you  
>> can
>> directly build queries versus pre-processing text sent to the query
>> parser, you'll save yourself some pain and suffering.
> What do you mean by these two alternatives? That is, what exactly  
> could
> I do better?

By "can build...", I meant if you can come up with a GUI whereby the  
user doesn't have to use special characters (other than say quoting)  
then you can take a collection of clauses and programmatically build  
your query, without using the query parser.

The code I wound up having to write for what seemed like simple  
escaping quickly got complex and convoluted - e.g. if you want to  
allow "AND" as a term, and don't want it to get processed specially by  
the query parser.

>> Also, since I did the above code the DisMaxRequestHandler has been
>> added to Solr, and it (IIRC) tries to be smart about handling this
>> type of escaping for you.
> Dismax is not (yet) an option because we need the full lucene syntax
> within the query.

OK - in that case sounds like you're stuck with escaping.

-- Ken

Ken Krugler
+1 530-210-6378
e l a s t i c   w e b   m i n i n g

View raw message