Updated Branches: refs/heads/master e808115e1 -> 7db10b4d0
LUCY-250 Add delete_by_doc_id() to Indexer. Expose expert, low-level deletion API to complement other deletion methods. Project: http://git-wip-us.apache.org/repos/asf/lucy/repo Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/7db10b4d Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/7db10b4d Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/7db10b4d Branch: refs/heads/master Commit: 7db10b4d022d4f437f75f5e2b7f73f0418bd1e33 Parents: e808115 Author: Marvin Humphrey <[email protected]> Authored: Tue Jan 22 14:35:07 2013 -0800 Committer: Marvin Humphrey <[email protected]> Committed: Tue Jan 22 14:35:07 2013 -0800 ---------------------------------------------------------------------- core/Lucy/Index/Indexer.c | 5 +++++ core/Lucy/Index/Indexer.cfh | 7 +++++++ perl/buildlib/Lucy/Build/Binding/Index.pm | 1 + 3 files changed, 13 insertions(+), 0 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucy/blob/7db10b4d/core/Lucy/Index/Indexer.c ---------------------------------------------------------------------- diff --git a/core/Lucy/Index/Indexer.c b/core/Lucy/Index/Indexer.c index e019614..1a9076d 100644 --- a/core/Lucy/Index/Indexer.c +++ b/core/Lucy/Index/Indexer.c @@ -304,6 +304,11 @@ Indexer_delete_by_query(Indexer *self, Query *query) { } void +Indexer_delete_by_doc_id(Indexer *self, int32_t doc_id) { + DelWriter_Delete_By_Doc_ID(self->del_writer, doc_id); +} + +void Indexer_add_index(Indexer *self, Obj *index) { Folder *other_folder = NULL; IndexReader *reader = NULL; http://git-wip-us.apache.org/repos/asf/lucy/blob/7db10b4d/core/Lucy/Index/Indexer.cfh ---------------------------------------------------------------------- diff --git a/core/Lucy/Index/Indexer.cfh b/core/Lucy/Index/Indexer.cfh index 4dfc3dc..e7b8745 100644 --- a/core/Lucy/Index/Indexer.cfh +++ b/core/Lucy/Index/Indexer.cfh @@ -112,6 +112,13 @@ public class Lucy::Index::Indexer inherits Clownfish::Obj { public void Delete_By_Query(Indexer *self, Query *query); + /** Mark the document identified by the supplied document ID as deleted. + * + * @param doc_id A L<document id|Lucy::Docs::DocIDs>. + */ + public void + Delete_By_Doc_ID(Indexer *self, int32_t doc_id); + /** Optimize the index for search-time performance. This may take a * while, as it can involve rewriting large amounts of data. * http://git-wip-us.apache.org/repos/asf/lucy/blob/7db10b4d/perl/buildlib/Lucy/Build/Binding/Index.pm ---------------------------------------------------------------------- diff --git a/perl/buildlib/Lucy/Build/Binding/Index.pm b/perl/buildlib/Lucy/Build/Binding/Index.pm index bfaec63..13e4fee 100644 --- a/perl/buildlib/Lucy/Build/Binding/Index.pm +++ b/perl/buildlib/Lucy/Build/Binding/Index.pm @@ -444,6 +444,7 @@ sub bind_indexer { Prepare_Commit Delete_By_Term Delete_By_Query + Delete_By_Doc_ID Get_Schema ); my @hand_rolled = qw( Add_Doc );
