lucene.net - Is the order of multi-valued fields in Lucene stable? -
suppose add several values document
under same field name:
doc.add( new field( "tag", "one" ) ); doc.add( new field( "tag", "two" ) ); doc.add( new field( "tag", "three" ) ); doc.add( new field( "tag", "four" ) );
if later retrieve these fields new instance of document
(from search result), guaranteed order of field
s in array remain same?
field[] fields = doc.getfields( "tag" ); debug.assert( fields[0].stringvalue() == "one" ); debug.assert( fields[1].stringvalue() == "two" ); debug.assert( fields[2].stringvalue() == "three" ); debug.assert( fields[3].stringvalue() == "four" );
current code does, states no guarantees whatsoever, may change @ time.
i wouldn't depend on it.
Comments
Post a Comment