apache / apache/lucene

An Anti-Merging Multi-Directory Indexing Framework [LUCENE-2425]

Open
#3,499 6 comments 0 reactions 0 assignees View on GitHub
affects-version:3.0.1 legacy-jira-label:lucene legacy-jira-label:policy legacy-jira-label:split legacy-jira-priority:Major module:core/index type:enhancement
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

By design, a Lucene index tends to merge documents that span multiple segments into fewer segments, in order to optimize its directory structure, which in turn leads to better search performance. In particular, it relies on a merge policy to specify the set of merge operations that should be performed when the index is optimized.

Often times, there's a need to do the exact opposite, which is to "split" the documents. This calls for a mechanism that facilitates sub-division of documents based on a certain (ideally, user-defined) algorithm. By way of example, one may wish to sub-divide (or partition) documents based on parameters such as time, space, real-timeliness, and so on. Herein, we describe an indexing framework that builds on the Lucene index writer and reader, to address use cases wherein documents need to diverge rather than converge.

In brief, it associates zero or more sub-directories with the index's directory, which serve to complement it in some manner. The sub-directories (a.k.a. splits) are managed by a split policy, which is notified of all changes made to the index directory (a.k.a. super-directory), thus allowing it to modify its sub-directories as it sees fit. To make the index reader and writer "observable", we extend Lucene's reader and writer with the goal of providing hooks into every method that could potentially change the index. This allows for propagation of such changes to the split policy, which essentially acts as a listener on the index.

We refer to each sub-directory (or split) and the super-directory as a sub-index of the containing index (a.k.a. the split index). Note that the sub-directory may not necessarily be co-located with the super-directory. Furthermore, the split policy in turn relies on one or more split rules to determine when to add or remove sub-directories. This allows for a clear separation of the event that triggers a split from the management of those splits.

---
Migrated from [LUCENE-2425](https://issues.apache.org/jira/browse/LUCENE-2425) by Karthick Sankarachary, updated Jul 10 2017
Attachments: [LUCENE-2425.patch](https://apache.github.io/lucene-jira-archive/attachments/LUCENE-2425/LUCENE-2425.patch)
Linked issues:
- #3503
- #3504
- #3505
- #3506
- #3507
- #3508
- #3509

Contributor guide

Open the contributing guide

Research direction

Start by reading the LUCENE-2425 proposal and attached LUCENE-2425.patch, then review linked issues #3503 through #3509 for related scope. Determine whether the proposed split-index framework is still wanted and how its policies, sub-directories, and observable readers and writers should integrate with Lucene. Done requires an agreed design and implementation plan before coding.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
search
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
15/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.