Directory dir = newDirectory();
IndexWriterConfig iwc = new IndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random()));
iwc.setMergePolicy(newLogMergePolicy());
IndexWriter iw = new IndexWriter(dir, iwc);
Document doc = new Document();
doc.add(new StringField("field1", "sometext", Field.Store.YES));
doc.add(new TextField("field2", "sometext", Field.Store.NO));
doc.add(new StringField("foo", "bar", Field.Store.NO));
iw.addDocument(doc); // add an 'ok' document
try {
doc = new Document();
// try to boost with norms omitted
List<IndexableField> list = new ArrayList<IndexableField>();