Skip to content

Commit

Permalink
Fix TestFeatureField.testStoreTermVectors failure. (#14146)
Browse files Browse the repository at this point in the history
The error message is a bit different depending on whether you append to
an existing `IndexingChain.PerField` object or to a new one.
  • Loading branch information
jpountz authored Jan 16, 2025
1 parent e4b85ca commit 5c91f15
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/
package org.apache.lucene.document;

import static org.hamcrest.Matchers.anyOf;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;

Expand Down Expand Up @@ -480,7 +481,9 @@ public void testStoreTermVectors() throws Exception {
FeatureField invalid = new FeatureField("features", "pagerank", 1, false);
doc.add(invalid);
var exc = expectThrows(Exception.class, () -> writer.addDocument(doc));
assertThat(exc.getMessage(), containsString("store term vector"));
assertThat(
exc.getMessage(),
anyOf(containsString("store term vector"), containsString("storeTermVector")));

writer.forceMerge(1);
DirectoryReader reader = writer.getReader();
Expand Down

0 comments on commit 5c91f15

Please sign in to comment.