comparison src/goodjava/lucene/api/MultiFieldParserConfig.java @ 1528:3bd4d7963456

use goodjava/lucene/api
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 26 Jul 2020 23:11:53 -0600
parents f848d40b3b07
children f48db13ae2d9
comparison
equal deleted inserted replaced
1527:fa1e3adbebfb 1528:3bd4d7963456
2 2
3 import java.util.Map; 3 import java.util.Map;
4 import java.util.Collections; 4 import java.util.Collections;
5 import org.apache.lucene.analysis.Analyzer; 5 import org.apache.lucene.analysis.Analyzer;
6 import org.apache.lucene.analysis.core.KeywordAnalyzer; 6 import org.apache.lucene.analysis.core.KeywordAnalyzer;
7 import org.apache.lucene.index.IndexWriterConfig;
8 import org.apache.lucene.util.Version;
7 import goodjava.lucene.queryparser.MultiFieldParser; 9 import goodjava.lucene.queryparser.MultiFieldParser;
8 import goodjava.lucene.queryparser.FieldParser; 10 import goodjava.lucene.queryparser.FieldParser;
9 import goodjava.lucene.queryparser.StringFieldParser; 11 import goodjava.lucene.queryparser.StringFieldParser;
10 12
11 13
12 public class MultiFieldParserConfig implements GoodIndexWriterConfig { 14 public class MultiFieldParserConfig implements GoodIndexWriterConfig {
15 private final Version luceneVersion;
13 private final MultiFieldParser mfp; 16 private final MultiFieldParser mfp;
14 17
15 public MultiFieldParserConfig(MultiFieldParser mfp) { 18 public MultiFieldParserConfig(Version luceneVersion,MultiFieldParser mfp) {
19 this.luceneVersion = luceneVersion;
16 this.mfp = mfp; 20 this.mfp = mfp;
21 }
22
23 public IndexWriterConfig newLuceneConfig() {
24 return new IndexWriterConfig(luceneVersion,new FieldAnalyzer());
17 } 25 }
18 26
19 public final boolean isIndexed(String fieldName) { 27 public final boolean isIndexed(String fieldName) {
20 return mfp.fields.containsKey(fieldName); 28 return mfp.fields.containsKey(fieldName);
21 } 29 }