Re: Unmatched quotes

2012-08-24 Thread Jack Krupansky

1. You can look at the Solr log file and see this exception:

Caused by: org.apache.lucene.queryParser.ParseException: Cannot parse 
'title:"cycle with 24': Lexical error at line 1, column 21.  Encountered: 
 after : "\"cycle with 24"
   at 
org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:216)
   at 
org.apache.solr.search.LuceneQParser.parse(LuceneQParserPlugin.java:79)

   at org.apache.solr.search.QParser.getQuery(QParser.java:143)
   at 
org.apache.solr.handler.component.QueryComponent.prepare(QueryComponent.java:105)

   ... 22 more
Caused by: org.apache.lucene.queryParser.TokenMgrError: Lexical error at 
line 1, column 21.  Encountered:  after : "\"cycle with 24"


2. Upgrade to Solr 4.0-BETA and Solr will give you this response:


...


org.apache.lucene.queryparser.classic.ParseException: Cannot parse 
'title:"cycle with 24': Lexical error at line 1, column 21. Encountered: 
 after : "\"cycle with 24"


400



-- Jack Krupansky

-Original Message- 
From: Peter Kirk

Sent: Friday, August 24, 2012 6:50 AM
To: solr-user@lucene.apache.org
Subject: Unmatched quotes

Hi,

If I execute the following query, with unmatched quotes, I get an error from 
Solr - as I haven't escaped the middle ".


But the error message appears to simply be "400 null". Is it possible to get 
Solr to return a more informative error message?


http://myhost/solr/myapp/select?q=title:"cycle with 24" wheels"

Thanks,
Peter 



Re: Unmatched quotes

2012-08-24 Thread Ahmet Arslan
> If I execute the following query, with unmatched quotes, I
> get an error from Solr - as I haven't escaped the middle ".
> 
> But the error message appears to simply be "400 null". Is it
> possible to get Solr to return a more informative error
> message?
> 
> http://myhost/solr/myapp/select?q=title:"cycle with 24"
> wheels"

I don't know about the error message but (e)disxmax query parser strips 
unbalanced quotes.



Unmatched quotes

2012-08-24 Thread Peter Kirk
Hi,

If I execute the following query, with unmatched quotes, I get an error from 
Solr - as I haven't escaped the middle ".

But the error message appears to simply be "400 null". Is it possible to get 
Solr to return a more informative error message?

http://myhost/solr/myapp/select?q=title:"cycle with 24" wheels"

Thanks,
Peter