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);
----- Original Message ----
From: Stefan Trcek <[email protected]>
To: [email protected]
Sent: Wed, 17 March, 2010 16:15:36
Subject: Get info wheter a field is multivalued
Hello
Is there an api that indicates whether a field is multivalued, just like
IndexReader.getFieldNames(IndexReader.FieldOption fldOption) does it
for fields beeing indexed/stored/termvector?
Of course I could track it at index time.
Stefan
---------------------------------------------------------------------
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]