Hi Guys
Apologies.......... I am Still Confused.. ;( Let me make it more simple Question On using Search from a Index without any SearchWord, I would like to count the total number of Documents present in it. [ I Only have the Field Types 'Field.Keyword' which stores the Unique filename ] Will IndexReader.termDocs(term) give me the Count for the same. If so How To use it....... Please Thx in advance. Karthik -----Original Message----- From: Paul Elschot [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 17, 2004 2:02 PM To: [EMAIL PROTECTED] Subject: Re: COUNT SUBINDEX [IN MERGERINDEX] On Wednesday 17 November 2004 07:10, Karthik N S wrote: > Hi guy's > > > Apologies..... > > > So A Mergeed Index is again a Single [ addition of subIndexes... ), > > If that case , If One of the Field Types is of type 'Field.Keyword' > whic is Unique across the subIndexes [Before Merging]. > > and If I want to Count this Unique Field in a MergerIndex [After i'ts been > Merged ] How do I do this Please. IndexReader.numDocs() will give the number of docs in an index. Lucene has no direct support for unique fields. After merging, if the same unique field value occurs in both source indexes, the merged index will contain two documents with that value. In case one wants to merge into unique field values, the non unique values in one of the source indexes need to be deleted before merging. See IndexReader.termDocs(term) on how to get the document numbers for (unique) terms via a TermDocs, and IndexReader.delete(docNum) for deleting docs. Regards, Paul. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]