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 Galen Pahlke <pa...@gmail.com> on 2008/06/26 02:44:31 UTC

Solr 1.3 deletes not working?

Hi everyone,
I'm having trouble deleting documents from my solr 1.3 index.  To delete a
document, I post something like "<delete><id>12345</id></delete>" to the
solr server, then issue a commit.  However, I can still find the document in
the index via the query "id:12345".  The document remains visible even after
I restart the solr server.  I know the server is receiving my delete
commands, since deletesById goes up on the stats page, but docsDeleted stays
at 0.

I've tried this with svn revisions 661499 and 671649, with the same results,
but these steps worked fine in solr 1.2.  Any ideas?

- Galen Pahlke

Re: Solr 1.3 deletes not working?

Posted by Yonik Seeley <yo...@lucidimagination.com>.
On Fri, Sep 18, 2009 at 6:26 AM, Lee Theobald <Le...@openobjects.com> wrote:
> I also seem to be having a similar problem deleting.  As far as I can tell,
> the system thinks we are deleting the records (it logs that it's executing
> the commands and all looks OK) but the records always remain.  Regardsless
> if we try a delete by ID or by query, nothing happens.  It's also not extra
> characters in our deletion queries.

Did you issue a commit after the delete?  (you can also specify it
with the delete command)

-Yonik
http://www.lucidimagination.com

> Can anyone think of anything else that I should be checking?  I'm sure it's
> probably a small bit of config we've missed but I can't track it down.
>
> Regards,
> Lee

Re: Solr 1.3 deletes not working?

Posted by Lee Theobald <Le...@openobjects.com>.
I also seem to be having a similar problem deleting.  As far as I can tell,
the system thinks we are deleting the records (it logs that it's executing
the commands and all looks OK) but the records always remain.  Regardsless
if we try a delete by ID or by query, nothing happens.  It's also not extra
characters in our deletion queries.

Can anyone think of anything else that I should be checking?  I'm sure it's
probably a small bit of config we've missed but I can't track it down.

Regards,
Lee
-- 
View this message in context: http://www.nabble.com/Solr-1.3-deletes-not-working--tp18124561p25506432.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Solr 1.3 deletes not working?

Posted by Galen Pahlke <pa...@gmail.com>.
Thanks for all your help.  I found the problem.  My delete queries had
spaces around the id, and everything works after I got rid of them.
<delete><id> 12345 </id></delete> doesnt work
<delete><id>12345</id></delete> works fine
Perhaps a heads up about this in the docs would be in order?

- Galen Pahlke


On Wed, Jun 25, 2008 at 8:17 PM, Yonik Seeley <yo...@apache.org> wrote:

> On Wed, Jun 25, 2008 at 9:34 PM, Galen Pahlke <pa...@gmail.com> wrote:
> > I originally tested with an index generated by solr 1.2, but when that
> > didn't work, I rebuilt the index from scratch.
> > From my schema.xml:
> >
> > <fields>
> >   .....
> >   <field name="id" type="integer" indexed="true" stored="true"
> > required="true"/>
> >   .....
> > </fields>
> >
> > <uniqueKey>id</uniqueKey>
>
> I tried this as well... changing the example schema id type to
> integer, adding a document and deleting it.  Everything worked fine.
>
> Something to watch out for: when you indexed the data, could it have
> had spaces in the id or something?
>
> If you can't figure it out, try reproducing it in a simple example
> that can be added to a JIRA issue.
>
> -Yonik
>

Re: Solr 1.3 deletes not working?

Posted by Yonik Seeley <yo...@apache.org>.
On Wed, Jun 25, 2008 at 9:34 PM, Galen Pahlke <pa...@gmail.com> wrote:
> I originally tested with an index generated by solr 1.2, but when that
> didn't work, I rebuilt the index from scratch.
> From my schema.xml:
>
> <fields>
>   .....
>   <field name="id" type="integer" indexed="true" stored="true"
> required="true"/>
>   .....
> </fields>
>
> <uniqueKey>id</uniqueKey>

I tried this as well... changing the example schema id type to
integer, adding a document and deleting it.  Everything worked fine.

Something to watch out for: when you indexed the data, could it have
had spaces in the id or something?

If you can't figure it out, try reproducing it in a simple example
that can be added to a JIRA issue.

-Yonik

Re: Solr 1.3 deletes not working?

Posted by Galen Pahlke <pa...@gmail.com>.
I originally tested with an index generated by solr 1.2, but when that
didn't work, I rebuilt the index from scratch.
>From my schema.xml:

<fields>
   .....
   <field name="id" type="integer" indexed="true" stored="true"
required="true"/>
   .....
</fields>

<uniqueKey>id</uniqueKey>


-Galen Pahlke

On Wed, Jun 25, 2008 at 7:00 PM, Yonik Seeley <yo...@apache.org> wrote:

> On Wed, Jun 25, 2008 at 8:44 PM, Galen Pahlke <pa...@gmail.com> wrote:
> > I'm having trouble deleting documents from my solr 1.3 index.  To delete
> a
> > document, I post something like "<delete><id>12345</id></delete>" to the
> > solr server, then issue a commit.  However, I can still find the document
> in
> > the index via the query "id:12345".
>
> That's strange....  there are unit tests for this, and I just verified
> it worked on the example data.
> Perhaps the schema no longer matches what you indexed (or did you
> re-index?)
> Make sure the uniqueKeyField specifies "id".
>
> >  The document remains visible even after
> > I restart the solr server.  I know the server is receiving my delete
> > commands, since deletesById goes up on the stats page, but docsDeleted
> stays
> > at 0.
>
> docsDeleted is no longer tracked since Lucene now handles the document
> overwriting itself.
> It should probably be removed.
>
> -Yonik
>

Re: Solr 1.3 deletes not working?

Posted by Yonik Seeley <yo...@apache.org>.
On Wed, Jun 25, 2008 at 8:44 PM, Galen Pahlke <pa...@gmail.com> wrote:
> I'm having trouble deleting documents from my solr 1.3 index.  To delete a
> document, I post something like "<delete><id>12345</id></delete>" to the
> solr server, then issue a commit.  However, I can still find the document in
> the index via the query "id:12345".

That's strange....  there are unit tests for this, and I just verified
it worked on the example data.
Perhaps the schema no longer matches what you indexed (or did you re-index?)
Make sure the uniqueKeyField specifies "id".

>  The document remains visible even after
> I restart the solr server.  I know the server is receiving my delete
> commands, since deletesById goes up on the stats page, but docsDeleted stays
> at 0.

docsDeleted is no longer tracked since Lucene now handles the document
overwriting itself.
It should probably be removed.

-Yonik