You can easily add a properties document to the index with fields for the properties you wish to retain. Marking the fields as stored, but not indexed, will prevent them from appearing a typical end-user search. If this is always the last document added to the index it will be easy to locate. Each evening just delete that document, append your new data, then as a last operation re-add the properties document.
-- Neal -----Original Message----- From: Ron Grabowski [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 05, 2008 4:57 PM To: lucene-net-user@incubator.apache.org Subject: Re: Store simple properties about in index I want to incrementally re-build an index every night. I need to know the last record that's stored in my index so I know what new records need to be added. I suppose I could create a sub-folder beneath my index folder on the file system and serialize a Hashtable of settings. ----- Original Message ---- From: Jokin Cuadrado <[EMAIL PROTECTED]> To: lucene-net-user@incubator.apache.org Sent: Wednesday, November 5, 2008 5:12:59 PM Subject: Re: Store simple properties about in index it's not possible to write individual properties to the Index, As most of the times the lucene index it's just a desnormalized view of what you have in a database, the usual way it's to write and get those properties directly from the database. As for reading, you could access directly to the document via the documentid, but it's a property that it's not reliable, because it changes when you optimize the index. Howewer, a search by a unique keyword it's very fast, so you can make the search and access the document. But, as i said before, for this kind of requeriments it easier to work with a database. รง Jokin. On Wed, Nov 5, 2008 at 10:56 PM, Ron Grabowski <[EMAIL PROTECTED]> wrote: > Is there anyway to read or write simple properties about the index: > > indexWriter.SetProy("MaxTicketId", "1"); > indexWriter.SetProperty("LastUpdatedBy", "anonymous"); > > Console.WriteLine("MaxTicketId: " + indexReader.GetProperty("MaxTicketId")); > > It would be possible to retrieve those properties without having to do a full > search of the index. I shouldn't have to search if I know exactly what I > want.pert >