diff 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
line wrap: on
line diff
--- a/src/goodjava/lucene/api/MultiFieldParserConfig.java	Sun Jul 26 15:06:15 2020 -0600
+++ b/src/goodjava/lucene/api/MultiFieldParserConfig.java	Sun Jul 26 23:11:53 2020 -0600
@@ -4,18 +4,26 @@
 import java.util.Collections;
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.analysis.core.KeywordAnalyzer;
+import org.apache.lucene.index.IndexWriterConfig;
+import org.apache.lucene.util.Version;
 import goodjava.lucene.queryparser.MultiFieldParser;
 import goodjava.lucene.queryparser.FieldParser;
 import goodjava.lucene.queryparser.StringFieldParser;
 
 
 public class MultiFieldParserConfig implements GoodIndexWriterConfig {
+	private final Version luceneVersion;
 	private final MultiFieldParser mfp;
 
-	public MultiFieldParserConfig(MultiFieldParser mfp) {
+	public MultiFieldParserConfig(Version luceneVersion,MultiFieldParser mfp) {
+		this.luceneVersion = luceneVersion;
 		this.mfp = mfp;
 	}
 
+	public IndexWriterConfig newLuceneConfig() {
+		return new IndexWriterConfig(luceneVersion,new FieldAnalyzer());
+	}
+
 	public final boolean isIndexed(String fieldName) {
 		return mfp.fields.containsKey(fieldName);
 	}