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 FiMka <ma...@gmail.com> on 2014/09/13 22:09:17 UTC

Solr: How to delete a document

Hi guys, could you say how to delete a document in Solr? After I delete a
document it still persists in the search results. For example there is the
following document saved in Solr:
After I POST the following data to localhost:8983/solr/update/?commit=true:
Solr each time says 200 OK and responds the following:
If I try to search
localhost:8983/solr/lexikos/select?q=phrase%3A+%22qwerty%22&wt=json&indent=true
for the document once again, it still shown in the results. So how to remove
the document from Solr index as well or what else to do? Thanks in advance
for any assistance!




--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-How-to-delete-a-document-tp4158649.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Solr: How to delete a document

Posted by Erick Erickson <er...@gmail.com>.
Hmmmm, it should not be necessary to add expungeDeletes, so
I'd like to understand what's happening here.

FiMka: Could you give us the exact URL you send? Because
trying the below from a browser works just fine for me on 4.x.
with the sample data.

http://localhost:8983/solr/collection1/update?commit=true&stream.body=<delete><id>DELL</id></delete>

Is your "id" field a simple string type in schema.xml of is it
analyzed in any way?

I'm a bit afraid that the expungeDeletes is masking something
else, I'd like to understand what.

I've also been fooled in the past by having the browser give me
back cached pages, so you might try slightly altering the query
when you look for the doc after deletion.

Best,
Erick

On Sat, Sep 13, 2014 at 1:43 PM, FiMka <ma...@gmail.com> wrote:
> *François*, thank you for help, it is really working now!
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Solr-How-to-delete-a-document-tp4158649p4158654.html
> Sent from the Solr - User mailing list archive at Nabble.com.

Re: Solr: How to delete a document

Posted by Alexandre Rafalovitch <ar...@gmail.com>.
Well, I missed it as well. :-)

I usually put my URLs on their own lines to make looking at them
easier. Wonder if that would have helped in this particular case.

Regards,
   Alex.
Personal: http://www.outerthoughts.com/ and @arafalov
Solr resources and newsletter: http://www.solr-start.com/ and @solrstart
Solr popularizers community: https://www.linkedin.com/groups?gid=6713853


On 13 September 2014 17:55, Erick Erickson <er...@gmail.com> wrote:
> Ahhh! Thanks for letting us know, I was wondering!
>
> And that fact was right there in the URL you pasted and
> I overlooked it totally. Siiigggh.
>
> Erick
>
> On Sat, Sep 13, 2014 at 2:28 PM, FiMka <ma...@gmail.com> wrote:
>> I've got the answer! The problem was not in absence of 'expungeDeletes=true',
>> I've double checked and this does not matter actually. But in fact first
>> time I sent the documents removal request to
>> localhost:8983/solr/update/?commit=true with no specifying any exact Solr
>> core, e.g. "collection1". Solr still responds with 200 OK but of course
>> nothing was removed in my specific core.
>>
>>
>>
>> --
>> View this message in context: http://lucene.472066.n3.nabble.com/Solr-How-to-delete-a-document-tp4158649p4158668.html
>> Sent from the Solr - User mailing list archive at Nabble.com.

Re: Solr: How to delete a document

Posted by Erick Erickson <er...@gmail.com>.
Ahhh! Thanks for letting us know, I was wondering!

And that fact was right there in the URL you pasted and
I overlooked it totally. Siiigggh.

Erick

On Sat, Sep 13, 2014 at 2:28 PM, FiMka <ma...@gmail.com> wrote:
> I've got the answer! The problem was not in absence of 'expungeDeletes=true',
> I've double checked and this does not matter actually. But in fact first
> time I sent the documents removal request to
> localhost:8983/solr/update/?commit=true with no specifying any exact Solr
> core, e.g. "collection1". Solr still responds with 200 OK but of course
> nothing was removed in my specific core.
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Solr-How-to-delete-a-document-tp4158649p4158668.html
> Sent from the Solr - User mailing list archive at Nabble.com.

Re: Solr: How to delete a document

Posted by FiMka <ma...@gmail.com>.
I've got the answer! The problem was not in absence of 'expungeDeletes=true',
I've double checked and this does not matter actually. But in fact first
time I sent the documents removal request to
localhost:8983/solr/update/?commit=true with no specifying any exact Solr
core, e.g. "collection1". Solr still responds with 200 OK but of course
nothing was removed in my specific core.



--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-How-to-delete-a-document-tp4158649p4158668.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Solr: How to delete a document

Posted by Alexandre Rafalovitch <ar...@gmail.com>.
If "commit" was the answer, you may want to step back and review your
understanding of Solr.

The main point is that Solr commit is not the same as SQL transaction,
but is something that has to be triggered manually (or through timeout
specifications in the request and/or solrconfig.xml). Also, commit
will apply to all the changes introduced to that point from all the
different clients, not just the changes of that specific client.

Regards,
   Alex.
P.s. Just commit should have been sufficient as well. I don't think
you need expungeDeletes
Personal: http://www.outerthoughts.com/ and @arafalov
Solr resources and newsletter: http://www.solr-start.com/ and @solrstart
Solr popularizers community: https://www.linkedin.com/groups?gid=6713853


On 13 September 2014 16:43, FiMka <ma...@gmail.com> wrote:
> *François*, thank you for help, it is really working now!
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Solr-How-to-delete-a-document-tp4158649p4158654.html
> Sent from the Solr - User mailing list archive at Nabble.com.

Re: Solr: How to delete a document

Posted by FiMka <ma...@gmail.com>.
*François*, thank you for help, it is really working now!



--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-How-to-delete-a-document-tp4158649p4158654.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Solr: How to delete a document

Posted by François Schiettecatte <fs...@gmail.com>.
How about adding 'expungeDeletes=true' as well as 'commit=true'?

François

On Sep 13, 2014, at 4:09 PM, FiMka <ma...@gmail.com> wrote:

> Hi guys, could you say how to delete a document in Solr? After I delete a
> document it still persists in the search results. For example there is the
> following document saved in Solr:
> After I POST the following data to localhost:8983/solr/update/?commit=true:
> Solr each time says 200 OK and responds the following:
> If I try to search
> localhost:8983/solr/lexikos/select?q=phrase%3A+%22qwerty%22&wt=json&indent=true
> for the document once again, it still shown in the results. So how to remove
> the document from Solr index as well or what else to do? Thanks in advance
> for any assistance!
> 
> 
> 
> 
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Solr-How-to-delete-a-document-tp4158649.html
> Sent from the Solr - User mailing list archive at Nabble.com.