Lucene中多值域的阶是稳定的吗?

Lucene中多值域的阶是稳定的吗?,lucene,lucene.net,Lucene,Lucene.net,假设我在同一字段名下向文档添加多个值: doc.Add( new Field( "tag", "one" ) ); doc.Add( new Field( "tag", "two" ) ); doc.Add( new Field( "tag", "three" ) ); doc.Add( new Field( "tag", "four" ) ); 如果我随后从文档的新实例(从搜索结果)中检索这些字段,是否可以保证数组中字段的顺序保持不变 Field[] fields = doc.GetFiel

假设我在同一字段名下向
文档
添加多个值:

doc.Add( new Field( "tag", "one" ) );
doc.Add( new Field( "tag", "two" ) );
doc.Add( new Field( "tag", "three" ) );
doc.Add( new Field( "tag", "four" ) );
如果我随后从
文档
的新实例(从搜索结果)中检索这些字段,是否可以保证数组中
字段
的顺序保持不变

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" );

当前的代码是这样的,但没有任何保证,因此它可能会随时更改


我不指望它。

嗯,我现在就要做这些,所以我可能不得不这样做。我不会更新Lucene引擎,除非它仍然是这样。