lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthew Nigl <matthew.n...@gmail.com>
Subject Re: Delete in Solr based on foreign key (like SQL delete from … where id in (select id from…)
Date Wed, 15 Oct 2014 09:23:45 GMT
Absolutely, using Mikhail's code would be the first thing I would do. You
can see the details in SOLR-6234 and
https://github.com/m-khl/lucene-join-solr-query-parser

Otherwise, the only alternative I can think of (without reindexing) would
be to run the select query as provided, returning the ID's of the offending
documents (for reference, you could use grouping or the collapsing query
parser if you just want to get distinct values; faceting is also an
option). Then write a script to iterate through a batch of ID's at a time
and send a delete to Solr, such as <delete><query>id:(100 OR 101 OR
...)</query></delete>. Since there are many documents to delete, you would
want to hold off committing until the end.

On 11 October 2014 02:34, Mikhail Khludnev <mkhludnev@griddynamics.com>
wrote:

> On Fri, Oct 10, 2014 at 6:16 AM, Matthew Nigl <matthew.nigl@gmail.com>
> wrote:
>
> > But I get the same response as in
> > https://issues.apache.org/jira/browse/SOLR-6357
> >
>
> there is a mention for cure (SOLR-6234
> <https://issues.apache.org/jira/browse/SOLR-6234>) over there
>
> --
> Sincerely yours
> Mikhail Khludnev
> Principal Engineer,
> Grid Dynamics
>
> <http://www.griddynamics.com>
> <mkhludnev@griddynamics.com>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message