An alternative would be to add the information document to the index first, 
before any others.  This way there is no need to search to access the 
information document, just retrieve document zero.

-- Neal


-----Original Message-----
From: Franklin Simmons [mailto:[email protected]]
Sent: Monday, August 17, 2009 8:35 AM
To: [email protected]
Subject: RE: Lucene index meta-information

Karl,

You could have a document in the index with fields whose names are unique in 
the index, e.g.

Document doc = new Document()
doc.Add(new Field("index_info","infokey", Field.Store.NO, 
Field.Index.UN_TOKENIZED));
doc.Add(new Field("index_generator",generator_comment, Field.Store.YES, 
Field.Index.NO));
indexWriter.AddDocument(doc);

To find the information, search for index_info:infokey and load the field 
index_generator.



-----Original Message-----
From: Karl Geppert [mailto:[email protected]]
Sent: Monday, August 17, 2009 1:08 AM
To: [email protected]
Subject: Lucene index meta-information

Are there any spaces for writing custom header type information into a
lucene index?  I'd like to be able to say something like "this index was
generated with version 3.20.12b of the index generation program with the
following command line ...".

Karl

Reply via email to