lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ulrich Mayring <>
Subject Re: Hierarchical document
Date Mon, 20 Oct 2003 15:18:11 GMT
Tom Howe wrote:
> Right, but my concern is that each of these levels are really different
> documents.

That's how I understood it. Just add a keyword for each level.

If you want to use just one field, then you can also think of your 
structure as a tree like this:

      doc1     ---- Level 1
      /  \
    doc2  doc3 ---- Level 2
    doc4       ---- Level 4
    doc5       ---- Level 8

This way, if your user says he wants to search in Level 6, you know that 
he really wants to search in levels 2 and 4, because that is the only 
way that you can get 6 (2+4). This enables you to work with just one 
field, because every document only needs to add its level to the index.

If you don't need this flexibility and always want to search from the 
current level on down, then it is even easier. You then modify your 
query to search, where docLevel >= currentLevel.

In any event, all your indexer has to do is add each document's level to 
the index.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message