You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Paul Tomblin <pt...@xcski.com> on 2009/09/09 19:51:47 UTC
Can't delete with a fq?
I'm trying to delete using SolJ's "deleteByQuery", but it doesn't like
it that I've added an "fq" parameter. Here's what I see in the logs:
Sep 9, 2009 1:46:13 PM org.apache.solr.common.SolrException log
SEVERE: org.apache.lucene.queryParser.ParseException: Cannot parse
'url:http\:\/\/xcski\.com\/pharma\/&fq=category:pharma': Encountered
":" at line 1, column 46.
Was expecting one of:
<EOF>
<AND> ...
<OR> ...
<NOT> ...
"+" ...
"-" ...
"(" ...
"*" ...
"^" ...
<QUOTED> ...
<TERM> ...
<FUZZY_SLOP> ...
<PREFIXTERM> ...
<WILDTERM> ...
"[" ...
"{" ...
<NUMBER> ...
at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:173)
at org.apache.solr.search.QueryParsing.parseQuery(QueryParsing.java:75)
at org.apache.solr.search.QueryParsing.parseQuery(QueryParsing.java:64)
...
Should I rewrite that query to be "url:http:... AND category:pharma"?
--
http://www.linkedin.com/in/paultomblin
Re: Can't delete with a fq?
Posted by Chris Hostetter <ho...@fucit.org>.
: I'm trying to delete using SolJ's "deleteByQuery", but it doesn't like
: it that I've added an "fq" parameter. Here's what I see in the logs:
the error ayou are getting is because deleteByQuery takes in a solr query
string ... if you include "&fq=" in that string, then you aren't passing a
query stirng, you're passing a URL fragment ... you'd get the same error
if you put a URL encoded "&fq=..." in the "q" param when doing a search.
in general, the delete features of solr don't support filter queries (fq)
... you are only allowed to pass a single query string.
-Hoss
Re: Can't delete with a fq?
Posted by AHMET ARSLAN <io...@yahoo.com>.
> It works perfectly well as a query:
>
> http://localhost:8080/solrChunk/nutch/select/?q=url:http\:\/\/xcski\.com\/pharma\/&fq=category:pharma
>
> retrieved all the documents I wanted to delete.
>
I mean it is not a valid string that QueryParser can parse and return a Lucene Query. Filter query syntax is not supported in QueryParser syntax.
deleteByQuery(category:pharma AND url:http...) is the way to go.
Re: Can't delete with a fq?
Posted by Paul Tomblin <pt...@xcski.com>.
On Wed, Sep 9, 2009 at 2:07 PM, AHMET ARSLAN <io...@yahoo.com> wrote:
> --- On Wed, 9/9/09, Paul Tomblin <pt...@xcski.com> wrote:
>> SEVERE: org.apache.lucene.queryParser.ParseException:
>> Cannot parse
>> 'url:http\:\/\/xcski\.com\/pharma\/&fq=category:pharma':
>
>> Should I rewrite that query to be "url:http:... AND
>> category:pharma"?
> Yes, because url:http\:\/\/xcski\.com\/pharma\/&fq=category:pharma is not a valid query.
>>
It works perfectly well as a query:
http://localhost:8080/solrChunk/nutch/select/?q=url:http\:\/\/xcski\.com\/pharma\/&fq=category:pharma
retrieved all the documents I wanted to delete.
--
http://www.linkedin.com/in/paultomblin
Re: Can't delete with a fq?
Posted by AHMET ARSLAN <io...@yahoo.com>.
--- On Wed, 9/9/09, Paul Tomblin <pt...@xcski.com> wrote:
> From: Paul Tomblin <pt...@xcski.com>
> Subject: Can't delete with a fq?
> To: solr-user@lucene.apache.org
> Date: Wednesday, September 9, 2009, 8:51 PM
> I'm trying to delete using SolJ's
> "deleteByQuery", but it doesn't like
> it that I've added an "fq" parameter. Here's what I
> see in the logs:
>
> Sep 9, 2009 1:46:13 PM org.apache.solr.common.SolrException
> log
> SEVERE: org.apache.lucene.queryParser.ParseException:
> Cannot parse
> 'url:http\:\/\/xcski\.com\/pharma\/&fq=category:pharma':
> Should I rewrite that query to be "url:http:... AND
> category:pharma"?
Yes, because url:http\:\/\/xcski\.com\/pharma\/&fq=category:pharma is not a valid query.
>
>
> --
> http://www.linkedin.com/in/paultomblin
>