|
10 | 10 |
|
11 | 11 | import org.apache.lucene.analysis.Tokenizer; |
12 | 12 | import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; |
| 13 | +import org.apache.lucene.document.BinaryDocValuesField; |
13 | 14 | import org.apache.lucene.document.Field; |
14 | 15 | import org.apache.lucene.document.FieldType; |
15 | 16 | import org.apache.lucene.document.SortedSetDocValuesField; |
16 | 17 | import org.apache.lucene.document.StringField; |
| 18 | +import org.apache.lucene.index.BinaryDocValues; |
17 | 19 | import org.apache.lucene.index.IndexOptions; |
18 | 20 | import org.apache.lucene.index.LeafReaderContext; |
19 | 21 | import org.apache.lucene.index.Term; |
|
48 | 50 | import org.opensearch.index.analysis.IndexAnalyzers; |
49 | 51 | import org.opensearch.index.analysis.NamedAnalyzer; |
50 | 52 | import org.opensearch.index.fielddata.IndexFieldData; |
| 53 | +import org.opensearch.index.fielddata.plain.BinaryIndexFieldData; |
51 | 54 | import org.opensearch.index.fielddata.plain.SortedSetOrdinalsIndexFieldData; |
52 | 55 | import org.opensearch.index.query.QueryShardContext; |
53 | 56 | import org.opensearch.search.DocValueFormat; |
@@ -220,9 +223,9 @@ protected void parseCreateField(ParseContext context) throws IOException { |
220 | 223 | Tokenizer tokenizer = new WildcardFieldTokenizer(); |
221 | 224 | tokenizer.setReader(new StringReader(value)); |
222 | 225 | context.doc().add(new Field(fieldType().name(), tokenizer, FIELD_TYPE)); |
223 | | - context.doc().add(new StringField(fieldType().name(), value, null)); |
| 226 | + //context.doc().add(new StringField(fieldType().name(), value, null)); |
224 | 227 | if (fieldType().hasDocValues()) { |
225 | | - context.doc().add(new SortedSetDocValuesField(fieldType().name(), binaryValue)); |
| 228 | + context.doc().add(new BinaryDocValuesField(fieldType().name(), binaryValue)); |
226 | 229 | } else { |
227 | 230 | if (fieldType().hasDocValues() == false) { |
228 | 231 | createFieldNamesField(context); |
@@ -368,7 +371,7 @@ NamedAnalyzer normalizer() { |
368 | 371 | @Override |
369 | 372 | public IndexFieldData.Builder fielddataBuilder(String fullyQualifiedIndexName, Supplier<SearchLookup> searchLookup) { |
370 | 373 | failIfNoDocValues(); |
371 | | - return new SortedSetOrdinalsIndexFieldData.Builder(name(), CoreValuesSourceType.BYTES); |
| 374 | + return new BinaryIndexFieldData.Builder(name(), CoreValuesSourceType.BYTES); |
372 | 375 | } |
373 | 376 |
|
374 | 377 | @Override |
|
0 commit comments