Skip to content

Apache Lucene open-source search software

Index only the docs for FacetField posting list (#922)

Gautam Worahbc72a53efc0c
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index 02122d3cd0f..66d0924a870 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -130,6 +130,8 @@ Other
* LUCENE-10604: Improve ability to test and debug triangulation algorithm in Tessellator.
(Craig Taverner)
+* GITHUB#922: Remove unused and confusing FacetField indexing options (Gautam Worah)
+
======================= Lucene 9.2.0 =======================
API Changes
diff --git a/lucene/facet/src/java/org/apache/lucene/facet/FacetField.java b/lucene/facet/src/java/org/apache/lucene/facet/FacetField.java
index 6b675819185..a0fc42599c6 100644
--- a/lucene/facet/src/java/org/apache/lucene/facet/FacetField.java
+++ b/lucene/facet/src/java/org/apache/lucene/facet/FacetField.java
@@ -20,7 +20,7 @@ import java.util.Arrays;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
import org.apache.lucene.document.FieldType;
-import org.apache.lucene.index.IndexOptions;
+import org.apache.lucene.facet.taxonomy.TaxonomyWriter;
/**
* Add an instance of this to your {@link Document} for every facet label.
@@ -30,14 +30,12 @@ import org.apache.lucene.index.IndexOptions;
*/
public class FacetField extends Field {
- /** Field type used for storing facet values: docs, freqs, and positions. */
+ /**
+ * Field type used for storing facet values. Actual field type used for indexing is determined in
+ * {@link FacetsConfig#build(TaxonomyWriter, Document)}
+ */
public static final FieldType TYPE = new FieldType();
- static {
- TYPE.setIndexOptions(IndexOptions.DOCS_AND_FREQS_AND_POSITIONS);
- TYPE.freeze();
- }
-
/** Dimension for this field. */
public final String dim;