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 jitender ahuja <aj...@aalayance.com> on 2004/06/25 16:12:34 UTC
multiple select box parameter passing to jsp page causes error
Hi all,
I am developing a html page in which there is a multiple selection box taht indicates the Indexed fields to be searched upon. Also, it has as the default option the All Fields option.
Now, some fields (options) are allowed to be selected in combination.This means that the parameter to be passed to the relevant jsp page must have that combination as a whole to select upon only the desired fields for the existence of the query term(s).
Now, the parameter for this multiple selection scenario is passed multiple times(same as number of the options selected) to the jsp page and causes error that is summarised below:
java.lang.NullPointerException
at org.apache.lucene.index.Term.(Term.java:36)
at org.apache.lucene.index.Term.(Term.java:33)
at org.apache.lucene.queryParser.QueryParser.getFieldQuery(QueryParser.java:253)
at org.apache.lucene.queryParser.QueryParser.Term(QueryParser.java:638)
at org.apache.lucene.queryParser.QueryParser.Clause(QueryParser.java:537)
at org.apache.lucene.queryParser.QueryParser.Query(QueryParser.java:480)
at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:108)
at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:87)
at org.apache.lucene.queryParser.MultiFieldQueryParser.parse(MultiFieldQueryParser.java:77)
at org.apache.jsp.outputjsp_jsp._jspService(output_jsp.java:290)
The file, output_jsp.java has the following code lines at line numbers 289, 290 that deal with the number of options selected being represented in the "size" variable
289:else if (size != 1){ // if multiple(>1) options are selected
290: query = MultiFieldQueryParser.parse(queryString, fields1, analyzer); //parse the query
}
Regards,
Jitender