public virtual void TestIndexedBit()
{
using Directory dir = NewDirectory();
IndexReader r = null;
try
{
using (RandomIndexWriter w = new RandomIndexWriter(Random, dir))
{
Document doc = new Document();
FieldType onlyStored = new FieldType();
onlyStored.IsStored = true;
doc.Add(new Field("field", "value", onlyStored));
doc.Add(new StringField("field2", "value", Field.Store.YES));
w.AddDocument(doc);
r = w.GetReader();
} // w.Dispose();
Assert.IsFalse(r.Document(0).GetField("field").IndexableFieldType.IsIndexed);
Assert.IsTrue(r.Document(0).GetField("field2").IndexableFieldType.IsIndexed);
}
finally
{
r?.Dispose();
}
}