lucene-java-user mailing list archives

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

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

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  


Here is the stack trace:

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