From 530122631c599be915f8bf33890e1318f4b01d4f Mon Sep 17 00:00:00 2001 From: rclabo Date: Tue, 24 Sep 2024 15:22:03 -0400 Subject: [PATCH 1/5] Make TermStats.TermText public (#959) --- src/Lucene.Net.Misc/Misc/HighFreqTerms.cs | 6 +++--- src/Lucene.Net.Misc/Misc/TermStats.cs | 10 +++++----- src/Lucene.Net.Tests.Misc/Misc/TestHighFreqTerms.cs | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Lucene.Net.Misc/Misc/HighFreqTerms.cs b/src/Lucene.Net.Misc/Misc/HighFreqTerms.cs index 1153f1f21f..fc4f82a222 100644 --- a/src/Lucene.Net.Misc/Misc/HighFreqTerms.cs +++ b/src/Lucene.Net.Misc/Misc/HighFreqTerms.cs @@ -156,7 +156,7 @@ public int Compare(TermStats a, TermStats b) res = a.Field.CompareToOrdinal(b.Field); if (res == 0) { - res = a.termtext.CompareTo(b.termtext); + res = a.TermText.CompareTo(b.TermText); } } return res; @@ -180,7 +180,7 @@ public int Compare(TermStats a, TermStats b) res = a.Field.CompareToOrdinal(b.Field); if (res == 0) { - res = a.termtext.CompareTo(b.termtext); + res = a.TermText.CompareTo(b.TermText); } } return res; @@ -217,4 +217,4 @@ internal void Fill(string field, TermsEnum termsEnum) } } } -} \ No newline at end of file +} diff --git a/src/Lucene.Net.Misc/Misc/TermStats.cs b/src/Lucene.Net.Misc/Misc/TermStats.cs index 18ec5942f1..f057ba89e9 100644 --- a/src/Lucene.Net.Misc/Misc/TermStats.cs +++ b/src/Lucene.Net.Misc/Misc/TermStats.cs @@ -25,14 +25,14 @@ namespace Lucene.Net.Misc /// public sealed class TermStats { - internal readonly BytesRef termtext; + public readonly BytesRef TermText; public string Field { get; set; } public int DocFreq { get; set; } public long TotalTermFreq { get; set; } internal TermStats(string field, BytesRef termtext, int df, long tf) { - this.termtext = BytesRef.DeepCopyOf(termtext); + this.TermText = BytesRef.DeepCopyOf(termtext); this.Field = field; this.DocFreq = df; this.TotalTermFreq = tf; @@ -40,12 +40,12 @@ internal TermStats(string field, BytesRef termtext, int df, long tf) internal string GetTermText() { - return termtext.Utf8ToString(); + return TermText.Utf8ToString(); } public override string ToString() { - return ("TermStats: Term=" + termtext.Utf8ToString() + " DocFreq=" + DocFreq + " TotalTermFreq=" + TotalTermFreq); + return ("TermStats: Term=" + TermText.Utf8ToString() + " DocFreq=" + DocFreq + " TotalTermFreq=" + TotalTermFreq); } } -} \ No newline at end of file +} diff --git a/src/Lucene.Net.Tests.Misc/Misc/TestHighFreqTerms.cs b/src/Lucene.Net.Tests.Misc/Misc/TestHighFreqTerms.cs index 5c72489854..65ab7d4e14 100644 --- a/src/Lucene.Net.Tests.Misc/Misc/TestHighFreqTerms.cs +++ b/src/Lucene.Net.Tests.Misc/Misc/TestHighFreqTerms.cs @@ -122,7 +122,7 @@ public void TestGetHighFreqTerms() for (int i = 0; i < terms.Length; i++) { - string termtext = terms[i].termtext.Utf8ToString(); + string termtext = terms[i].TermText.Utf8ToString(); // hardcoded highTF or highTFmedDF if (termtext.Contains("highTF")) { @@ -195,7 +195,7 @@ public void TestGetTermFreqOrdered() for (int i = 0; i < terms.Length; i++) { - string text = terms[i].termtext.Utf8ToString(); + string text = terms[i].TermText.Utf8ToString(); if (text.Contains("highTF")) { if (text.Contains("medDF")) From cf3ae40776b6dc576b677285b4fdccfd25933aab Mon Sep 17 00:00:00 2001 From: rclabo Date: Wed, 25 Sep 2024 17:02:44 -0400 Subject: [PATCH 2/5] SWEEP: Added XML comments for Main(args) methods that are only intended for command line CLI usage. --- .../Tools/DictionaryBuilder.cs | 14 +++++++++ .../Egothor.Stemmer/Compile.cs | 14 +++++++++ .../Egothor.Stemmer/DiffIt.cs | 14 +++++++++ src/Lucene.Net.Benchmark/ByTask/Benchmark.cs | 7 +++++ .../ByTask/Programmatic/Sample.cs | 16 ++++++++++ .../Quality/Trec/QueryDriver.cs | 17 +++++++++++ .../Quality/Utils/QualityQueriesFinder.cs | 13 +++++++- .../Utils/ExtractReuters.cs | 8 +++++ .../Utils/ExtractWikipedia.cs | 8 +++++ .../Facet/AssociationsFacetsExample.cs | 12 +++++++- .../Facet/DistanceFacetsExample.cs | 11 ++++++- .../ExpressionAggregationFacetsExample.cs | 12 +++++++- .../Facet/MultiCategoryListsFacetsExample.cs | 12 +++++++- .../Facet/RangeFacetsExample.cs | 12 +++++++- .../Facet/SimpleFacetsExample.cs | 12 +++++++- .../Facet/SimpleSortedSetFacetsExample.cs | 12 +++++++- src/Lucene.Net.Demo/IndexFiles.cs | 24 +++++++++++++-- src/Lucene.Net.Demo/SearchFiles.cs | 19 +++++++++++- .../Index/CompoundFileExtractor.cs | 25 ++++++++++++++-- src/Lucene.Net.Misc/Index/IndexSplitter.cs | 20 ++++++++++++- .../Index/MultiPassIndexSplitter.cs | 12 +++++++- src/Lucene.Net.Misc/Misc/GetTermInfo.cs | 21 +++++++++++-- src/Lucene.Net.Misc/Misc/HighFreqTerms.cs | 24 ++++++++++++--- src/Lucene.Net.Misc/Misc/IndexMergeTool.cs | 19 +++++++++++- src/Lucene.Net/Index/CheckIndex.cs | 13 +++++++- src/Lucene.Net/Index/IndexUpgrader.cs | 30 +++++++++++++++---- src/Lucene.Net/Store/LockStressTest.cs | 25 ++++++++++++++-- src/Lucene.Net/Store/LockVerifyServer.cs | 23 ++++++++++++-- 28 files changed, 414 insertions(+), 35 deletions(-) diff --git a/src/Lucene.Net.Analysis.Kuromoji/Tools/DictionaryBuilder.cs b/src/Lucene.Net.Analysis.Kuromoji/Tools/DictionaryBuilder.cs index 83fd993eec..6c286077ad 100644 --- a/src/Lucene.Net.Analysis.Kuromoji/Tools/DictionaryBuilder.cs +++ b/src/Lucene.Net.Analysis.Kuromoji/Tools/DictionaryBuilder.cs @@ -20,6 +20,13 @@ namespace Lucene.Net.Analysis.Ja.Util * limitations under the License. */ + /// + /// LUCENENET specific: This class is not for direct use. In the Java implementation + /// it's Main method was intended to be called from the command line. However in .NET a + /// method within a DLL can't be directly called from the command line so we + /// provide a lucene-cli + /// with a command that maps to that method: analysis kuromoji-build-dictionary. + /// public static class DictionaryBuilder // LUCENENET specific: CA1052 Static holder types should be Static or NotInheritable { public enum DictionaryFormat { IPADIC, UNIDIC }; @@ -62,6 +69,13 @@ ConnectionCostsWriter connectionCosts Console.WriteLine("done"); } + /// + /// LUCENENET specific: This method is not for direct use. In the Java implementation + /// it was intended to be called from the command line. However in .NET a + /// method within a DLL can't be directly called from the command line so we + /// provide a lucene-cli + /// with a command that maps to this method: analysis kuromoji-build-dictionary. + /// public static void Main(string[] args) { DictionaryFormat format; diff --git a/src/Lucene.Net.Analysis.Stempel/Egothor.Stemmer/Compile.cs b/src/Lucene.Net.Analysis.Stempel/Egothor.Stemmer/Compile.cs index a42b1f5381..a1900ab4b0 100644 --- a/src/Lucene.Net.Analysis.Stempel/Egothor.Stemmer/Compile.cs +++ b/src/Lucene.Net.Analysis.Stempel/Egothor.Stemmer/Compile.cs @@ -66,6 +66,13 @@ namespace Egothor.Stemmer { /// /// The Compile class is used to compile a stemmer table. + /// + /// LUCENENET specific: This class is not for direct use. In the Java implementation + /// it's Main method was intended to be called from the command line. However in .NET a + /// method within a DLL can't be directly called from the command line so we + /// provide a lucene-cli + /// with a command that maps to that method: analysis stempel-compile-stems + /// /// public static class Compile // LUCENENET specific: CA1052 Static holder types should be Static or NotInheritable { @@ -74,6 +81,13 @@ public static class Compile // LUCENENET specific: CA1052 Static holder types sh private static Trie trie; /// + /// + /// LUCENENET specific: This class is not for direct use. In the Java implementation + /// it's Main method was intended to be called from the command line. However in .NET a + /// method within a DLL can't be directly called from the command line so we + /// provide a lucene-cli + /// with a command that maps to that method: analysis stempel-compile-stems. + /// /// Entry point to the Compile application. /// /// This program takes any number of arguments: the first is the name of the diff --git a/src/Lucene.Net.Analysis.Stempel/Egothor.Stemmer/DiffIt.cs b/src/Lucene.Net.Analysis.Stempel/Egothor.Stemmer/DiffIt.cs index 9a48e1c9df..1cbca9e6e3 100644 --- a/src/Lucene.Net.Analysis.Stempel/Egothor.Stemmer/DiffIt.cs +++ b/src/Lucene.Net.Analysis.Stempel/Egothor.Stemmer/DiffIt.cs @@ -65,6 +65,13 @@ created by Leo Galambos (Leo.G@seznam.cz). namespace Egothor.Stemmer { /// + /// + /// LUCENENET specific: This class is not for direct use. In the Java implementation + /// it's Main method was intended to be called from the command line. However in .NET a + /// method within a DLL can't be directly called from the command line so we + /// provide a lucene-cli + /// with a command that maps to that method: analysis stempel-patch-stems. + /// /// The DiffIt class is a means generate patch commands from an already prepared /// stemmer table. /// @@ -82,6 +89,13 @@ internal static int Get(int i, string s) } /// + /// + /// LUCENENET specific: This method is not for direct use. In the Java implementation + /// it was intended to be called from the command line. However in .NET a + /// method within a DLL can't be directly called from the command line so we + /// provide a lucene-cli + /// with a command that maps to this method: analysis stempel-patch-stems. + /// /// Entry point to the DiffIt application. /// /// This application takes one argument, the path to a file containing a diff --git a/src/Lucene.Net.Benchmark/ByTask/Benchmark.cs b/src/Lucene.Net.Benchmark/ByTask/Benchmark.cs index 6b0b7a904c..062f0a0554 100644 --- a/src/Lucene.Net.Benchmark/ByTask/Benchmark.cs +++ b/src/Lucene.Net.Benchmark/ByTask/Benchmark.cs @@ -97,6 +97,13 @@ public virtual void Execute() } /// + /// + /// LUCENENET specific: This method is not for direct use. In the Java implementation + /// it was intended to be called from the command line. However in .NET a + /// method within a DLL can't be directly called from the command line so we + /// provide a lucene-cli + /// with a command that maps to this method: benchmark. + /// /// Run the benchmark algorithm. /// /// Benchmark config and algorithm files. diff --git a/src/Lucene.Net.Benchmark/ByTask/Programmatic/Sample.cs b/src/Lucene.Net.Benchmark/ByTask/Programmatic/Sample.cs index 7f0078fc40..4adbb11df2 100644 --- a/src/Lucene.Net.Benchmark/ByTask/Programmatic/Sample.cs +++ b/src/Lucene.Net.Benchmark/ByTask/Programmatic/Sample.cs @@ -24,9 +24,25 @@ namespace Lucene.Net.Benchmarks.ByTask.Programmatic /// /// Sample performance test written programmatically - no algorithm file is needed here. + /// + /// LUCENENET specific: This class is not for direct use. In the Java implementation + /// it's Main method was intended to be called from the command line. However in .NET a + /// method within a DLL can't be directly called from the command line so we + /// provide a lucene-cli + /// with a command that maps to that method: benchmark sample. + /// /// public static class Sample // LUCENENET specific: CA1052 Static holder types should be Static or NotInheritable { + + /// + /// LUCENENET specific: This method is not for direct use. In the Java implementation + /// it was intended to be called from the command line. However in .NET a + /// method within a DLL can't be directly called from the command line so we + /// provide a lucene-cli + /// with a command that maps to this method: benchmark sample. + /// + /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Sample shows optional args[] parameter")] public static void Main(string[] args) { diff --git a/src/Lucene.Net.Benchmark/Quality/Trec/QueryDriver.cs b/src/Lucene.Net.Benchmark/Quality/Trec/QueryDriver.cs index ca045a42e7..7aa63d3f5f 100644 --- a/src/Lucene.Net.Benchmark/Quality/Trec/QueryDriver.cs +++ b/src/Lucene.Net.Benchmark/Quality/Trec/QueryDriver.cs @@ -31,9 +31,26 @@ namespace Lucene.Net.Benchmarks.Quality.Trec /// /// Command-line tool for doing a TREC evaluation run. + /// + /// LUCENENET specific: This class is not for direct use. In the Java implementation + /// it's Main method was intended to be called from the command line. However in .NET a + /// method within a DLL can't be directly called from the command line so we + /// provide a lucene-cli + /// with a command that maps to that method: benchmark run-trec-eval. + /// /// public static class QueryDriver // LUCENENET specific: CA1052 Static holder types should be Static or NotInheritable { + + /// + /// LUCENENET specific: This method is not for direct use. In the Java implementation + /// it was intended to be called from the command line. However in .NET a + /// method within a DLL can't be directly called from the command line so we + /// provide a lucene-cli + /// with a command that maps to this method: benchmark run-trec-eval. + /// + /// Must contain 4 or 5 values + /// public static void Main(string[] args) { if (args.Length < 4 || args.Length > 5) diff --git a/src/Lucene.Net.Benchmark/Quality/Utils/QualityQueriesFinder.cs b/src/Lucene.Net.Benchmark/Quality/Utils/QualityQueriesFinder.cs index 1592d17346..3cccd41b15 100644 --- a/src/Lucene.Net.Benchmark/Quality/Utils/QualityQueriesFinder.cs +++ b/src/Lucene.Net.Benchmark/Quality/Utils/QualityQueriesFinder.cs @@ -27,6 +27,13 @@ namespace Lucene.Net.Benchmarks.Quality.Utils /// /// Suggest Quality queries based on an index contents. /// Utility class, used for making quality test benchmarks. + /// + /// LUCENENET specific: This class is not for direct use. In the Java implementation + /// it's Main method was intended to be called from the command line. However in .NET a + /// method within a DLL can't be directly called from the command line so we + /// provide a lucene-cli + /// with a command that maps to that method: benchmark find-quality-queries. + /// /// public class QualityQueriesFinder { @@ -43,7 +50,11 @@ private QualityQueriesFinder(Store.Directory dir) } /// - /// + /// LUCENENET specific: This method is not for direct use. In the Java implementation + /// it was intended to be called from the command line. However in .NET a + /// method within a DLL can't be directly called from the command line so we + /// provide a lucene-cli + /// with a command that maps to this method: benchmark find-quality-queries. /// /// {index-dir} /// if cannot access the index. diff --git a/src/Lucene.Net.Benchmark/Utils/ExtractReuters.cs b/src/Lucene.Net.Benchmark/Utils/ExtractReuters.cs index b34c36cbaa..ffbade0356 100644 --- a/src/Lucene.Net.Benchmark/Utils/ExtractReuters.cs +++ b/src/Lucene.Net.Benchmark/Utils/ExtractReuters.cs @@ -132,6 +132,14 @@ protected virtual void ExtractFile(FileInfo sgmFile) } } + /// + /// LUCENENET specific: This method is not for direct use. In the Java implementation + /// it was intended to be called from the command line. However in .NET a + /// method within a DLL can't be directly called from the command line so we + /// provide a lucene-cli + /// with a command that maps to this method: benchmark extract-reuters. + /// + /// public static void Main(string[] args) { if (args.Length != 2) diff --git a/src/Lucene.Net.Benchmark/Utils/ExtractWikipedia.cs b/src/Lucene.Net.Benchmark/Utils/ExtractWikipedia.cs index e81f6cf942..2e09ad8c23 100644 --- a/src/Lucene.Net.Benchmark/Utils/ExtractWikipedia.cs +++ b/src/Lucene.Net.Benchmark/Utils/ExtractWikipedia.cs @@ -118,6 +118,14 @@ public virtual void Extract() Console.WriteLine("Extraction took " + (finish - start) + " ms"); } + /// + /// LUCENENET specific: This method is not for direct use. In the Java implementation + /// it was intended to be called from the command line. However in .NET a + /// method within a DLL can't be directly called from the command line so we + /// provide a lucene-cli + /// with a command that maps to this method: benchmark extract-wikipedia. + /// + /// public static void Main(string[] args) { diff --git a/src/Lucene.Net.Demo/Facet/AssociationsFacetsExample.cs b/src/Lucene.Net.Demo/Facet/AssociationsFacetsExample.cs index e8ac0b1541..cb0e4fb665 100644 --- a/src/Lucene.Net.Demo/Facet/AssociationsFacetsExample.cs +++ b/src/Lucene.Net.Demo/Facet/AssociationsFacetsExample.cs @@ -157,7 +157,17 @@ public FacetResult RunDrillDown() } - /// Runs the sum int/float associations examples and prints the results. + /// + /// Runs the sum int/float associations examples and prints the results. + /// + /// LUCENENET specific: This method is not for direct use. In the Java implementation + /// it was intended to be called from the command line. However in .NET a + /// method within a DLL can't be directly called from the command line so we + /// provide a lucene-cli + /// with a command that maps to this method: demo associations-facets. + /// + /// + /// Unused [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Demo shows use of optional args argument")] public static void Main(string[] args) { diff --git a/src/Lucene.Net.Demo/Facet/DistanceFacetsExample.cs b/src/Lucene.Net.Demo/Facet/DistanceFacetsExample.cs index 4a8d7f851a..68a52950e6 100644 --- a/src/Lucene.Net.Demo/Facet/DistanceFacetsExample.cs +++ b/src/Lucene.Net.Demo/Facet/DistanceFacetsExample.cs @@ -263,7 +263,16 @@ public void Dispose() indexDir?.Dispose(); } - /// Runs the search and drill-down examples and prints the results. + /// + /// Runs the search and drill-down examples and prints the results. + /// + /// LUCENENET specific: This method is not for direct use. In the Java implementation + /// it was intended to be called from the command line. However in .NET a + /// method within a DLL can't be directly called from the command line so we + /// provide a lucene-cli + /// with a command that maps to this method: demo distance-facets. + /// + /// public static void Main(string[] args) { using DistanceFacetsExample example = new DistanceFacetsExample(); diff --git a/src/Lucene.Net.Demo/Facet/ExpressionAggregationFacetsExample.cs b/src/Lucene.Net.Demo/Facet/ExpressionAggregationFacetsExample.cs index 514dfc26f7..3a4dc95482 100644 --- a/src/Lucene.Net.Demo/Facet/ExpressionAggregationFacetsExample.cs +++ b/src/Lucene.Net.Demo/Facet/ExpressionAggregationFacetsExample.cs @@ -115,7 +115,17 @@ public FacetResult RunSearch() return Search(); } - /// Runs the search and drill-down examples and prints the results. + /// + /// Runs the search and drill-down examples and prints the results. + /// + /// LUCENENET specific: This method is not for direct use. In the Java implementation + /// it was intended to be called from the command line. However in .NET a + /// method within a DLL can't be directly called from the command line so we + /// provide a lucene-cli + /// with a command that maps to this method: demo expression-aggregation-facets. + /// + /// + /// Unused public static void Main(string[] args) { Console.WriteLine("Facet counting example:"); diff --git a/src/Lucene.Net.Demo/Facet/MultiCategoryListsFacetsExample.cs b/src/Lucene.Net.Demo/Facet/MultiCategoryListsFacetsExample.cs index 656d5570d0..5e3e71b232 100644 --- a/src/Lucene.Net.Demo/Facet/MultiCategoryListsFacetsExample.cs +++ b/src/Lucene.Net.Demo/Facet/MultiCategoryListsFacetsExample.cs @@ -134,7 +134,17 @@ public IList RunSearch() return Search(); } - /// Runs the search example and prints the results. + /// + /// Runs the search example and prints the results. + /// + /// LUCENENET specific: This method is not for direct use. In the Java implementation + /// it was intended to be called from the command line. However in .NET a + /// method within a DLL can't be directly called from the command line so we + /// provide a lucene-cli + /// with a command that maps to this method: demo multi-category-lists-facets. + /// + /// + /// Unused public static void Main(string[] args) { Console.WriteLine("Facet counting over multiple category lists example:"); diff --git a/src/Lucene.Net.Demo/Facet/RangeFacetsExample.cs b/src/Lucene.Net.Demo/Facet/RangeFacetsExample.cs index a5c1d263d6..5352f9a693 100644 --- a/src/Lucene.Net.Demo/Facet/RangeFacetsExample.cs +++ b/src/Lucene.Net.Demo/Facet/RangeFacetsExample.cs @@ -125,7 +125,17 @@ public void Dispose() indexDir?.Dispose(); } - /// Runs the search and drill-down examples and prints the results. + /// + /// Runs the search and drill-down examples and prints the results. + /// + /// LUCENENET specific: This method is not for direct use. In the Java implementation + /// it was intended to be called from the command line. However in .NET a + /// method within a DLL can't be directly called from the command line so we + /// provide a lucene-cli + /// with a command that maps to this method: demo range-facets. + /// + /// + /// Unused public static void Main(string[] args) { using RangeFacetsExample example = new RangeFacetsExample(); diff --git a/src/Lucene.Net.Demo/Facet/SimpleFacetsExample.cs b/src/Lucene.Net.Demo/Facet/SimpleFacetsExample.cs index 9f591e3e36..6b64ea7f6d 100644 --- a/src/Lucene.Net.Demo/Facet/SimpleFacetsExample.cs +++ b/src/Lucene.Net.Demo/Facet/SimpleFacetsExample.cs @@ -233,7 +233,17 @@ public IList RunDrillSideways() return DrillSideways(); } - /// Runs the search and drill-down examples and prints the results. + /// + /// Runs the search and drill-down examples and prints the results. + /// + /// LUCENENET specific: This method is not for direct use. In the Java implementation + /// it was intended to be called from the command line. However in .NET a + /// method within a DLL can't be directly called from the command line so we + /// provide a lucene-cli + /// with a command that maps to this method: demo simple-facets. + /// + /// + /// Unused public static void Main(string[] args) { Console.WriteLine("Facet counting example:"); diff --git a/src/Lucene.Net.Demo/Facet/SimpleSortedSetFacetsExample.cs b/src/Lucene.Net.Demo/Facet/SimpleSortedSetFacetsExample.cs index b787015378..557dc80ee0 100644 --- a/src/Lucene.Net.Demo/Facet/SimpleSortedSetFacetsExample.cs +++ b/src/Lucene.Net.Demo/Facet/SimpleSortedSetFacetsExample.cs @@ -151,7 +151,17 @@ public FacetResult RunDrillDown() return DrillDown(); } - /// Runs the search and drill-down examples and prints the results. + /// Runs the search and drill-down examples and prints the results. + /// + /// LUCENENET specific: This method is not for direct use. In the Java implementation + /// it was intended to be called from the command line. However in .NET a + /// method within a DLL can't be directly called from the command line so we + /// provide a lucene-cli + /// with a command that maps to this method: demo simple-sorted-set-facets. + /// + /// + /// Unused public static void Main(string[] args) { Console.WriteLine("Facet counting example:"); diff --git a/src/Lucene.Net.Demo/IndexFiles.cs b/src/Lucene.Net.Demo/IndexFiles.cs index efae0eb4bd..e9dc565f72 100644 --- a/src/Lucene.Net.Demo/IndexFiles.cs +++ b/src/Lucene.Net.Demo/IndexFiles.cs @@ -31,15 +31,35 @@ namespace Lucene.Net.Demo { + // LUCENENET: Not used + ///// Run it with no command-line arguments for usage information. + + /// /// Index all text files under a directory. /// /// This is a command-line application demonstrating simple Lucene indexing. - /// Run it with no command-line arguments for usage information. + /// + /// LUCENENET specific: This class is not for direct use. In the Java implementation + /// it's Main method was intended to be called from the command line. However in .NET a + /// method within a DLL can't be directly called from the command line so we + /// provide a lucene-cli + /// with a command that maps to that method: demo index-files. + /// /// public static class IndexFiles // LUCENENET specific: CA1052 Static holder types should be Static or NotInheritable { - /// Index all text files under a directory. + /// + /// Index all text files under a directory. + /// + /// LUCENENET specific: This method is not for direct use. In the Java implementation + /// it was intended to be called from the command line. However in .NET a + /// method within a DLL can't be directly called from the command line so we + /// provide a lucene-cli + /// with a command that maps to this method: demo index-files. + /// + /// + /// public static void Main(string[] args) { // The should be the assembly name of the application diff --git a/src/Lucene.Net.Demo/SearchFiles.cs b/src/Lucene.Net.Demo/SearchFiles.cs index a8267af1a3..8953ffaaf0 100644 --- a/src/Lucene.Net.Demo/SearchFiles.cs +++ b/src/Lucene.Net.Demo/SearchFiles.cs @@ -37,10 +37,27 @@ namespace Lucene.Net.Demo { /// /// Simple command-line based search demo. + /// + /// LUCENENET specific: This class is not for direct use. In the Java implementation + /// it's Main method was intended to be called from the command line. However in .NET a + /// method within a DLL can't be directly called from the command line so we + /// provide a lucene-cli + /// with a command that maps to that method: demo search-files. + /// /// public static class SearchFiles // LUCENENET specific: CA1052 Static holder types should be Static or NotInheritable { - /// Simple command-line based search demo. + /// + /// Simple command-line based search demo. + /// + /// LUCENENET specific: This method is not for direct use. In the Java implementation + /// it was intended to be called from the command line. However in .NET a + /// method within a DLL can't be directly called from the command line so we + /// provide a lucene-cli + /// with a command that maps to this method: demo search-files. + /// + /// + /// public static void Main(string[] args) { // The should be the assembly name of the application diff --git a/src/Lucene.Net.Misc/Index/CompoundFileExtractor.cs b/src/Lucene.Net.Misc/Index/CompoundFileExtractor.cs index c0bed26c55..ee8bed8058 100644 --- a/src/Lucene.Net.Misc/Index/CompoundFileExtractor.cs +++ b/src/Lucene.Net.Misc/Index/CompoundFileExtractor.cs @@ -25,15 +25,34 @@ namespace Lucene.Net.Index /// /// Command-line tool for extracting sub-files out of a compound file. + /// + /// LUCENENET specific: This class is not for direct use. In the Java implementation + /// it's Main method was intended to be called from the command line. However in .NET a + /// method within a DLL can't be directly called from the command line so we + /// provide a lucene-cli + /// with two commands that map to that method: index extract-cfs and index list-cfs. + /// /// public static class CompoundFileExtractor // LUCENENET specific: CA1052 Static holder types should be Static or NotInheritable { + // LUCENENET: Not used + ///// Usage: org.apache.lucene.index.IndexReader [-extract] <cfsfile> + + /// /// Prints the filename and size of each file within a given compound file. /// Add the -extract flag to extract files to the current working directory. /// In order to make the extracted version of the index work, you have to copy - /// the segments file from the compound index into the directory where the extracted files are stored. - ///// Usage: org.apache.lucene.index.IndexReader [-extract] <cfsfile> + /// the segments file from the compound index into the directory where the extracted files are stored. + /// + /// LUCENENET specific: This method is not for direct use. In the Java implementation + /// it was intended to be called from the command line. However in .NET a + /// method within a DLL can't be directly called from the command line so we + /// provide a lucene-cli + /// with two commands that map to this method: index extract-cfs and index list-cfs. + /// + /// + /// public static void Main(string[] args) { string filename = null; @@ -151,4 +170,4 @@ public static void Main(string[] args) } } } -} \ No newline at end of file +} diff --git a/src/Lucene.Net.Misc/Index/IndexSplitter.cs b/src/Lucene.Net.Misc/Index/IndexSplitter.cs index 3d02492400..7fadb85000 100644 --- a/src/Lucene.Net.Misc/Index/IndexSplitter.cs +++ b/src/Lucene.Net.Misc/Index/IndexSplitter.cs @@ -41,6 +41,14 @@ namespace Lucene.Net.Index /// @lucene.experimental You can easily /// accidentally remove segments from your index so be /// careful! + /// + /// LUCENENET specific: This class is not for direct use. In the Java implementation + /// it's Main method was intended to be called from the command line. However in .NET a + /// method within a DLL can't be directly called from the command line so we + /// provide a lucene-cli + /// with three commands that map to that method: index copy-segments, index delete-segments, + /// and index list-segments. + /// /// public class IndexSplitter { @@ -50,6 +58,16 @@ public class IndexSplitter internal DirectoryInfo dir; + + /// + /// LUCENENET specific: This method is not for direct use. In the Java implementation + /// it was intended to be called from the command line. However in .NET a + /// method within a DLL can't be directly called from the command line so we + /// provide a lucene-cli + /// with three commands that map to this method: index copy-segments, index delete-segments, + /// and index list-segments. + /// + /// public static void Main(string[] args) { if (args.Length < 2) @@ -179,4 +197,4 @@ private static void CopyFile(FileInfo src, FileInfo dst) @in.CopyTo(@out); } } -} \ No newline at end of file +} diff --git a/src/Lucene.Net.Misc/Index/MultiPassIndexSplitter.cs b/src/Lucene.Net.Misc/Index/MultiPassIndexSplitter.cs index 30fe0d7ea1..0428c86a4a 100644 --- a/src/Lucene.Net.Misc/Index/MultiPassIndexSplitter.cs +++ b/src/Lucene.Net.Misc/Index/MultiPassIndexSplitter.cs @@ -120,6 +120,16 @@ public virtual void Split(LuceneVersion version, IndexReader @in, Store.Director Console.Error.WriteLine("Done."); } + + /// + /// LUCENENET specific: This method is not for direct use. In the Java implementation + /// it was intended to be called from the command line. However in .NET a + /// method within a DLL can't be directly called from the command line so we + /// provide a lucene-cli + /// with a command that maps to this method: index split. + /// + /// + /// public static void Main(string[] args) { if (args.Length < 5) @@ -318,4 +328,4 @@ public void DeleteDocument(int n) public override IBits LiveDocs => liveDocs; } } -} \ No newline at end of file +} diff --git a/src/Lucene.Net.Misc/Misc/GetTermInfo.cs b/src/Lucene.Net.Misc/Misc/GetTermInfo.cs index fb7fd1e84e..39257ea9fb 100644 --- a/src/Lucene.Net.Misc/Misc/GetTermInfo.cs +++ b/src/Lucene.Net.Misc/Misc/GetTermInfo.cs @@ -24,10 +24,27 @@ namespace Lucene.Net.Misc */ /// - /// Utility to get document frequency and total number of occurrences (sum of the tf for each doc) of a term. + /// Utility to get document frequency and total number of occurrences (sum of the tf for each doc) of a term. + /// + /// LUCENENET specific: This class is not for direct use. In the Java implementation + /// it's Main method was intended to be called from the command line. However in .NET a + /// method within a DLL can't be directly called from the command line so we + /// provide a lucene-cli + /// with a command that maps to that method: index list-term-info. + /// /// public static class GetTermInfo // LUCENENET specific: CA1052 Static holder types should be Static or NotInheritable { + + /// + /// LUCENENET specific: This method is not for direct use. In the Java implementation + /// it was intended to be called from the command line. However in .NET a + /// method within a DLL can't be directly called from the command line so we + /// provide a lucene-cli + /// with a command that maps to this method: index list-term-info. + /// + /// + /// public static void Main(string[] args) { @@ -64,4 +81,4 @@ public static void TermInfo(Store.Directory dir, Term term) // Console.WriteLine("\n\nusage:\n\t" + "java " + typeof(GetTermInfo).FullName + " field term \n\n"); //} } -} \ No newline at end of file +} diff --git a/src/Lucene.Net.Misc/Misc/HighFreqTerms.cs b/src/Lucene.Net.Misc/Misc/HighFreqTerms.cs index fc4f82a222..d228053d98 100644 --- a/src/Lucene.Net.Misc/Misc/HighFreqTerms.cs +++ b/src/Lucene.Net.Misc/Misc/HighFreqTerms.cs @@ -27,14 +27,20 @@ namespace Lucene.Net.Misc * limitations under the License. */ + // LUCENENET: Not used + // If the -t flag is given, both document frequency and total tf (total + // number of occurrences) are reported, ordered by descending total tf. + /// /// class extracts the top n most frequent terms /// (by document frequency) from an existing Lucene index and reports their /// document frequency. /// - /// If the -t flag is given, both document frequency and total tf (total - /// number of occurrences) are reported, ordered by descending total tf. - /// + /// LUCENENET specific: This class is not for direct use. In the Java implementation + /// it's Main method was intended to be called from the command line. However in .NET a + /// method within a DLL can't be directly called from the command line so we + /// provide a lucene-cli + /// with a command that maps to that method: index list-high-freq-terms. /// /// public static class HighFreqTerms // LUCENENET specific: CA1052 Static holder types should be Static or NotInheritable @@ -42,6 +48,16 @@ public static class HighFreqTerms // LUCENENET specific: CA1052 Static holder ty // The top numTerms will be displayed public const int DEFAULT_NUMTERMS = 100; + + /// + /// LUCENENET specific: This method is not for direct use. In the Java implementation + /// it was intended to be called from the command line. However in .NET a + /// method within a DLL can't be directly called from the command line so we + /// provide a lucene-cli + /// with a command that maps to this method: index list-high-freq-terms. + /// + /// + /// public static void Main(string[] args) { string field = null; @@ -81,7 +97,7 @@ public static void Main(string[] args) } } - // LUCENENET specific - our wrapper console shows the correct usage + // LUCENENET specific - The lucene-cli docs show the correct usage //private static void Usage() //{ // Console.WriteLine("\n\n" + "java org.apache.lucene.misc.HighFreqTerms [-t] [number_terms] [field]\n\t -t: order by totalTermFreq\n\n"); diff --git a/src/Lucene.Net.Misc/Misc/IndexMergeTool.cs b/src/Lucene.Net.Misc/Misc/IndexMergeTool.cs index defd30841e..9801c21663 100644 --- a/src/Lucene.Net.Misc/Misc/IndexMergeTool.cs +++ b/src/Lucene.Net.Misc/Misc/IndexMergeTool.cs @@ -26,9 +26,26 @@ namespace Lucene.Net.Misc /// /// Merges indices specified on the command line into the index /// specified as the first command line argument. + /// + /// LUCENENET specific: This class is not for direct use. In the Java implementation + /// it's Main method was intended to be called from the command line. However in .NET a + /// method within a DLL can't be directly called from the command line so we + /// provide a lucene-cli + /// with a command that maps to that method: index merge. + /// /// public static class IndexMergeTool // LUCENENET specific: CA1052 Static holder types should be Static or NotInheritable { + + /// + /// LUCENENET specific: This method is not for direct use. In the Java implementation + /// it was intended to be called from the command line. However in .NET a + /// method within a DLL can't be directly called from the command line so we + /// provide a lucene-cli + /// with a command that maps to this method: index merge. + /// + /// + /// public static void Main(string[] args) { if (args.Length < 3) @@ -68,4 +85,4 @@ public static void Main(string[] args) Console.WriteLine("Done."); } } -} \ No newline at end of file +} diff --git a/src/Lucene.Net/Index/CheckIndex.cs b/src/Lucene.Net/Index/CheckIndex.cs index 68c15734a7..a6000b104c 100644 --- a/src/Lucene.Net/Index/CheckIndex.cs +++ b/src/Lucene.Net/Index/CheckIndex.cs @@ -2363,6 +2363,17 @@ public virtual void FixIndex(Status result) /////

///// this tool exits with exit code 1 if the index cannot be opened or has any ///// corruption, else 0. + + + ///

+ /// LUCENENET specific: This method is not for direct use. In the Java implementation + /// it was intended to be called from the command line. However in .NET a + /// method within a DLL can't be directly called from the command line so we + /// provide a lucene-cli + /// with a command that maps to this method: index check. + /// + /// + /// [STAThread] public static void Main(string[] args) { @@ -2524,4 +2535,4 @@ public static void Main(string[] args) Environment.Exit(exitCode); } } -} \ No newline at end of file +} diff --git a/src/Lucene.Net/Index/IndexUpgrader.cs b/src/Lucene.Net/Index/IndexUpgrader.cs index 841c312d23..7f1477546c 100644 --- a/src/Lucene.Net/Index/IndexUpgrader.cs +++ b/src/Lucene.Net/Index/IndexUpgrader.cs @@ -1,4 +1,4 @@ -using Lucene.Net.Util; +using Lucene.Net.Util; using System; using System.Collections.Generic; using System.IO; @@ -29,12 +29,21 @@ namespace Lucene.Net.Index using FSDirectory = Lucene.Net.Store.FSDirectory; using InfoStream = Lucene.Net.Util.InfoStream; + // LUCENENET: Not used + ///// + ///// java -cp lucene-core.jar Lucene.Net.Index.IndexUpgrader [-delete-prior-commits] [-verbose] indexDir + ///// + /// /// This is an easy-to-use tool that upgrades all segments of an index from previous Lucene versions - /// to the current segment file format. It can be used from command line: - /// - /// java -cp lucene-core.jar Lucene.Net.Index.IndexUpgrader [-delete-prior-commits] [-verbose] indexDir - /// + /// to the current segment file format. It can be used from command line. + /// + /// LUCENENET specific: In the Java implementation this class' Main + /// method was intended to be called from the command line. However in .NET a + /// method within a DLL can't be directly called from the command line so we + /// provide a lucene-cli + /// with a command that maps to that method: index upgrade. + /// /// Alternatively this class can be instantiated and invoked. It uses /// and triggers the upgrade via an request to . /// @@ -73,7 +82,16 @@ private static void PrintUsage() /// /// Main method to run from the /// command-line. + /// + /// LUCENENET specific: This method is not for direct use. In the Java implementation + /// it was intended to be called from the command line. However in .NET a + /// method within a DLL can't be directly called from the command line so we + /// provide a lucene-cli + /// with a command that maps to this method: index upgrade. + /// /// + /// + /// public static void Main(string[] args) { ParseArgs(args).Upgrade(); @@ -218,4 +236,4 @@ public void Upgrade() } } } -} \ No newline at end of file +} diff --git a/src/Lucene.Net/Store/LockStressTest.cs b/src/Lucene.Net/Store/LockStressTest.cs index b5dc516c4f..8a9a9c5521 100644 --- a/src/Lucene.Net/Store/LockStressTest.cs +++ b/src/Lucene.Net/Store/LockStressTest.cs @@ -26,15 +26,34 @@ namespace Lucene.Net.Store * limitations under the License. */ + // LUCENENET: Not used + /////Run without any args to see usage. + /// /// Simple standalone tool that forever acquires & releases a - /// lock using a specific . Run without any args - /// to see usage. + /// lock using a specific . + /// + /// LUCENENET specific: This class is not for direct use. In the Java implementation + /// it's Main method was intended to be called from the command line. However in .NET a + /// method within a DLL can't be directly called from the command line so we + /// provide a lucene-cli + /// with a command that maps to that method: lock stress-test. + /// /// /// /// public static class LockStressTest // LUCENENET specific: CA1052 Static holder types should be Static or NotInheritable { + + /// + /// LUCENENET specific: This method is not for direct use. In the Java implementation + /// it was intended to be called from the command line. However in .NET a + /// method within a DLL can't be directly called from the command line so we + /// provide a lucene-cli + /// with a command that maps to this method: lock stress-test. + /// + /// + /// [STAThread] [SuppressMessage("CodeQuality", "IDE0079:Remove unnecessary suppression", Justification = "This is a SonarCloud issue")] [SuppressMessage("Security Hotspot", "S2245:Using pseudorandom number generators (PRNGs) is security-sensitive", Justification = "The Random class is only used to generate a timeout value")] @@ -172,4 +191,4 @@ public static void Main(string[] args) Console.WriteLine("Finished " + count + " tries."); } } -} \ No newline at end of file +} diff --git a/src/Lucene.Net/Store/LockVerifyServer.cs b/src/Lucene.Net/Store/LockVerifyServer.cs index 203afa121d..2aa64bb235 100644 --- a/src/Lucene.Net/Store/LockVerifyServer.cs +++ b/src/Lucene.Net/Store/LockVerifyServer.cs @@ -30,16 +30,35 @@ namespace Lucene.Net.Store using IOUtils = Lucene.Net.Util.IOUtils; + // LUCENENET: Not used + ///// Run without any args to see usage. + /// /// Simple standalone server that must be running when you /// use . This server simply /// verifies at most one process holds the lock at a time. - /// Run without any args to see usage. + /// + /// LUCENENET specific: This class is not for direct use. In the Java implementation + /// it's Main method was intended to be called from the command line. However in .NET a + /// method within a DLL can't be directly called from the command line so we + /// provide a lucene-cli + /// with a command that maps to that method: lock verify-server. + /// /// /// /// public static class LockVerifyServer // LUCENENET specific: CA1052 Static holder types should be Static or NotInheritable { + + /// + /// LUCENENET specific: This method is not for direct use. In the Java implementation + /// it was intended to be called from the command line. However in .NET a + /// method within a DLL can't be directly called from the command line so we + /// provide a lucene-cli + /// with a command that maps to this method: lock verify-server. + /// + /// + /// [STAThread] public static void Main(string[] args) { @@ -194,4 +213,4 @@ public override void Run() } } } -} \ No newline at end of file +} From 5f837c1aed8d32158a696a83c9213f402991566b Mon Sep 17 00:00:00 2001 From: rclabo Date: Wed, 25 Sep 2024 17:06:29 -0400 Subject: [PATCH 3/5] BUG: Lucene,Net.Cli.BenchmarkFindQualityQueriesCommand: fixed mapping to QualityQueriesFinder.Main(args) --- .../BenchmarkFindQualityQueriesCommand.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dotnet/tools/lucene-cli/commands/benchmark/benchmark-find-quality-queries/BenchmarkFindQualityQueriesCommand.cs b/src/dotnet/tools/lucene-cli/commands/benchmark/benchmark-find-quality-queries/BenchmarkFindQualityQueriesCommand.cs index 81ad29b039..f5f5324a4a 100644 --- a/src/dotnet/tools/lucene-cli/commands/benchmark/benchmark-find-quality-queries/BenchmarkFindQualityQueriesCommand.cs +++ b/src/dotnet/tools/lucene-cli/commands/benchmark/benchmark-find-quality-queries/BenchmarkFindQualityQueriesCommand.cs @@ -1,4 +1,5 @@ using Lucene.Net.Benchmarks.Quality.Trec; +using Lucene.Net.Benchmarks.Quality.Utils; namespace Lucene.Net.Cli { @@ -25,7 +26,7 @@ public class Configuration : ConfigurationBase { public Configuration(CommandLineOptions options) { - this.Main = (args) => QueryDriver.Main(args); + this.Main = (args) => QualityQueriesFinder.Main(args); this.Name = "find-quality-queries"; this.Description = FromResource("Description"); From dba4877e98de27c77747ae5d5fa2d047322f38d7 Mon Sep 17 00:00:00 2001 From: rclabo Date: Wed, 25 Sep 2024 18:03:51 -0400 Subject: [PATCH 4/5] Better approach to fixing TermStats.TermText to fix one failing unit test. --- src/Lucene.Net.Misc/Misc/TermStats.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Lucene.Net.Misc/Misc/TermStats.cs b/src/Lucene.Net.Misc/Misc/TermStats.cs index f057ba89e9..7ac5fbc918 100644 --- a/src/Lucene.Net.Misc/Misc/TermStats.cs +++ b/src/Lucene.Net.Misc/Misc/TermStats.cs @@ -25,7 +25,7 @@ namespace Lucene.Net.Misc /// public sealed class TermStats { - public readonly BytesRef TermText; + public BytesRef TermText { get; private set; } public string Field { get; set; } public int DocFreq { get; set; } public long TotalTermFreq { get; set; } From 1899e51cdcb4a74b4ea2608a6bfcf2253e874823 Mon Sep 17 00:00:00 2001 From: Paul Irwin Date: Tue, 22 Oct 2024 14:36:12 -0600 Subject: [PATCH 5/5] Address PR feedback --- .../Tools/DictionaryBuilder.cs | 20 ++++--- .../Egothor.Stemmer/Compile.cs | 30 +++++----- .../Egothor.Stemmer/DiffIt.cs | 33 +++++----- src/Lucene.Net.Benchmark/ByTask/Benchmark.cs | 17 +++--- .../ByTask/Programmatic/Sample.cs | 25 ++++---- .../Quality/Trec/QueryDriver.cs | 26 ++++---- .../Quality/Utils/QualityQueriesFinder.cs | 23 +++---- .../Utils/ExtractReuters.cs | 12 ++-- .../Utils/ExtractWikipedia.cs | 12 ++-- .../Facet/AssociationsFacetsExample.cs | 17 ++---- .../Facet/DistanceFacetsExample.cs | 16 ++--- .../ExpressionAggregationFacetsExample.cs | 17 ++---- .../Facet/MultiCategoryListsFacetsExample.cs | 17 ++---- .../Facet/RangeFacetsExample.cs | 17 ++---- .../Facet/SimpleFacetsExample.cs | 17 ++---- .../Facet/SimpleSortedSetFacetsExample.cs | 19 ++---- src/Lucene.Net.Demo/IndexFiles.cs | 46 ++++---------- src/Lucene.Net.Demo/SearchFiles.cs | 28 ++------- .../Index/CompoundFileExtractor.cs | 32 +++++----- src/Lucene.Net.Misc/Index/IndexSplitter.cs | 37 ++++++------ .../Index/MultiPassIndexSplitter.cs | 25 ++++---- src/Lucene.Net.Misc/Misc/GetTermInfo.cs | 27 +++++---- src/Lucene.Net.Misc/Misc/HighFreqTerms.cs | 30 +++++----- src/Lucene.Net.Misc/Misc/IndexMergeTool.cs | 27 +++++---- src/Lucene.Net/Index/CheckIndex.cs | 60 ++++++++++--------- src/Lucene.Net/Index/IndexUpgrader.cs | 35 ++++++----- src/Lucene.Net/Store/LockStressTest.cs | 58 +++++++++--------- src/Lucene.Net/Store/LockVerifyServer.cs | 30 +++++----- 28 files changed, 344 insertions(+), 409 deletions(-) diff --git a/src/Lucene.Net.Analysis.Kuromoji/Tools/DictionaryBuilder.cs b/src/Lucene.Net.Analysis.Kuromoji/Tools/DictionaryBuilder.cs index 6c286077ad..c6f222290c 100644 --- a/src/Lucene.Net.Analysis.Kuromoji/Tools/DictionaryBuilder.cs +++ b/src/Lucene.Net.Analysis.Kuromoji/Tools/DictionaryBuilder.cs @@ -21,11 +21,13 @@ namespace Lucene.Net.Analysis.Ja.Util */ /// - /// LUCENENET specific: This class is not for direct use. In the Java implementation - /// it's Main method was intended to be called from the command line. However in .NET a + /// LUCENENET specific: In the Java implementation, this class' Main method + /// was intended to be called from the command line. However, in .NET a /// method within a DLL can't be directly called from the command line so we - /// provide a lucene-cli - /// with a command that maps to that method: analysis kuromoji-build-dictionary. + /// provide a .NET tool, + /// lucene-cli, + /// with a command that maps to that method: + /// analysis kuromoji-build-dictionary. /// public static class DictionaryBuilder // LUCENENET specific: CA1052 Static holder types should be Static or NotInheritable { @@ -70,11 +72,13 @@ ConnectionCostsWriter connectionCosts } /// - /// LUCENENET specific: This method is not for direct use. In the Java implementation - /// it was intended to be called from the command line. However in .NET a + /// LUCENENET specific: In the Java implementation, this Main method + /// was intended to be called from the command line. However, in .NET a /// method within a DLL can't be directly called from the command line so we - /// provide a lucene-cli - /// with a command that maps to this method: analysis kuromoji-build-dictionary. + /// provide a .NET tool, + /// lucene-cli, + /// with a command that maps to this method: + /// analysis kuromoji-build-dictionary. /// public static void Main(string[] args) { diff --git a/src/Lucene.Net.Analysis.Stempel/Egothor.Stemmer/Compile.cs b/src/Lucene.Net.Analysis.Stempel/Egothor.Stemmer/Compile.cs index a1900ab4b0..d7790b475d 100644 --- a/src/Lucene.Net.Analysis.Stempel/Egothor.Stemmer/Compile.cs +++ b/src/Lucene.Net.Analysis.Stempel/Egothor.Stemmer/Compile.cs @@ -66,13 +66,14 @@ namespace Egothor.Stemmer { /// /// The Compile class is used to compile a stemmer table. - /// - /// LUCENENET specific: This class is not for direct use. In the Java implementation - /// it's Main method was intended to be called from the command line. However in .NET a + /// + /// LUCENENET specific: In the Java implementation, this class' Main method + /// was intended to be called from the command line. However, in .NET a /// method within a DLL can't be directly called from the command line so we - /// provide a lucene-cli - /// with a command that maps to that method: analysis stempel-compile-stems - /// + /// provide a .NET tool, + /// lucene-cli, + /// with a command that maps to that method: + /// analysis stempel-compile-stems /// public static class Compile // LUCENENET specific: CA1052 Static holder types should be Static or NotInheritable { @@ -81,19 +82,20 @@ public static class Compile // LUCENENET specific: CA1052 Static holder types sh private static Trie trie; /// - /// - /// LUCENENET specific: This class is not for direct use. In the Java implementation - /// it's Main method was intended to be called from the command line. However in .NET a - /// method within a DLL can't be directly called from the command line so we - /// provide a lucene-cli - /// with a command that maps to that method: analysis stempel-compile-stems. - /// /// Entry point to the Compile application. - /// + /// /// This program takes any number of arguments: the first is the name of the /// desired stemming algorithm to use (a list is available in the package /// description) , all of the rest should be the path or paths to a file or /// files containing a stemmer table to compile. + /// + /// LUCENENET specific: In the Java implementation, this Main method + /// was intended to be called from the command line. However, in .NET a + /// method within a DLL can't be directly called from the command line so we + /// provide a .NET tool, + /// lucene-cli, + /// with a command that maps to this method: + /// analysis stempel-compile-stems /// /// the command line arguments public static void Main(string[] args) diff --git a/src/Lucene.Net.Analysis.Stempel/Egothor.Stemmer/DiffIt.cs b/src/Lucene.Net.Analysis.Stempel/Egothor.Stemmer/DiffIt.cs index 1cbca9e6e3..f1053e94af 100644 --- a/src/Lucene.Net.Analysis.Stempel/Egothor.Stemmer/DiffIt.cs +++ b/src/Lucene.Net.Analysis.Stempel/Egothor.Stemmer/DiffIt.cs @@ -65,15 +65,16 @@ created by Leo Galambos (Leo.G@seznam.cz). namespace Egothor.Stemmer { /// - /// - /// LUCENENET specific: This class is not for direct use. In the Java implementation - /// it's Main method was intended to be called from the command line. However in .NET a - /// method within a DLL can't be directly called from the command line so we - /// provide a lucene-cli - /// with a command that maps to that method: analysis stempel-patch-stems. - /// /// The DiffIt class is a means generate patch commands from an already prepared /// stemmer table. + /// + /// LUCENENET specific: In the Java implementation, this class' Main method + /// was intended to be called from the command line. However, in .NET a + /// method within a DLL can't be directly called from the command line so we + /// provide a .NET tool, + /// lucene-cli, + /// with a command that maps to that method: + /// analysis stempel-patch-stems /// public static class DiffIt // LUCENENET specific: CA1052 Static holder types should be Static or NotInheritable { @@ -89,19 +90,19 @@ internal static int Get(int i, string s) } /// - /// - /// LUCENENET specific: This method is not for direct use. In the Java implementation - /// it was intended to be called from the command line. However in .NET a - /// method within a DLL can't be directly called from the command line so we - /// provide a lucene-cli - /// with a command that maps to this method: analysis stempel-patch-stems. - /// /// Entry point to the DiffIt application. - /// + /// /// This application takes one argument, the path to a file containing a /// stemmer table. The program reads the file and generates the patch commands /// for the stems. - /// + /// + /// LUCENENET specific: In the Java implementation, this Main method + /// was intended to be called from the command line. However, in .NET a + /// method within a DLL can't be directly called from the command line so we + /// provide a .NET tool, + /// lucene-cli, + /// with a command that maps to this method: + /// analysis stempel-patch-stems /// /// the path to a file containing a stemmer table public static void Main(string[] args) diff --git a/src/Lucene.Net.Benchmark/ByTask/Benchmark.cs b/src/Lucene.Net.Benchmark/ByTask/Benchmark.cs index 062f0a0554..8f04e2fda1 100644 --- a/src/Lucene.Net.Benchmark/ByTask/Benchmark.cs +++ b/src/Lucene.Net.Benchmark/ByTask/Benchmark.cs @@ -97,14 +97,15 @@ public virtual void Execute() } /// - /// - /// LUCENENET specific: This method is not for direct use. In the Java implementation - /// it was intended to be called from the command line. However in .NET a - /// method within a DLL can't be directly called from the command line so we - /// provide a lucene-cli - /// with a command that maps to this method: benchmark. - /// /// Run the benchmark algorithm. + /// + /// LUCENENET specific: In the Java implementation, this Main method + /// was intended to be called from the command line. However, in .NET a + /// method within a DLL can't be directly called from the command line so we + /// provide a .NET tool, + /// lucene-cli, + /// with a command that maps to this method: + /// benchmark /// /// Benchmark config and algorithm files. public static void Main(string[] args) @@ -127,7 +128,7 @@ public static void Exec(string[] args) //Environment.Exit(1); } - // verify input files + // verify input files FileInfo algFile = new FileInfo(args[0]); if (!algFile.Exists /*|| !algFile.isFile() ||!algFile.canRead()*/ ) { diff --git a/src/Lucene.Net.Benchmark/ByTask/Programmatic/Sample.cs b/src/Lucene.Net.Benchmark/ByTask/Programmatic/Sample.cs index 4adbb11df2..1e7500faa8 100644 --- a/src/Lucene.Net.Benchmark/ByTask/Programmatic/Sample.cs +++ b/src/Lucene.Net.Benchmark/ByTask/Programmatic/Sample.cs @@ -24,25 +24,28 @@ namespace Lucene.Net.Benchmarks.ByTask.Programmatic /// /// Sample performance test written programmatically - no algorithm file is needed here. - /// - /// LUCENENET specific: This class is not for direct use. In the Java implementation - /// it's Main method was intended to be called from the command line. However in .NET a + /// + /// LUCENENET specific: In the Java implementation, this class' Main method + /// was intended to be called from the command line. However, in .NET a /// method within a DLL can't be directly called from the command line so we - /// provide a lucene-cli - /// with a command that maps to that method: benchmark sample. - /// + /// provide a .NET tool, + /// lucene-cli, + /// with a command that maps to that method: + /// benchmark sample /// public static class Sample // LUCENENET specific: CA1052 Static holder types should be Static or NotInheritable { /// - /// LUCENENET specific: This method is not for direct use. In the Java implementation - /// it was intended to be called from the command line. However in .NET a + /// LUCENENET specific: In the Java implementation, this Main method + /// was intended to be called from the command line. However, in .NET a /// method within a DLL can't be directly called from the command line so we - /// provide a lucene-cli - /// with a command that maps to this method: benchmark sample. + /// provide a .NET tool, + /// lucene-cli, + /// with a command that maps to this method: + /// benchmark sample /// - /// + /// The command line arguments [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Sample shows optional args[] parameter")] public static void Main(string[] args) { diff --git a/src/Lucene.Net.Benchmark/Quality/Trec/QueryDriver.cs b/src/Lucene.Net.Benchmark/Quality/Trec/QueryDriver.cs index 7aa63d3f5f..482c6130a2 100644 --- a/src/Lucene.Net.Benchmark/Quality/Trec/QueryDriver.cs +++ b/src/Lucene.Net.Benchmark/Quality/Trec/QueryDriver.cs @@ -31,26 +31,28 @@ namespace Lucene.Net.Benchmarks.Quality.Trec /// /// Command-line tool for doing a TREC evaluation run. - /// - /// LUCENENET specific: This class is not for direct use. In the Java implementation - /// it's Main method was intended to be called from the command line. However in .NET a + /// + /// LUCENENET specific: In the Java implementation, this class' Main method + /// was intended to be called from the command line. However, in .NET a /// method within a DLL can't be directly called from the command line so we - /// provide a lucene-cli - /// with a command that maps to that method: benchmark run-trec-eval. - /// + /// provide a .NET tool, + /// lucene-cli, + /// with a command that maps to that method: + /// benchmark run-trec-eval /// public static class QueryDriver // LUCENENET specific: CA1052 Static holder types should be Static or NotInheritable { - /// - /// LUCENENET specific: This method is not for direct use. In the Java implementation - /// it was intended to be called from the command line. However in .NET a + /// LUCENENET specific: In the Java implementation, this Main method + /// was intended to be called from the command line. However, in .NET a /// method within a DLL can't be directly called from the command line so we - /// provide a lucene-cli - /// with a command that maps to this method: benchmark run-trec-eval. + /// provide a .NET tool, + /// lucene-cli, + /// with a command that maps to this method: + /// benchmark run-trec-eval /// /// Must contain 4 or 5 values - /// + /// Thrown if the incorrect number of arguments are provided. public static void Main(string[] args) { if (args.Length < 4 || args.Length > 5) diff --git a/src/Lucene.Net.Benchmark/Quality/Utils/QualityQueriesFinder.cs b/src/Lucene.Net.Benchmark/Quality/Utils/QualityQueriesFinder.cs index 3cccd41b15..62f23ec399 100644 --- a/src/Lucene.Net.Benchmark/Quality/Utils/QualityQueriesFinder.cs +++ b/src/Lucene.Net.Benchmark/Quality/Utils/QualityQueriesFinder.cs @@ -27,13 +27,14 @@ namespace Lucene.Net.Benchmarks.Quality.Utils /// /// Suggest Quality queries based on an index contents. /// Utility class, used for making quality test benchmarks. - /// - /// LUCENENET specific: This class is not for direct use. In the Java implementation - /// it's Main method was intended to be called from the command line. However in .NET a + /// + /// LUCENENET specific: In the Java implementation, this class' Main method + /// was intended to be called from the command line. However, in .NET a /// method within a DLL can't be directly called from the command line so we - /// provide a lucene-cli - /// with a command that maps to that method: benchmark find-quality-queries. - /// + /// provide a .NET tool, + /// lucene-cli, + /// with a command that maps to that method: + /// benchmark find-quality-queries /// public class QualityQueriesFinder { @@ -50,11 +51,13 @@ private QualityQueriesFinder(Store.Directory dir) } /// - /// LUCENENET specific: This method is not for direct use. In the Java implementation - /// it was intended to be called from the command line. However in .NET a + /// LUCENENET specific: In the Java implementation, this Main method + /// was intended to be called from the command line. However, in .NET a /// method within a DLL can't be directly called from the command line so we - /// provide a lucene-cli - /// with a command that maps to this method: benchmark find-quality-queries. + /// provide a .NET tool, + /// lucene-cli, + /// with a command that maps to this method: + /// benchmark find-quality-queries /// /// {index-dir} /// if cannot access the index. diff --git a/src/Lucene.Net.Benchmark/Utils/ExtractReuters.cs b/src/Lucene.Net.Benchmark/Utils/ExtractReuters.cs index ffbade0356..be1f79aa2f 100644 --- a/src/Lucene.Net.Benchmark/Utils/ExtractReuters.cs +++ b/src/Lucene.Net.Benchmark/Utils/ExtractReuters.cs @@ -133,13 +133,15 @@ protected virtual void ExtractFile(FileInfo sgmFile) } /// - /// LUCENENET specific: This method is not for direct use. In the Java implementation - /// it was intended to be called from the command line. However in .NET a + /// LUCENENET specific: In the Java implementation, this Main method + /// was intended to be called from the command line. However, in .NET a /// method within a DLL can't be directly called from the command line so we - /// provide a lucene-cli - /// with a command that maps to this method: benchmark extract-reuters. + /// provide a .NET tool, + /// lucene-cli, + /// with a command that maps to this method: + /// benchmark extract-reuters /// - /// + /// The command line arguments public static void Main(string[] args) { if (args.Length != 2) diff --git a/src/Lucene.Net.Benchmark/Utils/ExtractWikipedia.cs b/src/Lucene.Net.Benchmark/Utils/ExtractWikipedia.cs index 2e09ad8c23..d25bceb2f4 100644 --- a/src/Lucene.Net.Benchmark/Utils/ExtractWikipedia.cs +++ b/src/Lucene.Net.Benchmark/Utils/ExtractWikipedia.cs @@ -119,13 +119,15 @@ public virtual void Extract() } /// - /// LUCENENET specific: This method is not for direct use. In the Java implementation - /// it was intended to be called from the command line. However in .NET a + /// LUCENENET specific: In the Java implementation, this Main method + /// was intended to be called from the command line. However, in .NET a /// method within a DLL can't be directly called from the command line so we - /// provide a lucene-cli - /// with a command that maps to this method: benchmark extract-wikipedia. + /// provide a .NET tool, + /// lucene-cli, + /// with a command that maps to this method: + /// benchmark extract-wikipedia /// - /// + /// The command line arguments public static void Main(string[] args) { diff --git a/src/Lucene.Net.Demo/Facet/AssociationsFacetsExample.cs b/src/Lucene.Net.Demo/Facet/AssociationsFacetsExample.cs index cb0e4fb665..8fda2e5764 100644 --- a/src/Lucene.Net.Demo/Facet/AssociationsFacetsExample.cs +++ b/src/Lucene.Net.Demo/Facet/AssociationsFacetsExample.cs @@ -43,8 +43,8 @@ public class AssociationsFacetsExample /// /// Using a constant for all functionality related to a specific index /// is the best strategy. This allows you to upgrade Lucene.Net first - /// and plan the upgrade of the index binary format for a later time. - /// Once the index is upgraded, you simply need to update the constant + /// and plan the upgrade of the index binary format for a later time. + /// Once the index is upgraded, you simply need to update the constant /// version and redeploy your application. /// private const LuceneVersion EXAMPLE_VERSION = LuceneVersion.LUCENE_48; @@ -157,17 +157,8 @@ public FacetResult RunDrillDown() } - /// - /// Runs the sum int/float associations examples and prints the results. - /// - /// LUCENENET specific: This method is not for direct use. In the Java implementation - /// it was intended to be called from the command line. However in .NET a - /// method within a DLL can't be directly called from the command line so we - /// provide a lucene-cli - /// with a command that maps to this method: demo associations-facets. - /// - /// - /// Unused + /// Runs the sum int/float associations examples and prints the results. + /// The command line arguments [System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Demo shows use of optional args argument")] public static void Main(string[] args) { diff --git a/src/Lucene.Net.Demo/Facet/DistanceFacetsExample.cs b/src/Lucene.Net.Demo/Facet/DistanceFacetsExample.cs index 68a52950e6..ba05f0e3bc 100644 --- a/src/Lucene.Net.Demo/Facet/DistanceFacetsExample.cs +++ b/src/Lucene.Net.Demo/Facet/DistanceFacetsExample.cs @@ -50,8 +50,8 @@ public sealed class DistanceFacetsExample : IDisposable /// /// Using a constant for all functionality related to a specific index /// is the best strategy. This allows you to upgrade Lucene.Net first - /// and plan the upgrade of the index binary format for a later time. - /// Once the index is upgraded, you simply need to update the constant + /// and plan the upgrade of the index binary format for a later time. + /// Once the index is upgraded, you simply need to update the constant /// version and redeploy your application. /// private const LuceneVersion EXAMPLE_VERSION = LuceneVersion.LUCENE_48; @@ -263,16 +263,8 @@ public void Dispose() indexDir?.Dispose(); } - /// - /// Runs the search and drill-down examples and prints the results. - /// - /// LUCENENET specific: This method is not for direct use. In the Java implementation - /// it was intended to be called from the command line. However in .NET a - /// method within a DLL can't be directly called from the command line so we - /// provide a lucene-cli - /// with a command that maps to this method: demo distance-facets. - /// - /// + /// Runs the search and drill-down examples and prints the results. + /// The command line arguments public static void Main(string[] args) { using DistanceFacetsExample example = new DistanceFacetsExample(); diff --git a/src/Lucene.Net.Demo/Facet/ExpressionAggregationFacetsExample.cs b/src/Lucene.Net.Demo/Facet/ExpressionAggregationFacetsExample.cs index 3a4dc95482..b2c752d0b0 100644 --- a/src/Lucene.Net.Demo/Facet/ExpressionAggregationFacetsExample.cs +++ b/src/Lucene.Net.Demo/Facet/ExpressionAggregationFacetsExample.cs @@ -44,8 +44,8 @@ public class ExpressionAggregationFacetsExample /// /// Using a constant for all functionality related to a specific index /// is the best strategy. This allows you to upgrade Lucene.Net first - /// and plan the upgrade of the index binary format for a later time. - /// Once the index is upgraded, you simply need to update the constant + /// and plan the upgrade of the index binary format for a later time. + /// Once the index is upgraded, you simply need to update the constant /// version and redeploy your application. /// private const LuceneVersion EXAMPLE_VERSION = LuceneVersion.LUCENE_48; @@ -115,17 +115,8 @@ public FacetResult RunSearch() return Search(); } - /// - /// Runs the search and drill-down examples and prints the results. - /// - /// LUCENENET specific: This method is not for direct use. In the Java implementation - /// it was intended to be called from the command line. However in .NET a - /// method within a DLL can't be directly called from the command line so we - /// provide a lucene-cli - /// with a command that maps to this method: demo expression-aggregation-facets. - /// - /// - /// Unused + /// Runs the search and drill-down examples and prints the results. + /// The command line arguments public static void Main(string[] args) { Console.WriteLine("Facet counting example:"); diff --git a/src/Lucene.Net.Demo/Facet/MultiCategoryListsFacetsExample.cs b/src/Lucene.Net.Demo/Facet/MultiCategoryListsFacetsExample.cs index 5e3e71b232..b32fe3761e 100644 --- a/src/Lucene.Net.Demo/Facet/MultiCategoryListsFacetsExample.cs +++ b/src/Lucene.Net.Demo/Facet/MultiCategoryListsFacetsExample.cs @@ -42,8 +42,8 @@ public class MultiCategoryListsFacetsExample /// /// Using a constant for all functionality related to a specific index /// is the best strategy. This allows you to upgrade Lucene.Net first - /// and plan the upgrade of the index binary format for a later time. - /// Once the index is upgraded, you simply need to update the constant + /// and plan the upgrade of the index binary format for a later time. + /// Once the index is upgraded, you simply need to update the constant /// version and redeploy your application. /// private const LuceneVersion EXAMPLE_VERSION = LuceneVersion.LUCENE_48; @@ -134,17 +134,8 @@ public IList RunSearch() return Search(); } - /// - /// Runs the search example and prints the results. - /// - /// LUCENENET specific: This method is not for direct use. In the Java implementation - /// it was intended to be called from the command line. However in .NET a - /// method within a DLL can't be directly called from the command line so we - /// provide a lucene-cli - /// with a command that maps to this method: demo multi-category-lists-facets. - /// - /// - /// Unused + /// Runs the search example and prints the results. + /// The command line arguments public static void Main(string[] args) { Console.WriteLine("Facet counting over multiple category lists example:"); diff --git a/src/Lucene.Net.Demo/Facet/RangeFacetsExample.cs b/src/Lucene.Net.Demo/Facet/RangeFacetsExample.cs index 5352f9a693..8e05b7b68b 100644 --- a/src/Lucene.Net.Demo/Facet/RangeFacetsExample.cs +++ b/src/Lucene.Net.Demo/Facet/RangeFacetsExample.cs @@ -40,8 +40,8 @@ public sealed class RangeFacetsExample : IDisposable /// /// Using a constant for all functionality related to a specific index /// is the best strategy. This allows you to upgrade Lucene.Net first - /// and plan the upgrade of the index binary format for a later time. - /// Once the index is upgraded, you simply need to update the constant + /// and plan the upgrade of the index binary format for a later time. + /// Once the index is upgraded, you simply need to update the constant /// version and redeploy your application. /// private const LuceneVersion EXAMPLE_VERSION = LuceneVersion.LUCENE_48; @@ -125,17 +125,8 @@ public void Dispose() indexDir?.Dispose(); } - /// - /// Runs the search and drill-down examples and prints the results. - /// - /// LUCENENET specific: This method is not for direct use. In the Java implementation - /// it was intended to be called from the command line. However in .NET a - /// method within a DLL can't be directly called from the command line so we - /// provide a lucene-cli - /// with a command that maps to this method: demo range-facets. - /// - /// - /// Unused + /// Runs the search and drill-down examples and prints the results. + /// The command line arguments public static void Main(string[] args) { using RangeFacetsExample example = new RangeFacetsExample(); diff --git a/src/Lucene.Net.Demo/Facet/SimpleFacetsExample.cs b/src/Lucene.Net.Demo/Facet/SimpleFacetsExample.cs index 6b64ea7f6d..b4c1c0c6d7 100644 --- a/src/Lucene.Net.Demo/Facet/SimpleFacetsExample.cs +++ b/src/Lucene.Net.Demo/Facet/SimpleFacetsExample.cs @@ -42,8 +42,8 @@ public class SimpleFacetsExample /// /// Using a constant for all functionality related to a specific index /// is the best strategy. This allows you to upgrade Lucene.Net first - /// and plan the upgrade of the index binary format for a later time. - /// Once the index is upgraded, you simply need to update the constant + /// and plan the upgrade of the index binary format for a later time. + /// Once the index is upgraded, you simply need to update the constant /// version and redeploy your application. /// private const LuceneVersion EXAMPLE_VERSION = LuceneVersion.LUCENE_48; @@ -233,17 +233,8 @@ public IList RunDrillSideways() return DrillSideways(); } - /// - /// Runs the search and drill-down examples and prints the results. - /// - /// LUCENENET specific: This method is not for direct use. In the Java implementation - /// it was intended to be called from the command line. However in .NET a - /// method within a DLL can't be directly called from the command line so we - /// provide a lucene-cli - /// with a command that maps to this method: demo simple-facets. - /// - /// - /// Unused + /// Runs the search and drill-down examples and prints the results. + /// The command line arguments public static void Main(string[] args) { Console.WriteLine("Facet counting example:"); diff --git a/src/Lucene.Net.Demo/Facet/SimpleSortedSetFacetsExample.cs b/src/Lucene.Net.Demo/Facet/SimpleSortedSetFacetsExample.cs index 557dc80ee0..000fcba064 100644 --- a/src/Lucene.Net.Demo/Facet/SimpleSortedSetFacetsExample.cs +++ b/src/Lucene.Net.Demo/Facet/SimpleSortedSetFacetsExample.cs @@ -35,7 +35,7 @@ namespace Lucene.Net.Demo.Facet { /// /// Shows simple usage of faceted indexing and search - /// using and + /// using and /// . /// public class SimpleSortedSetFacetsExample @@ -43,8 +43,8 @@ public class SimpleSortedSetFacetsExample /// /// Using a constant for all functionality related to a specific index /// is the best strategy. This allows you to upgrade Lucene.Net first - /// and plan the upgrade of the index binary format for a later time. - /// Once the index is upgraded, you simply need to update the constant + /// and plan the upgrade of the index binary format for a later time. + /// Once the index is upgraded, you simply need to update the constant /// version and redeploy your application. /// private const LuceneVersion EXAMPLE_VERSION = LuceneVersion.LUCENE_48; @@ -151,17 +151,8 @@ public FacetResult RunDrillDown() return DrillDown(); } - /// Runs the search and drill-down examples and prints the results. - /// - /// LUCENENET specific: This method is not for direct use. In the Java implementation - /// it was intended to be called from the command line. However in .NET a - /// method within a DLL can't be directly called from the command line so we - /// provide a lucene-cli - /// with a command that maps to this method: demo simple-sorted-set-facets. - /// - /// - /// Unused + /// Runs the search and drill-down examples and prints the results. + /// The command line arguments public static void Main(string[] args) { Console.WriteLine("Facet counting example:"); diff --git a/src/Lucene.Net.Demo/IndexFiles.cs b/src/Lucene.Net.Demo/IndexFiles.cs index e9dc565f72..ba3173c99d 100644 --- a/src/Lucene.Net.Demo/IndexFiles.cs +++ b/src/Lucene.Net.Demo/IndexFiles.cs @@ -31,47 +31,27 @@ namespace Lucene.Net.Demo { - // LUCENENET: Not used - ///// Run it with no command-line arguments for usage information. - - /// /// Index all text files under a directory. /// /// This is a command-line application demonstrating simple Lucene indexing. - /// - /// LUCENENET specific: This class is not for direct use. In the Java implementation - /// it's Main method was intended to be called from the command line. However in .NET a - /// method within a DLL can't be directly called from the command line so we - /// provide a lucene-cli - /// with a command that maps to that method: demo index-files. - /// /// public static class IndexFiles // LUCENENET specific: CA1052 Static holder types should be Static or NotInheritable { - /// - /// Index all text files under a directory. - /// - /// LUCENENET specific: This method is not for direct use. In the Java implementation - /// it was intended to be called from the command line. However in .NET a - /// method within a DLL can't be directly called from the command line so we - /// provide a lucene-cli - /// with a command that maps to this method: demo index-files. - /// - /// - /// + /// Index all text files under a directory. + /// The command line arguments public static void Main(string[] args) { // The should be the assembly name of the application // this code is compiled into. In .NET Framework, it is the name of the EXE file. - // In .NET Core, you have the option of compiling this into either an EXE or a DLL + // In .NET Core, you have the option of compiling this into either an EXE or a DLL // (see https://docs.microsoft.com/en-us/dotnet/core/deploying/index). // In the latter case, the will be "dotnet .dll". string usage = "Usage: " + "[-u|--update]\n\n" + "This indexes the documents in , creating a Lucene index" + "in that can be searched with the search-files demo."; - + // Validate required arguments are present. // If not, show usage information. if (args.Length < 2) @@ -150,15 +130,15 @@ public static void Main(string[] args) } /// - /// Recurses over files and directories found under the + /// Recurses over files and directories found under the /// given directory and indexes each file. - /// - /// NOTE: This method indexes one document per input file. - /// This is slow. For good throughput, put multiple documents + /// + /// NOTE: This method indexes one document per input file. + /// This is slow. For good throughput, put multiple documents /// into your input file(s). /// /// - /// to the index where the given + /// to the index where the given /// file/dir info will be stored /// /// @@ -183,7 +163,7 @@ internal static void IndexDocs(IndexWriter writer, DirectoryInfo directoryInfo) /// Indexes the given file using the given writer. /// /// - /// to the index where the given + /// to the index where the given /// file info will be stored. /// /// @@ -199,7 +179,7 @@ internal static void IndexDocs(IndexWriter writer, FileInfo file) Document doc = new Document(); // Add the path of the file as a field named "path". Use a - // field that is indexed (i.e. searchable), but don't tokenize + // field that is indexed (i.e. searchable), but don't tokenize // the field into separate words and don't index term frequency // or positional information: Field pathField = new StringField("path", file.FullName, Field.Store.YES); @@ -228,8 +208,8 @@ internal static void IndexDocs(IndexWriter writer, FileInfo file) } else { - // Existing index (an old copy of this document may have been indexed) so - // we use updateDocument instead to replace the old one matching the exact + // Existing index (an old copy of this document may have been indexed) so + // we use updateDocument instead to replace the old one matching the exact // path, if present: Console.WriteLine("updating " + file); writer.UpdateDocument(new Term("path", file.FullName), doc); diff --git a/src/Lucene.Net.Demo/SearchFiles.cs b/src/Lucene.Net.Demo/SearchFiles.cs index 8953ffaaf0..b001396bfe 100644 --- a/src/Lucene.Net.Demo/SearchFiles.cs +++ b/src/Lucene.Net.Demo/SearchFiles.cs @@ -37,32 +37,16 @@ namespace Lucene.Net.Demo { /// /// Simple command-line based search demo. - /// - /// LUCENENET specific: This class is not for direct use. In the Java implementation - /// it's Main method was intended to be called from the command line. However in .NET a - /// method within a DLL can't be directly called from the command line so we - /// provide a lucene-cli - /// with a command that maps to that method: demo search-files. - /// /// public static class SearchFiles // LUCENENET specific: CA1052 Static holder types should be Static or NotInheritable { - /// - /// Simple command-line based search demo. - /// - /// LUCENENET specific: This method is not for direct use. In the Java implementation - /// it was intended to be called from the command line. However in .NET a - /// method within a DLL can't be directly called from the command line so we - /// provide a lucene-cli - /// with a command that maps to this method: demo search-files. - /// - /// - /// + /// Simple command-line based search demo. + /// The command line arguments public static void Main(string[] args) { // The should be the assembly name of the application // this code is compiled into. In .NET Framework, it is the name of the EXE file. - // In .NET Core, you have the option of compiling this into either a DLL or an EXE + // In .NET Core, you have the option of compiling this into either a DLL or an EXE // (see https://docs.microsoft.com/en-us/dotnet/core/deploying/index). // In the first case, the will be "dotnet .dll". string usage = "Usage: [-f|--field ] " + @@ -70,7 +54,7 @@ public static void Main(string[] args) "[--raw] [-p|--page-size ]\n\n" + "Use no --query or --queries-file option for interactive mode.\n\n" + "See http://lucene.apache.org/core/4_8_0/demo/ for details."; - if (args.Length < 1 || args.Length > 0 && + if (args.Length < 1 || args.Length > 0 && ("?".Equals(args[0], StringComparison.Ordinal) || "-h".Equals(args[0], StringComparison.Ordinal) || "--help".Equals(args[0], StringComparison.Ordinal))) { Console.WriteLine(usage); @@ -184,7 +168,7 @@ public static void Main(string[] args) } /// - /// This demonstrates a typical paging search scenario, where the search engine presents + /// This demonstrates a typical paging search scenario, where the search engine presents /// pages of size n to the user. The user can then go to the next page if interested in /// the next hits. /// @@ -226,7 +210,7 @@ public static void DoPagingSearch(IndexSearcher searcher, Query query, for (int i = start; i < end; i++) { if (raw) // output raw format - { + { Console.WriteLine("doc=" + hits[i].Doc + " score=" + hits[i].Score); continue; } diff --git a/src/Lucene.Net.Misc/Index/CompoundFileExtractor.cs b/src/Lucene.Net.Misc/Index/CompoundFileExtractor.cs index ee8bed8058..514bfdcf59 100644 --- a/src/Lucene.Net.Misc/Index/CompoundFileExtractor.cs +++ b/src/Lucene.Net.Misc/Index/CompoundFileExtractor.cs @@ -25,34 +25,32 @@ namespace Lucene.Net.Index /// /// Command-line tool for extracting sub-files out of a compound file. - /// - /// LUCENENET specific: This class is not for direct use. In the Java implementation - /// it's Main method was intended to be called from the command line. However in .NET a + /// + /// LUCENENET specific: In the Java implementation, this class' Main method + /// was intended to be called from the command line. However, in .NET a /// method within a DLL can't be directly called from the command line so we - /// provide a lucene-cli - /// with two commands that map to that method: index extract-cfs and index list-cfs. - /// + /// provide a .NET tool, + /// lucene-cli, + /// with two commands that map to that method: + /// index extract-cfs and index list-cfs /// public static class CompoundFileExtractor // LUCENENET specific: CA1052 Static holder types should be Static or NotInheritable { - // LUCENENET: Not used - ///// Usage: org.apache.lucene.index.IndexReader [-extract] <cfsfile> - - /// /// Prints the filename and size of each file within a given compound file. /// Add the -extract flag to extract files to the current working directory. /// In order to make the extracted version of the index work, you have to copy /// the segments file from the compound index into the directory where the extracted files are stored. - /// - /// LUCENENET specific: This method is not for direct use. In the Java implementation - /// it was intended to be called from the command line. However in .NET a + /// + /// LUCENENET specific: In the Java implementation, this Main method + /// was intended to be called from the command line. However, in .NET a /// method within a DLL can't be directly called from the command line so we - /// provide a lucene-cli - /// with two commands that map to this method: index extract-cfs and index list-cfs. - /// + /// provide a .NET tool, + /// lucene-cli, + /// with two commands that map to this method: + /// index extract-cfs and index list-cfs /// - /// + /// The command line arguments public static void Main(string[] args) { string filename = null; diff --git a/src/Lucene.Net.Misc/Index/IndexSplitter.cs b/src/Lucene.Net.Misc/Index/IndexSplitter.cs index 7fadb85000..1d6e409ece 100644 --- a/src/Lucene.Net.Misc/Index/IndexSplitter.cs +++ b/src/Lucene.Net.Misc/Index/IndexSplitter.cs @@ -29,26 +29,27 @@ namespace Lucene.Net.Index /// Command-line tool that enables listing segments in an /// index, copying specific segments to another index, and /// deleting segments from an index. - /// - /// This tool does file-level copying of segments files. + /// + /// + /// This tool does file-level copying of segments files. /// This means it's unable to split apart a single segment /// into multiple segments. For example if your index is a /// single segment, this tool won't help. Also, it does basic /// file-level copying (using simple /// Stream) so it will not work with non - /// FSDirectory Directory impls. - /// + /// FSDirectory Directory impls. + /// /// @lucene.experimental You can easily /// accidentally remove segments from your index so be /// careful! - /// - /// LUCENENET specific: This class is not for direct use. In the Java implementation - /// it's Main method was intended to be called from the command line. However in .NET a + /// + /// LUCENENET specific: In the Java implementation, this class' Main method + /// was intended to be called from the command line. However, in .NET a /// method within a DLL can't be directly called from the command line so we - /// provide a lucene-cli - /// with three commands that map to that method: index copy-segments, index delete-segments, - /// and index list-segments. - /// + /// provide a .NET tool, + /// lucene-cli, + /// with three commands that map to that method: + /// index copy-segments, index delete-segments, and index list-segments /// public class IndexSplitter { @@ -58,16 +59,16 @@ public class IndexSplitter internal DirectoryInfo dir; - /// - /// LUCENENET specific: This method is not for direct use. In the Java implementation - /// it was intended to be called from the command line. However in .NET a + /// LUCENENET specific: In the Java implementation, this Main method + /// was intended to be called from the command line. However, in .NET a /// method within a DLL can't be directly called from the command line so we - /// provide a lucene-cli - /// with three commands that map to this method: index copy-segments, index delete-segments, - /// and index list-segments. + /// provide a .NET tool, + /// lucene-cli, + /// with three commands that map to this method: + /// index copy-segments, index delete-segments, and index list-segments /// - /// + /// The command line arguments public static void Main(string[] args) { if (args.Length < 2) diff --git a/src/Lucene.Net.Misc/Index/MultiPassIndexSplitter.cs b/src/Lucene.Net.Misc/Index/MultiPassIndexSplitter.cs index 0428c86a4a..98c2900866 100644 --- a/src/Lucene.Net.Misc/Index/MultiPassIndexSplitter.cs +++ b/src/Lucene.Net.Misc/Index/MultiPassIndexSplitter.cs @@ -33,19 +33,18 @@ namespace Lucene.Net.Index /// here uses where the input data /// comes from the input index with artificially applied deletes to the document /// id-s that fall outside the selected partition. - /// Note 1: Deletes are only applied to a buffered list of deleted docs and + /// + /// Note 1: Deletes are only applied to a buffered list of deleted docs and /// don't affect the source index - this tool works also with read-only indexes. - /// - /// Note 2: the disadvantage of this tool is that source index needs to be + /// + /// Note 2: the disadvantage of this tool is that source index needs to be /// read as many times as there are parts to be created, hence the name of this /// tool. - /// - /// - /// NOTE: this tool is unaware of documents added - /// atomically via or + /// + /// NOTE: this tool is unaware of documents added + /// atomically via or /// , which means it can easily /// break up such document groups. - /// /// public class MultiPassIndexSplitter { @@ -122,11 +121,13 @@ public virtual void Split(LuceneVersion version, IndexReader @in, Store.Director /// - /// LUCENENET specific: This method is not for direct use. In the Java implementation - /// it was intended to be called from the command line. However in .NET a + /// LUCENENET specific: In the Java implementation, this Main method + /// was intended to be called from the command line. However, in .NET a /// method within a DLL can't be directly called from the command line so we - /// provide a lucene-cli - /// with a command that maps to this method: index split. + /// provide a .NET tool, + /// lucene-cli, + /// with a command that maps to this method: + /// index split /// /// /// diff --git a/src/Lucene.Net.Misc/Misc/GetTermInfo.cs b/src/Lucene.Net.Misc/Misc/GetTermInfo.cs index 39257ea9fb..1e5710ebf2 100644 --- a/src/Lucene.Net.Misc/Misc/GetTermInfo.cs +++ b/src/Lucene.Net.Misc/Misc/GetTermInfo.cs @@ -25,26 +25,29 @@ namespace Lucene.Net.Misc /// /// Utility to get document frequency and total number of occurrences (sum of the tf for each doc) of a term. - /// - /// LUCENENET specific: This class is not for direct use. In the Java implementation - /// it's Main method was intended to be called from the command line. However in .NET a + /// + /// LUCENENET specific: In the Java implementation, this class' Main method + /// was intended to be called from the command line. However, in .NET a /// method within a DLL can't be directly called from the command line so we - /// provide a lucene-cli - /// with a command that maps to that method: index list-term-info. - /// + /// provide a .NET tool, + /// lucene-cli, + /// with a command that maps to that method: + /// index list-term-info /// public static class GetTermInfo // LUCENENET specific: CA1052 Static holder types should be Static or NotInheritable { /// - /// LUCENENET specific: This method is not for direct use. In the Java implementation - /// it was intended to be called from the command line. However in .NET a + /// LUCENENET specific: In the Java implementation, this Main method + /// was intended to be called from the command line. However, in .NET a /// method within a DLL can't be directly called from the command line so we - /// provide a lucene-cli - /// with a command that maps to this method: index list-term-info. + /// provide a .NET tool, + /// lucene-cli, + /// with a command that maps to this method: + /// index list-term-info /// - /// - /// + /// The command line arguments + /// Thrown if the incorrect number of arguments are provided public static void Main(string[] args) { diff --git a/src/Lucene.Net.Misc/Misc/HighFreqTerms.cs b/src/Lucene.Net.Misc/Misc/HighFreqTerms.cs index d228053d98..990f459dda 100644 --- a/src/Lucene.Net.Misc/Misc/HighFreqTerms.cs +++ b/src/Lucene.Net.Misc/Misc/HighFreqTerms.cs @@ -35,26 +35,28 @@ namespace Lucene.Net.Misc /// class extracts the top n most frequent terms /// (by document frequency) from an existing Lucene index and reports their /// document frequency. - /// - /// LUCENENET specific: This class is not for direct use. In the Java implementation - /// it's Main method was intended to be called from the command line. However in .NET a + /// + /// LUCENENET specific: In the Java implementation, this class' Main method + /// was intended to be called from the command line. However, in .NET a /// method within a DLL can't be directly called from the command line so we - /// provide a lucene-cli - /// with a command that maps to that method: index list-high-freq-terms. - /// + /// provide a .NET tool, + /// lucene-cli, + /// with a command that maps to that method: + /// index list-high-freq-terms /// public static class HighFreqTerms // LUCENENET specific: CA1052 Static holder types should be Static or NotInheritable { // The top numTerms will be displayed public const int DEFAULT_NUMTERMS = 100; - /// - /// LUCENENET specific: This method is not for direct use. In the Java implementation - /// it was intended to be called from the command line. However in .NET a + /// LUCENENET specific: In the Java implementation, this Main method + /// was intended to be called from the command line. However, in .NET a /// method within a DLL can't be directly called from the command line so we - /// provide a lucene-cli - /// with a command that maps to this method: index list-high-freq-terms. + /// provide a .NET tool, + /// lucene-cli, + /// with a command that maps to this method: + /// index list-high-freq-terms /// /// /// @@ -180,7 +182,7 @@ public int Compare(TermStats a, TermStats b) } /// - /// Compares terms by + /// Compares terms by /// public sealed class TotalTermFreqComparer : IComparer { @@ -205,14 +207,14 @@ public int Compare(TermStats a, TermStats b) /// /// Priority queue for objects - /// + /// /// internal sealed class TermStatsQueue : PriorityQueue { internal readonly IComparer comparer; #nullable enable - internal TermStatsQueue(int size, IComparer comparer) + internal TermStatsQueue(int size, IComparer comparer) : base(size) { this.comparer = comparer ?? throw new ArgumentNullException(nameof(comparer)); // LUCENENET: Added null guard clause diff --git a/src/Lucene.Net.Misc/Misc/IndexMergeTool.cs b/src/Lucene.Net.Misc/Misc/IndexMergeTool.cs index 9801c21663..2208599e62 100644 --- a/src/Lucene.Net.Misc/Misc/IndexMergeTool.cs +++ b/src/Lucene.Net.Misc/Misc/IndexMergeTool.cs @@ -26,26 +26,29 @@ namespace Lucene.Net.Misc /// /// Merges indices specified on the command line into the index /// specified as the first command line argument. - /// - /// LUCENENET specific: This class is not for direct use. In the Java implementation - /// it's Main method was intended to be called from the command line. However in .NET a + /// + /// LUCENENET specific: In the Java implementation, this class' Main method + /// was intended to be called from the command line. However, in .NET a /// method within a DLL can't be directly called from the command line so we - /// provide a lucene-cli - /// with a command that maps to that method: index merge. - /// + /// provide a .NET tool, + /// lucene-cli, + /// with a command that maps to that method: + /// index merge /// public static class IndexMergeTool // LUCENENET specific: CA1052 Static holder types should be Static or NotInheritable { /// - /// LUCENENET specific: This method is not for direct use. In the Java implementation - /// it was intended to be called from the command line. However in .NET a + /// LUCENENET specific: In the Java implementation, this Main method + /// was intended to be called from the command line. However, in .NET a /// method within a DLL can't be directly called from the command line so we - /// provide a lucene-cli - /// with a command that maps to this method: index merge. + /// provide a .NET tool, + /// lucene-cli, + /// with a command that maps to this method: + /// index merge /// - /// - /// + /// The command line arguments + /// Thrown if the incorrect number of arguments are provided public static void Main(string[] args) { if (args.Length < 3) diff --git a/src/Lucene.Net/Index/CheckIndex.cs b/src/Lucene.Net/Index/CheckIndex.cs index a6000b104c..31084de387 100644 --- a/src/Lucene.Net/Index/CheckIndex.cs +++ b/src/Lucene.Net/Index/CheckIndex.cs @@ -107,7 +107,7 @@ internal Status() /// /// Empty unless you passed specific segments list to check as optional 3rd argument. /// - public IList SegmentsChecked { get; internal set; } // LUCENENET specific - made setter internal + public IList SegmentsChecked { get; internal set; } // LUCENENET specific - made setter internal /// /// True if the index was created with a newer version of Lucene than the tool. @@ -137,7 +137,7 @@ internal Status() public int NumBadSegments { get; internal set; } // LUCENENET specific - made setter internal /// - /// True if we checked only specific segments + /// True if we checked only specific segments /// ( was called with non-null /// argument). /// @@ -519,13 +519,13 @@ public virtual Status DoCheckIndex(IList onlySegments) { Msg(infoStream, "ERROR: could not read any segments file in directory"); result.MissingSegments = true; - + // LUCENENET NOTE: Some tests rely on the error type being in // the message. We can't get the error type with StackTrace, we // need ToString() for that. infoStream?.WriteLine(t.ToString()); //infoStream.WriteLine(t.StackTrace); - + return result; } @@ -567,13 +567,13 @@ public virtual Status DoCheckIndex(IList onlySegments) catch (Exception t) when (t.IsThrowable()) { Msg(infoStream, "ERROR: could not open segments file in directory"); - + // LUCENENET NOTE: Some tests rely on the error type being in // the message. We can't get the error type with StackTrace, we // need ToString() for that. infoStream?.WriteLine(t.ToString()); //infoStream.WriteLine(t.StackTrace); - + result.CantOpenSegments = true; return result; } @@ -585,13 +585,13 @@ public virtual Status DoCheckIndex(IList onlySegments) catch (Exception t) when (t.IsThrowable()) { Msg(infoStream, "ERROR: could not read segment file version in directory"); - + // LUCENENET NOTE: Some tests rely on the error type being in // the message. We can't get the error type with StackTrace, we // need ToString() for that. infoStream?.WriteLine(t.ToString()); //infoStream.WriteLine(t.StackTrace); - + result.MissingSegmentVersion = true; return result; } @@ -745,12 +745,12 @@ public virtual Status DoCheckIndex(IList onlySegments) segInfoStat.OpenReaderPassed = true; infoStream?.Write(" test: check integrity....."); - + reader.CheckIntegrity(); Msg(infoStream, "OK"); infoStream?.Write(" test: check live docs....."); - + int numDocs = reader.NumDocs; toLoseDocCount = numDocs; if (reader.HasDeletions) @@ -818,7 +818,7 @@ public virtual Status DoCheckIndex(IList onlySegments) // Test getFieldInfos() infoStream?.Write(" test: fields.............."); - + FieldInfos fieldInfos = reader.FieldInfos; Msg(infoStream, "OK [" + fieldInfos.Count + " fields]"); segInfoStat.NumFields = fieldInfos.Count; @@ -873,7 +873,7 @@ public virtual Status DoCheckIndex(IList onlySegments) // the message. We can't get the error type with StackTrace, we // need ToString() for that. infoStream?.WriteLine(t.ToString()); - + Msg(infoStream, ""); result.TotLoseDocCount += toLoseDocCount; result.NumBadSegments++; @@ -954,12 +954,12 @@ public static Status.FieldNormStatus TestFieldNorms(AtomicReader reader, TextWri { Msg(infoStream, "ERROR [" + e.Message + "]"); status.Error = e; - + // LUCENENET NOTE: Some tests rely on the error type being in // the message. We can't get the error type with StackTrace, we // need ToString() for that. infoStream?.WriteLine(e.ToString()); - //infoStream.WriteLine(e.StackTrace); + //infoStream.WriteLine(e.StackTrace); } return status; @@ -1645,7 +1645,7 @@ public static Status.TermIndexStatus TestPostings(AtomicReader reader, TextWrite try { infoStream?.Write(" test: terms, freq, prox..."); - + Fields fields = reader.Fields; FieldInfos fieldInfos = reader.FieldInfos; status = CheckFields(fields, liveDocs, maxDoc, fieldInfos, true, false, infoStream, verbose); @@ -1660,12 +1660,12 @@ public static Status.TermIndexStatus TestPostings(AtomicReader reader, TextWrite Msg(infoStream, "ERROR: " + e); status = new Status.TermIndexStatus(); status.Error = e; - + // LUCENENET NOTE: Some tests rely on the error type being in // the message. We can't get the error type with StackTrace, we // need ToString() for that. infoStream?.WriteLine(e.ToString()); - //infoStream.WriteLine(e.StackTrace); + //infoStream.WriteLine(e.StackTrace); } return status; @@ -1710,12 +1710,12 @@ public static Status.StoredFieldStatus TestStoredFields(AtomicReader reader, Tex { Msg(infoStream, "ERROR [" + e.Message + "]"); status.Error = e; - + // LUCENENET NOTE: Some tests rely on the error type being in // the message. We can't get the error type with StackTrace, we // need ToString() for that. infoStream?.WriteLine(e.ToString()); - //infoStream.WriteLine(e.StackTrace); + //infoStream.WriteLine(e.StackTrace); } return status; @@ -1732,7 +1732,7 @@ public static Status.DocValuesStatus TestDocValues(AtomicReader reader, TextWrit try { infoStream?.Write(" test: docvalues..........."); - + foreach (FieldInfo fieldInfo in reader.FieldInfos) { if (fieldInfo.HasDocValues) @@ -1755,12 +1755,12 @@ public static Status.DocValuesStatus TestDocValues(AtomicReader reader, TextWrit { Msg(infoStream, "ERROR [" + e.Message + "]"); status.Error = e; - + // LUCENENET NOTE: Some tests rely on the error type being in // the message. We can't get the error type with StackTrace, we // need ToString() for that. infoStream?.WriteLine(e.ToString()); - //infoStream.WriteLine(e.StackTrace); + //infoStream.WriteLine(e.StackTrace); } return status; } @@ -2278,7 +2278,7 @@ public static Status.TermVectorStatus TestTermVectors(AtomicReader reader, TextW { Msg(infoStream, "ERROR [" + e.Message + "]"); status.Error = e; - + // LUCENENET NOTE: Some tests rely on the error type being in // the message. We can't get the error type with StackTrace, we // need ToString() for that. @@ -2366,14 +2366,16 @@ public virtual void FixIndex(Status result) /// - /// LUCENENET specific: This method is not for direct use. In the Java implementation - /// it was intended to be called from the command line. However in .NET a + /// LUCENENET specific: In the Java implementation, this Main method + /// was intended to be called from the command line. However, in .NET a /// method within a DLL can't be directly called from the command line so we - /// provide a lucene-cli - /// with a command that maps to this method: index check. + /// provide a .NET tool, + /// lucene-cli, + /// with a command that maps to this method: + /// index check /// - /// - /// + /// The command line arguments + /// Thrown if invalid arguments are provided [STAThread] public static void Main(string[] args) { diff --git a/src/Lucene.Net/Index/IndexUpgrader.cs b/src/Lucene.Net/Index/IndexUpgrader.cs index 7f1477546c..731369ed72 100644 --- a/src/Lucene.Net/Index/IndexUpgrader.cs +++ b/src/Lucene.Net/Index/IndexUpgrader.cs @@ -37,23 +37,25 @@ namespace Lucene.Net.Index /// /// This is an easy-to-use tool that upgrades all segments of an index from previous Lucene versions /// to the current segment file format. It can be used from command line. - /// - /// LUCENENET specific: In the Java implementation this class' Main - /// method was intended to be called from the command line. However in .NET a + /// + /// LUCENENET specific: In the Java implementation, this class' Main method + /// was intended to be called from the command line. However, in .NET a /// method within a DLL can't be directly called from the command line so we - /// provide a lucene-cli - /// with a command that maps to that method: index upgrade. - /// + /// provide a .NET tool, + /// lucene-cli, + /// with a command that maps to that method: + /// index upgrade + /// /// Alternatively this class can be instantiated and invoked. It uses /// and triggers the upgrade via an request to . - /// + /// /// This tool keeps only the last commit in an index; for this /// reason, if the incoming index has more than one commit, the tool /// refuses to run by default. Specify -delete-prior-commits /// to override this, allowing the tool to delete all but the last commit. /// From .NET code this can be enabled by passing true to /// . - /// + /// /// Warning: this tool may reorder documents if the index was partially /// upgraded before execution (e.g., documents were added). If your application relies /// on "monotonicity" of doc IDs (which means that the order in which the documents @@ -82,16 +84,17 @@ private static void PrintUsage() /// /// Main method to run from the /// command-line. - /// - /// LUCENENET specific: This method is not for direct use. In the Java implementation - /// it was intended to be called from the command line. However in .NET a + /// + /// LUCENENET specific: In the Java implementation, this Main method + /// was intended to be called from the command line. However, in .NET a /// method within a DLL can't be directly called from the command line so we - /// provide a lucene-cli - /// with a command that maps to this method: index upgrade. - /// + /// provide a .NET tool, + /// lucene-cli, + /// with a command that maps to this method: + /// index upgrade /// - /// - /// + /// The command line arguments + /// Thrown if any incorrect arguments are provided public static void Main(string[] args) { ParseArgs(args).Upgrade(); diff --git a/src/Lucene.Net/Store/LockStressTest.cs b/src/Lucene.Net/Store/LockStressTest.cs index 8a9a9c5521..dc0b218e5c 100644 --- a/src/Lucene.Net/Store/LockStressTest.cs +++ b/src/Lucene.Net/Store/LockStressTest.cs @@ -26,19 +26,17 @@ namespace Lucene.Net.Store * limitations under the License. */ - // LUCENENET: Not used - /////Run without any args to see usage. - /// /// Simple standalone tool that forever acquires & releases a /// lock using a specific . - /// - /// LUCENENET specific: This class is not for direct use. In the Java implementation - /// it's Main method was intended to be called from the command line. However in .NET a + /// + /// LUCENENET specific: In the Java implementation, this class' Main method + /// was intended to be called from the command line. However, in .NET a /// method within a DLL can't be directly called from the command line so we - /// provide a lucene-cli - /// with a command that maps to that method: lock stress-test. - /// + /// provide a .NET tool, + /// lucene-cli, + /// with a command that maps to that method: + /// lock stress-test /// /// /// @@ -46,14 +44,16 @@ public static class LockStressTest // LUCENENET specific: CA1052 Static holder t { /// - /// LUCENENET specific: This method is not for direct use. In the Java implementation - /// it was intended to be called from the command line. However in .NET a + /// LUCENENET specific: In the Java implementation, this Main method + /// was intended to be called from the command line. However, in .NET a /// method within a DLL can't be directly called from the command line so we - /// provide a lucene-cli - /// with a command that maps to this method: lock stress-test. + /// provide a .NET tool, + /// lucene-cli, + /// with a command that maps to this method: + /// lock stress-test /// - /// - /// + /// The command line arguments + /// Thrown if the incorrect number of arguments are provided [STAThread] [SuppressMessage("CodeQuality", "IDE0079:Remove unnecessary suppression", Justification = "This is a SonarCloud issue")] [SuppressMessage("Security Hotspot", "S2245:Using pseudorandom number generators (PRNGs) is security-sensitive", Justification = "The Random class is only used to generate a timeout value")] @@ -63,20 +63,20 @@ public static void Main(string[] args) { // LUCENENET specific - our lucene-cli wrapper console shows the correct usage throw new ArgumentException(); - //Console.WriteLine("Usage: java Lucene.Net.Store.LockStressTest myID verifierHost verifierPort lockFactoryClassName lockDirName sleepTimeMS count\n" + - // "\n" + - // " myID = int from 0 .. 255 (should be unique for test process)\n" + - // " verifierHost = hostname that LockVerifyServer is listening on\n" + - // " verifierPort = port that LockVerifyServer is listening on\n" + - // " lockFactoryClassName = primary LockFactory class that we will use\n" + - // " lockDirName = path to the lock directory (only set for Simple/NativeFSLockFactory\n" + - // " sleepTimeMS = milliseconds to pause betweeen each lock obtain/release\n" + - // " count = number of locking tries\n" + - // "\n" + - // "You should run multiple instances of this process, each with its own\n" + - // "unique ID, and each pointing to the same lock directory, to verify\n" + - // "that locking is working correctly.\n" + - // "\n" + + //Console.WriteLine("Usage: java Lucene.Net.Store.LockStressTest myID verifierHost verifierPort lockFactoryClassName lockDirName sleepTimeMS count\n" + + // "\n" + + // " myID = int from 0 .. 255 (should be unique for test process)\n" + + // " verifierHost = hostname that LockVerifyServer is listening on\n" + + // " verifierPort = port that LockVerifyServer is listening on\n" + + // " lockFactoryClassName = primary LockFactory class that we will use\n" + + // " lockDirName = path to the lock directory (only set for Simple/NativeFSLockFactory\n" + + // " sleepTimeMS = milliseconds to pause betweeen each lock obtain/release\n" + + // " count = number of locking tries\n" + + // "\n" + + // "You should run multiple instances of this process, each with its own\n" + + // "unique ID, and each pointing to the same lock directory, to verify\n" + + // "that locking is working correctly.\n" + + // "\n" + // "Make sure you are first running LockVerifyServer."); //Environment.FailFast("1"); } diff --git a/src/Lucene.Net/Store/LockVerifyServer.cs b/src/Lucene.Net/Store/LockVerifyServer.cs index 2aa64bb235..5da9d58bb8 100644 --- a/src/Lucene.Net/Store/LockVerifyServer.cs +++ b/src/Lucene.Net/Store/LockVerifyServer.cs @@ -30,20 +30,18 @@ namespace Lucene.Net.Store using IOUtils = Lucene.Net.Util.IOUtils; - // LUCENENET: Not used - ///// Run without any args to see usage. - /// /// Simple standalone server that must be running when you /// use . This server simply /// verifies at most one process holds the lock at a time. - /// - /// LUCENENET specific: This class is not for direct use. In the Java implementation - /// it's Main method was intended to be called from the command line. However in .NET a + /// + /// LUCENENET specific: In the Java implementation, this class' Main method + /// was intended to be called from the command line. However, in .NET a /// method within a DLL can't be directly called from the command line so we - /// provide a lucene-cli - /// with a command that maps to that method: lock verify-server. - /// + /// provide a .NET tool, + /// lucene-cli, + /// with a command that maps to that method: + /// lock verify-server /// /// /// @@ -51,14 +49,16 @@ public static class LockVerifyServer // LUCENENET specific: CA1052 Static holder { /// - /// LUCENENET specific: This method is not for direct use. In the Java implementation - /// it was intended to be called from the command line. However in .NET a + /// LUCENENET specific: In the Java implementation, this Main method + /// was intended to be called from the command line. However, in .NET a /// method within a DLL can't be directly called from the command line so we - /// provide a lucene-cli - /// with a command that maps to this method: lock verify-server. + /// provide a .NET tool, + /// lucene-cli, + /// with a command that maps to this method: + /// lock verify-server /// - /// - /// + /// The command line arguments + /// Thrown if the incorrect number of arguments are provided [STAThread] public static void Main(string[] args) {