lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <luc...@mikemccandless.com>
Subject Re: custom indexing
Date Wed, 16 Jun 2010 14:53:30 GMT
On Wed, Jun 16, 2010 at 10:30 AM, John Wang <john.wang@gmail.com> wrote:
> Thanks Michael!
> For 1), I only see the api to get the uniqueTerms for the entire reader, not
> for a specific field. Am I looking at the wrong place?

Ahh sorry I missed that you need it per-field.  Yes, flex now makes it
possible.  If the reader is composite, do this:

  MultiFields.getTerms(reader, field).getUniqueTermCount();

else (definitely a single segment):

  reader.fields().terms(field).getUniqueTermCount()

(But you should null-check the returned Fields (in case reader has no
fields) and Terms (in case the specified field does not exist)).

> 2) Awesome!!! Is there a wiki on flex indexing somewhere?

There's a start at http://wiki.apache.org/lucene-java/FlexibleIndexing

But it doesn't document in detail how to make your own Codec --
probably simplest way to get started is look @ the core Codecs.

Mike

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message