You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by mi...@apache.org on 2023/11/02 11:05:46 UTC
(lucene) branch branch_9x updated: LUCENE-10100: configuration items of the alg file are adapted to the 9.0 branch (#301)
This is an automated email from the ASF dual-hosted git repository.
mikemccand pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/lucene.git
The following commit(s) were added to refs/heads/branch_9x by this push:
new b3e3524acb7 LUCENE-10100: configuration items of the alg file are adapted to the 9.0 branch (#301)
b3e3524acb7 is described below
commit b3e3524acb7377b9c747ff97962f696f9668bd0c
Author: xiaoshi <xi...@gmail.com>
AuthorDate: Thu Nov 2 19:02:31 2023 +0800
LUCENE-10100: configuration items of the alg file are adapted to the 9.0 branch (#301)
---
lucene/benchmark/conf/analyzer.alg | 4 ++--
lucene/benchmark/conf/collector-small.alg | 2 +-
lucene/benchmark/conf/collector.alg | 2 +-
lucene/benchmark/conf/compound-penalty.alg | 4 ++--
lucene/benchmark/conf/english-porter-comparison.alg | 3 ++-
lucene/benchmark/conf/facets.alg | 3 ++-
lucene/benchmark/conf/highlights.alg | 3 ++-
.../conf/indexing-flush-by-RAM-multithreaded.alg | 4 ++--
lucene/benchmark/conf/indexing-flush-by-RAM.alg | 4 ++--
lucene/benchmark/conf/indexing-multithreaded.alg | 4 ++--
lucene/benchmark/conf/indexing.alg | 4 ++--
lucene/benchmark/conf/micro-standard-flush-by-ram.alg | 4 ++--
lucene/benchmark/conf/sample.alg | 4 ++--
lucene/benchmark/conf/shingle.alg | 3 ++-
lucene/benchmark/conf/sloppy-phrase.alg | 3 ++-
lucene/benchmark/conf/sort-standard.alg | 3 ++-
lucene/benchmark/conf/standard-flush-by-RAM.alg | 4 ++--
lucene/benchmark/conf/standard.alg | 4 ++--
lucene/benchmark/conf/wstok.alg | 3 ++-
.../lucene/benchmark/byTask/tasks/NewAnalyzerTask.java | 18 +++++++-----------
20 files changed, 43 insertions(+), 40 deletions(-)
diff --git a/lucene/benchmark/conf/analyzer.alg b/lucene/benchmark/conf/analyzer.alg
index 497ec3d216d..4ed777915bd 100644
--- a/lucene/benchmark/conf/analyzer.alg
+++ b/lucene/benchmark/conf/analyzer.alg
@@ -32,8 +32,8 @@ doc.tokenized=true
doc.term.vector=false
log.step=500
-docs.dir=reuters-out
-#docs.dir=reuters-111
+work.dir=data
+docs.dir=reuters21578
content.source=org.apache.lucene.benchmark.byTask.feeds.ReutersContentSource
diff --git a/lucene/benchmark/conf/collector-small.alg b/lucene/benchmark/conf/collector-small.alg
index 763cb0454ad..e57ee8646b1 100644
--- a/lucene/benchmark/conf/collector-small.alg
+++ b/lucene/benchmark/conf/collector-small.alg
@@ -21,7 +21,7 @@
# Fully Qualified Class Name of a Collector with a empty constructor
# topScoreDocOrdered - Creates a TopScoreDocCollector that requires in order docs
# topScoreDocUnordered - Like above, but allows out of order
-collector.class=coll:topScoreDocOrdered:topScoreDocUnordered:topScoreDocOrdered:topScoreDocUnordered
+collector.class=coll:topScoreDoc
analyzer=org.apache.lucene.analysis.core.WhitespaceAnalyzer
directory=FSDirectory
diff --git a/lucene/benchmark/conf/collector.alg b/lucene/benchmark/conf/collector.alg
index d85582a7ba2..e2843492dca 100644
--- a/lucene/benchmark/conf/collector.alg
+++ b/lucene/benchmark/conf/collector.alg
@@ -21,7 +21,7 @@
# Fully Qualified Class Name of a Collector with a empty constructor
# topScoreDocOrdered - Creates a TopScoreDocCollector that requires in order docs
# topScoreDocUnordered - Like above, but allows out of order
-collector.class=coll:topScoreDocOrdered:topScoreDocUnordered:topScoreDocOrdered:topScoreDocUnordered
+collector.class=coll:topScoreDoc
analyzer=org.apache.lucene.analysis.core.WhitespaceAnalyzer
directory=FSDirectory
diff --git a/lucene/benchmark/conf/compound-penalty.alg b/lucene/benchmark/conf/compound-penalty.alg
index 06b2821f04b..8626baa571a 100644
--- a/lucene/benchmark/conf/compound-penalty.alg
+++ b/lucene/benchmark/conf/compound-penalty.alg
@@ -37,8 +37,8 @@ doc.term.vector=vector:true:true:false:false
log.step=500
log.step.DeleteDoc=100
-docs.dir=reuters-out
-#docs.dir=reuters-111
+work.dir=data
+docs.dir=reuters21578
content.source=org.apache.lucene.benchmark.byTask.feeds.ReutersContentSource
diff --git a/lucene/benchmark/conf/english-porter-comparison.alg b/lucene/benchmark/conf/english-porter-comparison.alg
index e83f04a8dae..e391c0b0d8d 100644
--- a/lucene/benchmark/conf/english-porter-comparison.alg
+++ b/lucene/benchmark/conf/english-porter-comparison.alg
@@ -20,7 +20,8 @@
content.source=org.apache.lucene.benchmark.byTask.feeds.ReutersContentSource
doc.tokenized=false
doc.body.tokenized=true
-docs.dir=reuters-out
+work.dir=data
+docs.dir=reuters21578
-AnalyzerFactory(name:original-porter-stemmer,StandardTokenizer,
EnglishPossessiveFilter,LowerCaseFilter,StopFilter,
diff --git a/lucene/benchmark/conf/facets.alg b/lucene/benchmark/conf/facets.alg
index 63e7cac7374..32d7270e3b4 100644
--- a/lucene/benchmark/conf/facets.alg
+++ b/lucene/benchmark/conf/facets.alg
@@ -30,7 +30,8 @@ doc.tokenized=true
doc.term.vector=false
log.step=1000
-docs.dir=reuters-out
+work.dir=data
+docs.dir=reuters21578
content.source=org.apache.lucene.benchmark.byTask.feeds.ReutersContentSource
diff --git a/lucene/benchmark/conf/highlights.alg b/lucene/benchmark/conf/highlights.alg
index 88b056ecee4..7c5fd7d7337 100644
--- a/lucene/benchmark/conf/highlights.alg
+++ b/lucene/benchmark/conf/highlights.alg
@@ -30,7 +30,8 @@ doc.term.vector.offsets=false
doc.term.vector.positions=false
log.step=2000
-docs.dir=reuters-out
+work.dir=data
+docs.dir=reuters21578
content.source=org.apache.lucene.benchmark.byTask.feeds.ReutersContentSource
diff --git a/lucene/benchmark/conf/indexing-flush-by-RAM-multithreaded.alg b/lucene/benchmark/conf/indexing-flush-by-RAM-multithreaded.alg
index 43a6c91bbeb..d86e182a172 100644
--- a/lucene/benchmark/conf/indexing-flush-by-RAM-multithreaded.alg
+++ b/lucene/benchmark/conf/indexing-flush-by-RAM-multithreaded.alg
@@ -32,8 +32,8 @@ doc.tokenized=true
doc.term.vector=false
log.step=2000
-docs.dir=reuters-out
-#docs.dir=reuters-111
+work.dir=data
+docs.dir=reuters21578
#content.source=org.apache.lucene.benchmark.byTask.feeds.SingleDocSource
content.source=org.apache.lucene.benchmark.byTask.feeds.ReutersContentSource
diff --git a/lucene/benchmark/conf/indexing-flush-by-RAM.alg b/lucene/benchmark/conf/indexing-flush-by-RAM.alg
index 0b6c79762ef..0a911c94086 100644
--- a/lucene/benchmark/conf/indexing-flush-by-RAM.alg
+++ b/lucene/benchmark/conf/indexing-flush-by-RAM.alg
@@ -32,8 +32,8 @@ doc.tokenized=true
doc.term.vector=false
log.step=2000
-docs.dir=reuters-out
-#docs.dir=reuters-111
+work.dir=data
+docs.dir=reuters21578
#content.source=org.apache.lucene.benchmark.byTask.feeds.SingleDocSource
content.source=org.apache.lucene.benchmark.byTask.feeds.ReutersContentSource
diff --git a/lucene/benchmark/conf/indexing-multithreaded.alg b/lucene/benchmark/conf/indexing-multithreaded.alg
index 1d2e18e260d..b34b8266178 100644
--- a/lucene/benchmark/conf/indexing-multithreaded.alg
+++ b/lucene/benchmark/conf/indexing-multithreaded.alg
@@ -32,8 +32,8 @@ doc.tokenized=true
doc.term.vector=false
log.step=2000
-docs.dir=reuters-out
-#docs.dir=reuters-111
+work.dir=data
+docs.dir=reuters21578
#content.source=org.apache.lucene.benchmark.byTask.feeds.SingleDocSource
content.source=org.apache.lucene.benchmark.byTask.feeds.ReutersContentSource
diff --git a/lucene/benchmark/conf/indexing.alg b/lucene/benchmark/conf/indexing.alg
index e31f87185b1..b4a4d92fc26 100644
--- a/lucene/benchmark/conf/indexing.alg
+++ b/lucene/benchmark/conf/indexing.alg
@@ -32,8 +32,8 @@ doc.tokenized=true
doc.term.vector=false
log.step=2000
-docs.dir=reuters-out
-#docs.dir=reuters-111
+work.dir=data
+docs.dir=reuters21578
#content.source=org.apache.lucene.benchmark.byTask.feeds.SingleDocSource
content.source=org.apache.lucene.benchmark.byTask.feeds.ReutersContentSource
diff --git a/lucene/benchmark/conf/micro-standard-flush-by-ram.alg b/lucene/benchmark/conf/micro-standard-flush-by-ram.alg
index 993e58a883d..d4a22f12495 100644
--- a/lucene/benchmark/conf/micro-standard-flush-by-ram.alg
+++ b/lucene/benchmark/conf/micro-standard-flush-by-ram.alg
@@ -31,8 +31,8 @@ doc.tokenized=true
doc.term.vector=false
log.step=500
-docs.dir=reuters-out
-#docs.dir=reuters-111
+work.dir=data
+docs.dir=reuters21578
#content.source=org.apache.lucene.benchmark.byTask.feeds.SingleDocSource
content.source=org.apache.lucene.benchmark.byTask.feeds.ReutersContentSource
diff --git a/lucene/benchmark/conf/sample.alg b/lucene/benchmark/conf/sample.alg
index 4f93230bfc7..aa63293de6c 100644
--- a/lucene/benchmark/conf/sample.alg
+++ b/lucene/benchmark/conf/sample.alg
@@ -42,8 +42,8 @@ doc.tokenized=true
doc.term.vector=false
log.step=500
-docs.dir=reuters-out
-#docs.dir=reuters-111
+work.dir=data
+docs.dir=reuters21578
content.source=org.apache.lucene.benchmark.byTask.feeds.SingleDocSource
#content.source=org.apache.lucene.benchmark.byTask.feeds.ReutersContentSource
diff --git a/lucene/benchmark/conf/shingle.alg b/lucene/benchmark/conf/shingle.alg
index b0744341c76..67b513064a1 100644
--- a/lucene/benchmark/conf/shingle.alg
+++ b/lucene/benchmark/conf/shingle.alg
@@ -16,7 +16,8 @@
content.source=org.apache.lucene.benchmark.byTask.feeds.ReutersContentSource
doc.tokenized=false
doc.body.tokenized=true
-docs.dir=reuters-out
+work.dir=data
+docs.dir=reuters21578
log.step=1000
-AnalyzerFactory(name:shingle-bigrams-unigrams,
diff --git a/lucene/benchmark/conf/sloppy-phrase.alg b/lucene/benchmark/conf/sloppy-phrase.alg
index 4d06d6fdbe0..4c49ddd59e6 100644
--- a/lucene/benchmark/conf/sloppy-phrase.alg
+++ b/lucene/benchmark/conf/sloppy-phrase.alg
@@ -30,7 +30,8 @@ doc.tokenized=true
doc.term.vector=false
log.step=500
-docs.dir=reuters-out
+work.dir=data
+docs.dir=reuters21578
#docs.dir=reuters-111
content.source=org.apache.lucene.benchmark.byTask.feeds.SingleDocSource
diff --git a/lucene/benchmark/conf/sort-standard.alg b/lucene/benchmark/conf/sort-standard.alg
index 48cae964dbe..08c7b90b0cd 100644
--- a/lucene/benchmark/conf/sort-standard.alg
+++ b/lucene/benchmark/conf/sort-standard.alg
@@ -31,7 +31,8 @@ doc.tokenized=true
doc.term.vector=false
log.step=100000
-docs.dir=reuters-out
+work.dir=data
+docs.dir=reuters21578
content.source=org.apache.lucene.benchmark.byTask.feeds.SortableSingleDocSource
diff --git a/lucene/benchmark/conf/standard-flush-by-RAM.alg b/lucene/benchmark/conf/standard-flush-by-RAM.alg
index 3ceed106fae..c3cb2789b98 100644
--- a/lucene/benchmark/conf/standard-flush-by-RAM.alg
+++ b/lucene/benchmark/conf/standard-flush-by-RAM.alg
@@ -31,8 +31,8 @@ doc.tokenized=true
doc.term.vector=false
log.step=2000
-docs.dir=reuters-out
-#docs.dir=reuters-111
+work.dir=data
+docs.dir=reuters21578
#content.source=org.apache.lucene.benchmark.byTask.feeds.SingleDocSource
content.source=org.apache.lucene.benchmark.byTask.feeds.ReutersContentSource
diff --git a/lucene/benchmark/conf/standard.alg b/lucene/benchmark/conf/standard.alg
index 4d0b0480ffe..4885593954b 100644
--- a/lucene/benchmark/conf/standard.alg
+++ b/lucene/benchmark/conf/standard.alg
@@ -31,8 +31,8 @@ doc.tokenized=true
doc.term.vector=false
log.step=2000
-docs.dir=reuters-out
-#docs.dir=reuters-111
+work.dir=data
+docs.dir=reuters21578
#content.source=org.apache.lucene.benchmark.byTask.feeds.SingleDocSource
content.source=org.apache.lucene.benchmark.byTask.feeds.ReutersContentSource
diff --git a/lucene/benchmark/conf/wstok.alg b/lucene/benchmark/conf/wstok.alg
index c43759032c3..ab6a6593c5c 100644
--- a/lucene/benchmark/conf/wstok.alg
+++ b/lucene/benchmark/conf/wstok.alg
@@ -18,7 +18,8 @@
content.source=org.apache.lucene.benchmark.byTask.feeds.ReutersContentSource
doc.tokenized=false
doc.body.tokenized=true
-docs.dir=reuters-out
+work.dir=data
+docs.dir=reuters21578
-AnalyzerFactory(name:WhitespaceTokenizer, WhitespaceTokenizer(rule:java))
diff --git a/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/NewAnalyzerTask.java b/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/NewAnalyzerTask.java
index 2248756998e..032019f1e4e 100644
--- a/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/NewAnalyzerTask.java
+++ b/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/NewAnalyzerTask.java
@@ -23,9 +23,9 @@ import java.lang.reflect.Constructor;
import java.util.ArrayList;
import java.util.List;
import org.apache.lucene.analysis.Analyzer;
+import org.apache.lucene.analysis.CharArraySet;
import org.apache.lucene.benchmark.byTask.PerfRunData;
import org.apache.lucene.benchmark.byTask.utils.AnalyzerFactory;
-import org.apache.lucene.util.Version;
/**
* Create a new {@link org.apache.lucene.analysis.Analyzer} and set it in the getRunData() for use
@@ -42,17 +42,13 @@ public class NewAnalyzerTask extends PerfTask {
public static final Analyzer createAnalyzer(String className) throws Exception {
final Class<? extends Analyzer> clazz = Class.forName(className).asSubclass(Analyzer.class);
- try {
- // first try to use a ctor with version parameter (needed for many new Analyzers that have no
- // default one anymore
- Constructor<? extends Analyzer> cnstr = clazz.getConstructor(Version.class);
- return cnstr.newInstance(Version.LATEST);
- } catch (
- @SuppressWarnings("unused")
- NoSuchMethodException nsme) {
- // otherwise use default ctor
- return clazz.getConstructor().newInstance();
+ Constructor<? extends Analyzer> cnstr;
+ if (className.equals("org.apache.lucene.analysis.core.StopAnalyzer")) {
+ cnstr = clazz.getConstructor(CharArraySet.class);
+ return cnstr.newInstance(CharArraySet.EMPTY_SET);
}
+ cnstr = clazz.getConstructor();
+ return cnstr.newInstance();
}
@Override