I believe that this happens because "AND", "OR" and "NOT" are all reserved words for joining together other search terms and therefore if you don't want the exception thrown then you must capture any "AND", "OR" and "NOT"s that are entered on their own and not pass them to the QueryParser.
-----Original Message----- From: Saroja Kanta Maharana [mailto:[EMAIL PROTECTED] Sent: 13 February 2007 11:42 To: java-user@lucene.apache.org Subject: Please Help me Hi All, "When i searched for "AND", "OR", "NOT" as query, it gives me the following Exception" Exception in thread "main" org.apache.lucene.queryParser.ParseException: Encountered "<EOF>" at line 1, column 3. Was expecting one of: "(" ... <QUOTED> ... <TERM> ... <PREFIXTERM> ... <WILDTERM> ... "[" ... "{" ... <NUMBER> ... at org.apache.lucene.queryParser.QueryParser.generateParseException( QueryParser.java:1226) at org.apache.lucene.queryParser.QueryParser.jj_consume_token( QueryParser.java:1109) at org.apache.lucene.queryParser.QueryParser.Clause(QueryParser.java :759) at org.apache.lucene.queryParser.QueryParser.Query (QueryParser.java :684) at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java :122) at org.interworld.com.src.ProductSearch.main(ProductSearch.java:54) Java Result: 1 Is there any way to resolve this exception. *Regards* *Saroj* This message has been scanned for viruses by MailControl - (see http://bluepages.wsatkins.co.uk/?4318150) This email and any attached files are confidential and copyright protected. If you are not the addressee, any dissemination of this communication is strictly prohibited. Unless otherwise expressly agreed in writing, nothing stated in this communication shall be legally binding. The ultimate parent company of the Atkins Group is WS Atkins plc. Registered in England No. 1885586. Registered Office Woodcote Grove, Ashley Road, Epsom, Surrey KT18 5BW. Consider the environment. Please don't print this e-mail unless you really need to. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]