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]

Reply via email to