You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Lorenzo Speranzoni (JIRA)" <ji...@apache.org> on 2018/07/05 06:37:00 UTC

[jira] [Comment Edited] (SOLR-6096) Support Update and Delete on nested documents

    [ https://issues.apache.org/jira/browse/SOLR-6096?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16510236#comment-16510236 ] 

Lorenzo Speranzoni edited comment on SOLR-6096 at 7/5/18 6:36 AM:
------------------------------------------------------------------

Many thanks for your fast reply [~mkhludnev] . 

Yes, I saw SOLR-5211 ... and deleteByQuery(_root_:ID) was indeed my candidate solution but unfortunately hbase-indexer doesn't let you create and submit such a statement.

I would need to trigger it from SOLR side as soon as you the parent is cancelled or something like that... don't think postCommit is ideal for that?

Thanks again.


was (Author: inserpio):
Many thanks for your fast reply [~mkhludnev] . 

Yes, I saw SOLR-5211 ... and deleteByQuery(_root_:ID) was indeed my candidate solution but unfortunately hbase-indexer doesn't let you create and submit such a statement (at least for my limited experience with that connector).

I would need to trigger it from SOLR side as soon as you the parent is cancelled or something like that... don't think postCommit is ideal for that?

Thanks again.

> Support Update and Delete on nested documents
> ---------------------------------------------
>
>                 Key: SOLR-6096
>                 URL: https://issues.apache.org/jira/browse/SOLR-6096
>             Project: Solr
>          Issue Type: Improvement
>    Affects Versions: 4.7.2
>            Reporter: Thomas Scheffler
>            Priority: Major
>              Labels: blockjoin, nested
>
> When using nested or child document. Update and delete operation on the root document should also affect the nested documents, as no child can exist without its parent :-)
> Example
> {code:xml|title=First Import}
> <doc>
>   <field name="id">1</field>
>   <field name="title">Article with author</field>
>   <doc>
>     <field name="name">Smith, John</field>
>     <field name="role">author</field>
>   </doc>
> </doc>
> {code}
> If I change my mind and the author was not named *John* but *_Jane_*:
> {code:xml|title=Changed name of author of '1'}
> <doc>
>   <field name="id">1</field>
>   <field name="title">Article with author</field>
>   <doc>
>     <field name="name">Smith, Jane</field>
>     <field name="role">author</field>
>   </doc>
> </doc>
> {code}
> I would expect that John is not in the index anymore. Currently he is. There might also be the case that any subdocument is removed by an update:
> {code:xml|title=Remove author}
> <doc>
>   <field name="id">1</field>
>   <field name="title">Article without author</field>
> </doc>
> {code}
> This should affect a delete on all nested documents, too. The same way all nested documents should be deleted if I delete the root document:
> {code:xml|title=Deletion of '1'}
> <delete>
>   <id>1</id>
>   <!-- implying also
>     <query>_root_:1</query>
>    -->
> </delete>
> {code}
> This is currently possible to do all this stuff on client side by issuing additional request to delete document before every update. It would be more efficient if this could be handled on SOLR side. One would benefit on atomic update. The biggest plus shows when using "delete-by-query". 
> {code:xml|title=Deletion of '1' by query}
> <delete>
>   <query>title:*</query>
>   <!-- implying also
>     <query>_root_:1</query>
>    -->
> </delete>
> {code}
> In that case one would not have to first query all documents and issue deletes by those id and every document that are nested.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org