lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claude Devarenne <cla...@library.ucsf.edu>
Subject ArrayIndexOutOfBoundsException if stopword on left of bool clause w/ StandardAnalyzer
Date Wed, 14 Jul 2004 21:58:54 GMT
Hi,

A user mistyped their search terms and entered a query that looked like  
this:

the AND title:bla

I am using lucene 1.4 rc3. My web app,  which is using a  
StandardAnalyzer, got an ArrayIndexOutOfBoundsException (stack trace  
below).  I can reproduce this with the lucene demo (both the jsp and  
the comand line util).

Since I have the queryParser.parse(queryString) call in a try statement  
I am now catching this exception so it fixes the issue.

My question is: should the queryParser catch that there is no term  
before trying to add a clause when using a StandardAnalyzer?  Is this  
even possible? Should the burden be on the application to either catch  
the exception or parse the query before handing it out to the  
queryParser?

Claude


Here is the stack trace:

java.lang.ArrayIndexOutOfBoundsException: -1 < 0
java.util.Vector.elementAt(Vector.java:437) at
org.apache.lucene.queryParser.QueryParser.addClause(QueryParser.java: 
181)
at org.apache.lucene.queryParser.QueryParser.Query(QueryParser.java:509)
at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:108)
at QueryExec.runQuery(QueryExec.java:245)
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message