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 Andrew Groh <an...@jumptap.com> on 2012/10/10 17:45:15 UTC
Problem with delete by query in Solr 4.0 beta
I cannot seem to get delete by query working in my simple setup in Solr 4.0 beta.
I have a single collection and I want to delete old documents from it. There is a single solr node in the config (no replication, not distributed). This is something that I previously did in Solr 3.x
My collection is called dine, so I do:
curl "http://localhost:8080/solr/dine/update" -s -H 'Content-type:text/xml; charset=utf-8' -d "<delete><query>timestamp_dt:[2012-09-01T00:00:00Z TO 2012-09-27T00:00:00Z]</query></delete>"
and then a commit.
The problem is that the documents are not delete. When I run the same query in the admin page, it still returns documents.
I walked through the code and find the code in DistributedUpdateProcessor::doDeleteByQuery to be suspicious.
Specifically, vinfo is not null, but I have no version field, so versionsStored is false.
So it gets to line 786, which looks like:
if (versionsStored) {
That then skips to line 813 (the finally clause) skipping all calls to doLocalDelete
Now, I do confess I don't understand exactly how this code should work. However, in the add code, the check for versionsStored does not skip the call to doLocalAdd.
Any suggestions would be welcome.
Andrew
Creating a new Collection through API
Posted by Markus Mirsberger <ma...@gmx.de>.
Hi,
what is the best way to create a new Collection through the API so I get
an own config folder with schema.xml and solrconfig.xml inside the
created Core?
When I just create a Collection, only the data folder will be created
but the config folder with schema.xml and solrconfig.xml will be used
from another Collection. Even when I add the config folder later, I have
to reload the core on every server to get the changes :(
Do I have to create a default Core somewhere, copy it inside my solr
folder, rename it and then add this as a Collection or is there a better
way to do this?
Thanks,
Markus
Re: Problem with delete by query in Solr 4.0 beta
Posted by Ahmet Arslan <io...@yahoo.com>.
> Do you have a "_version_" field in
> your schema. I believe SOLR 4.0
> Beta requires that field.
Probably he is hitting this https://issues.apache.org/jira/browse/SOLR-3432
Re: Problem with delete by query in Solr 4.0 beta
Posted by Ravi Solr <ra...@gmail.com>.
Do you have a "_version_" field in your schema. I believe SOLR 4.0
Beta requires that field.
Ravi Kiran Bhaskar
On Wed, Oct 10, 2012 at 11:45 AM, Andrew Groh <an...@jumptap.com> wrote:
> I cannot seem to get delete by query working in my simple setup in Solr 4.0 beta.
>
> I have a single collection and I want to delete old documents from it. There is a single solr node in the config (no replication, not distributed). This is something that I previously did in Solr 3.x
>
> My collection is called dine, so I do:
>
> curl "http://localhost:8080/solr/dine/update" -s -H 'Content-type:text/xml; charset=utf-8' -d "<delete><query>timestamp_dt:[2012-09-01T00:00:00Z TO 2012-09-27T00:00:00Z]</query></delete>"
>
> and then a commit.
>
> The problem is that the documents are not delete. When I run the same query in the admin page, it still returns documents.
>
> I walked through the code and find the code in DistributedUpdateProcessor::doDeleteByQuery to be suspicious.
>
> Specifically, vinfo is not null, but I have no version field, so versionsStored is false.
>
> So it gets to line 786, which looks like:
> if (versionsStored) {
>
> That then skips to line 813 (the finally clause) skipping all calls to doLocalDelete
>
> Now, I do confess I don't understand exactly how this code should work. However, in the add code, the check for versionsStored does not skip the call to doLocalAdd.
>
> Any suggestions would be welcome.
>
> Andrew
>
>
>