lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tri Nguyen <tringuye...@yahoo.com>
Subject Re: HTTP Status 400 - org.apache.lucene.queryParser.ParseException
Date Tue, 18 Jan 2011 14:37:53 GMT
what's the alternative?

--- On Tue, 1/18/11, Erick Erickson <erickerickson@gmail.com> wrote:


From: Erick Erickson <erickerickson@gmail.com>
Subject: Re: HTTP Status 400 - org.apache.lucene.queryParser.ParseException
To: solr-user@lucene.apache.org
Date: Tuesday, January 18, 2011, 5:24 AM


Why do you want to do this? Because toString has never been
guaranteed to be re-parsable, even in Lucene, so it's not
surprising that taking a Lucene toString() clause and submitting
it to Solr doesn't work.

Best
Erick

On Tue, Jan 18, 2011 at 4:49 AM, kun xiong <xiongkun04@gmail.com> wrote:

> ---------- Forwarded message ----------
> From: kun xiong <xiongkun04@gmail.com>
> Date: 2011/1/18
> Subject: HTTP Status 400 - org.apache.lucene.queryParser.ParseException
> To: solr-user@lucene.apache.org
>
>
> Hi all,
>  I got a ParseException when I query solr with Lucene BooleanQuery
> expression (toString()).
>
> I use the default parser : LuceneQParserPlugin,which should support whole
> lucene syntax,right?
>
> Java Code:
>
> BooleanQuery bq = new BooleanQuery();
> Query q1 = new TermQuery(new Term("I_NAME_ENUM", "KFC"));
>  Query q2 = new TermQuery(new Term("I_NAME_ENUM", "MCD"));
> bq.add(q1, Occur.SHOULD);
>  bq.add(q2, Occur.SHOULD);
> bq.setMinimumNumberShouldMatch(1);
> String solrQuery = bq.toString();
>
> query string is : q=(I_NAME_ENUM:kfc I_NAME_ENUM:best western)~1
>
> Exceptions :
>
> *message* *org.apache.lucene.queryParser.ParseException: Cannot parse
> '(I_NAME_ENUM:kfc I_NAME_ENUM:best western)~1': Encountered " <FUZZY_SLOP>
> "~1 "" at line 1, column 42. Was expecting one of: <EOF> <AND> ... <OR>
...
> <NOT> ... "+" ... "-" ... "(" ... "*" ... "^" ... <QUOTED> ... <TERM>
...
> <PREFIXTERM> ... <WILDTERM> ... "[" ... "{" ... <NUMBER> ... *
>
> *description* *The request sent by the client was syntactically incorrect
> (org.apache.lucene.queryParser.ParseException: Cannot parse
> '(I_NAME_ENUM:kfc I_NAME_ENUM:best western)~1': Encountered " <FUZZY_SLOP>
> "~1 "" at line 1, column 42. Was expecting one of: <EOF> <AND> ... <OR>
...
> <NOT> ... "+" ... "-" ... "(" ... "*" ... "^" ... <QUOTED> ... <TERM>
...
> <PREFIXTERM> ... <WILDTERM> ... "[" ... "{" ... <NUMBER> ... ).*
>
> *
> *
>
> Anyone could help?
>
>
> Thanks
>
> Kun
>
> *
> *
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message