Differences between revisions 5 and 6
Revision 5 as of 2007-07-25 23:31:57
Size: 1570
Editor: 24
Comment: I want to advise original authors that the links are not working anymore!
Revision 6 as of 2009-09-20 21:47:59
Size: 1576
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 9: Line 9:
 URL: [http://mail-archives.apache.org/eyebrowse/ReadMsg?listName=lucene-user@jakarta.apache.org&msgNo=7507]  URL: [[http://mail-archives.apache.org/eyebrowse/ReadMsg?listName=lucene-user@jakarta.apache.org&msgNo=7507]]
Line 14: Line 14:
 '''/Science/Medicine/Serology/blood gas''' [[BR]]  '''/Science/Medicine/Serology/blood gas''' <<BR>>
Line 27: Line 27:
  URL: [http://mail-archives.apache.org/eyebrowse/ReadMsg?listId=30&msgNo=7512], Erik Hatcher   URL: [[http://mail-archives.apache.org/eyebrowse/ReadMsg?listId=30&msgNo=7512]], Erik Hatcher
Line 29: Line 29:
  doc.add(Field.Keyword("category", category1));[[BR]]
  doc.add(Field.Keyword("category", category2));[[BR]]
  doc.add(Field.Keyword("category", category/subcategory1));[[BR]]
  doc.add(Field.Keyword("category", category1));<<BR>>
  doc.add(Field.Keyword("category", category2));<<BR>>
  doc.add(Field.Keyword("category", category/subcategory1));<<BR>>
Line 39: Line 39:
  URL: [http://mail-archives.apache.org/eyebrowse/ReadMsg?listName=lucene-user@jakarta.apache.org&msgNo=7508], Tate Avery   URL: [[http://mail-archives.apache.org/eyebrowse/ReadMsg?listName=lucene-user@jakarta.apache.org&msgNo=7508]], Tate Avery

Using Hierarchical Fields


Original question from

  • URL: http://mail-archives.apache.org/eyebrowse/ReadMsg?listName=lucene-user@jakarta.apache.org&msgNo=7507 Each document I index has an array of categories which looks like the following example....

    /Science/Medicine/Serology/blood gas
    /Biology/Fluids/Blood/ etc. Anyway, there's a couple things I'm trying to deal with. 1- The fact that we have an undefined array size. I can't just shove these into a single field. I could explode them into multiple fields on the fly like category_1, category_2. etc. etc

    2- The fact that a search will need to be performed like "category:/Science/Medicine/*" would need to return all items within that category.


  • Note: Be careful of the analyzer you use.

Alternate answer

HierarchalFields (last edited 2009-09-20 21:47:59 by localhost)