comparison src/goodjava/lucene/api/MultiFieldParserConfig.java @ 1687:f48db13ae2d9

unlogged lucene support
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 09 Jun 2022 19:44:41 -0600
parents 3bd4d7963456
children
comparison
equal deleted inserted replaced
1686:e34b73678a4f 1687:f48db13ae2d9
18 public MultiFieldParserConfig(Version luceneVersion,MultiFieldParser mfp) { 18 public MultiFieldParserConfig(Version luceneVersion,MultiFieldParser mfp) {
19 this.luceneVersion = luceneVersion; 19 this.luceneVersion = luceneVersion;
20 this.mfp = mfp; 20 this.mfp = mfp;
21 } 21 }
22 22
23 public IndexWriterConfig newLuceneConfig() { 23 @Override public IndexWriterConfig newLuceneConfig() {
24 return new IndexWriterConfig(luceneVersion,new FieldAnalyzer()); 24 return new IndexWriterConfig(luceneVersion,new FieldAnalyzer());
25 } 25 }
26 26
27 public final boolean isIndexed(String fieldName) { 27 @Override public final boolean isIndexed(String fieldName) {
28 return mfp.fields.containsKey(fieldName); 28 return mfp.fields.containsKey(fieldName);
29 } 29 }
30 30
31 public final Analyzer getAnalyzer(String fieldName) { 31 @Override public final Analyzer getAnalyzer(String fieldName) {
32 FieldParser fp = mfp.fields.get(fieldName); 32 FieldParser fp = mfp.fields.get(fieldName);
33 if( !(fp instanceof StringFieldParser) ) 33 if( !(fp instanceof StringFieldParser) )
34 return null; 34 return null;
35 StringFieldParser sfp = (StringFieldParser)fp; 35 StringFieldParser sfp = (StringFieldParser)fp;
36 Analyzer analyzer = sfp.analyzer; 36 Analyzer analyzer = sfp.analyzer;
37 return analyzer instanceof KeywordAnalyzer ? null : analyzer; 37 return analyzer instanceof KeywordAnalyzer ? null : analyzer;
38 } 38 }
39 39
40 private static final MoreFieldInfo noMoreFieldInfo = new MoreFieldInfo(Collections.emptyMap(),Collections.emptyMap()); 40 private static final MoreFieldInfo noMoreFieldInfo = new MoreFieldInfo(Collections.emptyMap(),Collections.emptyMap());
41 41
42 public MoreFieldInfo getMoreFieldInfo(Map<String,Object> storedFields) { 42 @Override public MoreFieldInfo getMoreFieldInfo(Map<String,Object> storedFields) {
43 return noMoreFieldInfo; 43 return noMoreFieldInfo;
44 } 44 }
45 } 45 }