Assuming your document consists of a single text field and unique id (name +
revision number), you may just store document content plus 3 latest
revisions within 8 different fields of a single Lucene document. Surely, you
have to name the fields properly, so that you can construct revision url
during results rendering. This method assumes you will determine what
revision numbers to store during document indexing.

Regards,
Pavlo Zahozhenko, Comindwork http://comindwork.com


On Tue, Sep 8, 2009 at 9:39 AM, Anders Lybecker <[email protected]> wrote:

> Hi all,
>
> I have a requirement that I’m not sure how to solve with Lucene. Any help
> appreciated.
>
> The solution searches through documents and each document can have multiple
> revisions. Each document revision is unique identified by document name and
> revision number. The revision number is incremental, but not sequential –
> meaning that document X can have revision 1 and 3, but not necessarily
> revision 2. Revision number can skip numbers in the sequence.
>
> The requirement dictates that the users shall be able to search in the
> current revision or 3 last revisions only. How do I solve that with Lucene?
>
> I could keep a record for all revisions for each document, but I’ll prefer
> not to.
>
> Regards,
> Anders Lybecker
>

Reply via email to