On Wednesday 17 March 2010 18:42:10 mark harwood wrote:
> Not the fastest thing in the world but works:
>
> Term startTerm=new Term("myFieldName","");
> TermEnum te=reader.terms(startTerm);
> BitSet docsRead=new BitSet(reader.maxDoc());
> boolean multiValued=false;
> do{
> Term t=te.term();
> if((t==null)||(t.field()!=startTerm.field()))
> {
> break;
> }
> TermDocs td = reader.termDocs(t);
> while(td.next())
> {
> if(docsRead.get(td.doc()))
> {
> multiValued=true;
> break;
> }
> docsRead.set(td.doc());
> }
> }while(te.next()&&multiValued==false);
Nice idea. Just running it: 1,5s for 1M terms. I guess I'll track it at
index time.
Thanks,
Stefan
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]