Re: [ajax-solr] Delete in Solr based on foreign key (like SQL delete from ... where id in (select id from...)

32 views
Skip to first unread message
Message has been deleted

James McKinney

unread,
Oct 9, 2014, 10:47:24 AM10/9/14
to ajax...@googlegroups.com
Hi Luis,


This list is only about ajax-solr.

James

On Oct 9, 2014, at 5:06 AM, Luis Festas Matos <luf...@gmail.com> wrote:

Hi all, I'm relatively new to SOLR and this is my first post in this group. I've searched and not found similar questions, but if there are, please let me know.

Given the following Solr data:

<doc>
    <str name="index_id">1008rs1cz0icl2pk</str>
    <date name="message_state_ts">2014-10-07T14:18:29.784Z</date>
    <str name="docid_s">h60fmtybz0i7sx87</str>
    <long name="_version_">1481314421768716288</long>
</doc>
<doc>
    <str name="index_id">u42xyz1cz0i7sx87</str>
    <str name="foreign_key_docid_s">h60fmtybz0i7sx87</str>
    <long name="_version_">1481314421768716288</long>
</doc>
<doc>
   <str name="index_id">u42xyz1cz0i7sx87</str>
   <str name="foreign_key_docid_s">h60fmtybz0i7sx87</str>
   <long name="_version_">1481314421448900608</long>
</doc>

I would like to know how to DELETE documents above on the Solr console or using a script that achieves the same result as issuing the following statement in SQL (assuming all of these columns existed in a table called x):

DELETE FROM x WHERE foreign_key_docid_s in (select docid_s from x where message_state_ts < '2014-10-05' and message_state_ts > '2014-10-01')

--
You received this message because you are subscribed to the Google Groups "ajax-solr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ajax-solr+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Luis Festas Matos

unread,
Oct 9, 2014, 4:23:41 PM10/9/14
to ajax...@googlegroups.com
Hi James,

Thanks. I've removed the question and I'm removing myself. Too bad that there's no list here.
Reply all
Reply to author
Forward
0 new messages