You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Harpreet S Walia <ha...@sansuisoftware.com> on 2002/05/30 07:53:17 UTC

Query parser error

Hi

I am trying to search words which have characters { , [ etc in them . I am using the standard lucene jar (V 1.2-rc4 ).
 when i search for the words having these charcters i get a exception saying 

org.apache.lucene.queryParser.TokenMgrError: Lexical error at line 1, column 8.  Encountered:  after : "{are"
	at org.apache.lucene.queryParser.QueryParserTokenManager.getNextToken(Unknown Source)
	at org.apache.lucene.queryParser.QueryParser.jj_scan_token(Unknown Source)
	at org.apache.lucene.queryParser.QueryParser.jj_3_1(Unknown Source)
	at org.apache.lucene.queryParser.QueryParser.jj_2_1(Unknown Source)
	at org.apache.lucene.queryParser.QueryParser.Clause(Unknown Source)
	at org.apache.lucene.queryParser.QueryParser.Query(Unknown Source)
	at org.apache.lucene.queryParser.QueryParser.parse(Unknown Source)
	at org.apache.lucene.queryParser.QueryParser.parse(Unknown Source)
	at com.sansui.lucene.Searcher.searchDocuments(Searcher.java:79)


I presume that lucene is treating these words as special characters . Is there a way to avoid this error and search for these kind of words . what kind of changes are required to be done for this .

Can someone shed some light on how queryparser treats the contents .

Thanks and regards,
Harpreet

Re: Query parser error

Posted by Peter Carlson <ca...@bookandhammer.com>.
Try using the newest release and read the Queryparser syntax.

http://jakarta.apache.org/lucene/docs/queryparsersyntax.html

Escape characters were just added.

--Peter



On 5/29/02 10:53 PM, "Harpreet S Walia" <ha...@sansuisoftware.com> wrote:

> Hi
> 
> I am trying to search words which have characters { , [ etc in them . I am
> using the standard lucene jar (V 1.2-rc4 ).
> when i search for the words having these charcters i get a exception saying
> 
> org.apache.lucene.queryParser.TokenMgrError: Lexical error at line 1, column
> 8.  Encountered:  after : "{are"
> at org.apache.lucene.queryParser.QueryParserTokenManager.getNextToken(Unknown
> Source)
> at org.apache.lucene.queryParser.QueryParser.jj_scan_token(Unknown Source)
> at org.apache.lucene.queryParser.QueryParser.jj_3_1(Unknown Source)
> at org.apache.lucene.queryParser.QueryParser.jj_2_1(Unknown Source)
> at org.apache.lucene.queryParser.QueryParser.Clause(Unknown Source)
> at org.apache.lucene.queryParser.QueryParser.Query(Unknown Source)
> at org.apache.lucene.queryParser.QueryParser.parse(Unknown Source)
> at org.apache.lucene.queryParser.QueryParser.parse(Unknown Source)
> at com.sansui.lucene.Searcher.searchDocuments(Searcher.java:79)
> 
> 
> I presume that lucene is treating these words as special characters . Is there
> a way to avoid this error and search for these kind of words . what kind of
> changes are required to be done for this .
> 
> Can someone shed some light on how queryparser treats the contents .
> 
> Thanks and regards,
> Harpreet
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>