You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Hoss Man (Updated) (JIRA)" <ji...@apache.org> on 2012/04/11 05:49:44 UTC

[jira] [Updated] (SOLR-381) delete-by-query does not support purely negative queries

     [ https://issues.apache.org/jira/browse/SOLR-381?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hoss Man updated SOLR-381:
--------------------------

    Description: 
Reported by Rob Casson:

{noformat}
indexing the example docs from 1.2, these steps work:

curl http://localhost:8983/solr/update --data-binary
'<delete><query>solr</query></delete>' -H 'Content-type:text/xml;
charset=utf-8'

curl http://localhost:8983/solr/update --data-binary '<optimize />' -H
'Content-type:text/xml; charset=utf-8'

but if i reindex, and change the delete query to a negative, the
non-'solr' docs don't get deleted:

curl http://localhost:8983/solr/update --data-binary
'<delete><query>-solr</query></delete>' -H 'Content-type:text/xml;
charset=utf-8'

curl http://localhost:8983/solr/update --data-binary '<optimize />' -H
'Content-type:text/xml; charset=utf-8'

And detailed by Hoss with a workaround:
the delete by query does "the 
right thing" with a purely negative query ... when the customization was 
added to Solr to support pure negative queries it was done at the 
SolrIndexSearcher level when computing DocSets, but delete by query uses a 
lower level method passing in a HitCOllector.

the work arround is to include *:* in yoru query ...
   <delete><query>*:* -solr</query></delete>
... if/when this is fixed 
in Solr that's esentally what solr will do under the covers.
{noformat}

  was:
Reported by Rob Casson:

indexing the example docs from 1.2, these steps work:

curl http://localhost:8983/solr/update --data-binary
'<delete><query>solr</query></delete>' -H 'Content-type:text/xml;
charset=utf-8'

curl http://localhost:8983/solr/update --data-binary '<optimize />' -H
'Content-type:text/xml; charset=utf-8'

but if i reindex, and change the delete query to a negative, the
non-'solr' docs don't get deleted:

curl http://localhost:8983/solr/update --data-binary
'<delete><query>-solr</query></delete>' -H 'Content-type:text/xml;
charset=utf-8'

curl http://localhost:8983/solr/update --data-binary '<optimize />' -H
'Content-type:text/xml; charset=utf-8'

And detailed by Hoss with a workaround:
the delete by query does "the 
right thing" with a purely negative query ... when the customization was 
added to Solr to support pure negative queries it was done at the 
SolrIndexSearcher level when computing DocSets, but delete by query uses a 
lower level method passing in a HitCOllector.

the work arround is to include *:* in yoru query ...
   <delete><query>*:* -solr</query></delete>
... if/when this is fixed 
in Solr that's esentally what solr will do under the covers.



updating summary to use jira's noformat tag so that it doesn't interpret the query syntax as wiki markup

Daivd: this issue was open before wiki markup was supported in issue summaries, so jira was showing you {{ : }} when it should have been showing you {{ \*:\* }}
                
> delete-by-query does not support purely negative queries
> --------------------------------------------------------
>
>                 Key: SOLR-381
>                 URL: https://issues.apache.org/jira/browse/SOLR-381
>             Project: Solr
>          Issue Type: Bug
>          Components: update
>            Reporter: Erik Hatcher
>            Priority: Minor
>
> Reported by Rob Casson:
> {noformat}
> indexing the example docs from 1.2, these steps work:
> curl http://localhost:8983/solr/update --data-binary
> '<delete><query>solr</query></delete>' -H 'Content-type:text/xml;
> charset=utf-8'
> curl http://localhost:8983/solr/update --data-binary '<optimize />' -H
> 'Content-type:text/xml; charset=utf-8'
> but if i reindex, and change the delete query to a negative, the
> non-'solr' docs don't get deleted:
> curl http://localhost:8983/solr/update --data-binary
> '<delete><query>-solr</query></delete>' -H 'Content-type:text/xml;
> charset=utf-8'
> curl http://localhost:8983/solr/update --data-binary '<optimize />' -H
> 'Content-type:text/xml; charset=utf-8'
> And detailed by Hoss with a workaround:
> the delete by query does "the 
> right thing" with a purely negative query ... when the customization was 
> added to Solr to support pure negative queries it was done at the 
> SolrIndexSearcher level when computing DocSets, but delete by query uses a 
> lower level method passing in a HitCOllector.
> the work arround is to include *:* in yoru query ...
>    <delete><query>*:* -solr</query></delete>
> ... if/when this is fixed 
> in Solr that's esentally what solr will do under the covers.
> {noformat}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org