Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SWEEP: Normalized all TODOs to LUCENENET TODO and LUCENENET UPGRADE TODO #1009

Merged
merged 2 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Lucene.NET Contributor's Guide
# Lucene.NET Contributor's Guide

Have you found a bug or do you have an idea for a cool new enhancement? Contributing code is a great way to give something back to the open-source community. Before you dig right into the code there are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things.

Expand Down Expand Up @@ -26,7 +26,7 @@ There are several [**Open Issues on GitHub**](https://github.com/apache/lucenene
* Helping update the API, or at least just providing feedback on which API changes are affecting the usability. There are several things on our radar, like integrating something like [Lucene.Net.Linq](https://github.com/themotleyfool/Lucene.Net.Linq) directly into our project, [converting the remaining public-facing iterator classes into `IEnumerator<T>`](https://issues.apache.org/jira/projects/LUCENENET/issues/LUCENENET-469?filter=allopenissues) so they can be used with foreach loops, adding extension methods to remove the need for casting, etc.
* Making demos and tutorials, blogging about Lucene.Net, etc. (and providing feedback on how we can make the API better!). If you write a helpful Lucene.Net post on your blog, be sure to let us know so we can link to it.
* Helping out with documentation. We are still trying to make the API docs easily navigable (see #206), and there are many files that are not formatted correctly (links not appearing, tables not very readable, etc). Also, we need help getting all of the Java-related documentation converted to use .NET methodologies.
* Fixing TODOs. There are several TODOs throughout the code that need to be reviewed and action taken, if necessary. Search for `LUCENENET TODO|LUCENE TO-DO` using the regular expression option in Visual Studio to find them. Do note there are a lot of TODOs left over from Java Lucene that are safe to ignore.
* Fixing TODOs. There are several TODOs throughout the code that need to be reviewed and action taken, if necessary. Search for `LUCENENET TODO` using the regular expression option in Visual Studio to find them. Do note there are a lot of TODOs left over from Java Lucene that are safe to ignore.
* Reviewing code. Pick a random section, review line by line, comparing the code against the [original Lucene 4.8.0 code](https://github.com/apache/lucene-solr/tree/releases/lucene-solr/4.8.0/lucene). Many of the bugs have been found this way, as the tests are not showing them. Let us know if you find anything suspicious on the [dev mailing list](https://cwiki.apache.org/confluence/display/LUCENENET/Mailing+Lists) or [submit a pull request](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request) with a fix.
* Creating projects to make Lucene.Net easier to use with various .NET frameworks (ASP.NET MVC, WebApi, AspNetCore, WPF, EntityFramework, etc). In general, we would like common tasks as easy as possible to integrate into applications build on these frameworks without everyone having to write the same boilerplate code.
* Building automation tools to eliminate some of the manual work of managing the project, updating information on various web pages, creating tools to make porting/upgrading more automated, etc.
Expand All @@ -35,4 +35,4 @@ Or, if none of that interests you, join our [dev mailing list](https://cwiki.apa

## Thank You For Your Help!

Again, thank you very much for your contribution. May the fork be with you!
Again, thank you very much for your contribution. May the fork be with you!
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public AnalyzingInfixSuggester(LuceneVersion matchVersion, Directory dir, Analyz
/// ngrams (increasing index size but making lookups
/// faster). </param>
// LUCENENET specific - LUCENE-5889, a 4.11.0 feature. calls new constructor with extra param.
// LUCENENET TODO: Remove method at version 4.11.0. Was retained for perfect 4.8 compatibility
// LUCENENET UPGRADE TODO: Remove method at version 4.11.0. Was retained for perfect 4.8 compatibility
public AnalyzingInfixSuggester(LuceneVersion matchVersion, Directory dir, Analyzer indexAnalyzer,
Analyzer queryAnalyzer, int minPrefixChars)
: this(matchVersion, dir, indexAnalyzer, queryAnalyzer, minPrefixChars, commitOnBuild: false)
Expand Down Expand Up @@ -896,4 +896,4 @@ public override long Count
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public BlendedInfixSuggester(LuceneVersion matchVersion, Directory dir, Analyzer
/// <param name="numFactor"> Factor to multiply the number of searched elements before ponderate </param>
/// <exception cref="IOException"> If there are problems opening the underlying Lucene index. </exception>
// LUCENENET specific - LUCENE-5889, a 4.11.0 feature. calls new constructor with extra param.
// LUCENENET TODO: Remove method at version 4.11.0. Was retained for perfect 4.8 compatibility
// LUCENENET UPGRADE TODO: Remove method at version 4.11.0. Was retained for perfect 4.8 compatibility
public BlendedInfixSuggester(LuceneVersion matchVersion, Directory dir, Analyzer indexAnalyzer, Analyzer queryAnalyzer, int minPrefixChars,
BlenderType blenderType, int numFactor)
: this(matchVersion, dir, indexAnalyzer, queryAnalyzer, minPrefixChars, blenderType, numFactor, commitOnBuild: false)
Expand Down Expand Up @@ -325,4 +325,4 @@ public virtual int Compare(Lookup.LookupResult o1, Lookup.LookupResult o2)
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public void TestBasic()
};

Analyzer a = new MockAnalyzer(Random, MockTokenizer.WHITESPACE, false);
using AnalyzingInfixSuggester suggester = new AnalyzingInfixSuggester(TEST_VERSION_CURRENT, NewDirectory(), a, a, 3); //LUCENENET TODO: add extra false param at version 4.11.0
using AnalyzingInfixSuggester suggester = new AnalyzingInfixSuggester(TEST_VERSION_CURRENT, NewDirectory(), a, a, 3); //LUCENENET UPGRADE TODO: add extra false param at version 4.11.0
suggester.Build(new InputArrayEnumerator(keys));

IList<Lookup.LookupResult> results = suggester.DoLookup(TestUtil.StringToCharSequence("ear", Random).ToString(), 10, true, true);
Expand Down Expand Up @@ -95,14 +95,14 @@ public void TestAfterLoad()
DirectoryInfo tempDir = CreateTempDir("AnalyzingInfixSuggesterTest");

Analyzer a = new MockAnalyzer(Random, MockTokenizer.WHITESPACE, false);
AnalyzingInfixSuggester suggester = new AnalyzingInfixSuggester(TEST_VERSION_CURRENT, NewFSDirectory(tempDir), a, a, 3); //LUCENENET TODO: add extra false param at version 4.11.0
AnalyzingInfixSuggester suggester = new AnalyzingInfixSuggester(TEST_VERSION_CURRENT, NewFSDirectory(tempDir), a, a, 3); //LUCENENET UPGRADE TODO: add extra false param at version 4.11.0
try
{
suggester.Build(new InputArrayEnumerator(keys));
assertEquals(2, suggester.Count);
suggester.Dispose();

suggester = new AnalyzingInfixSuggester(TEST_VERSION_CURRENT, NewFSDirectory(tempDir), a, a, 3); //LUCENENET TODO: add extra false param at version 4.11.0
suggester = new AnalyzingInfixSuggester(TEST_VERSION_CURRENT, NewFSDirectory(tempDir), a, a, 3); //LUCENENET UPGRADE TODO: add extra false param at version 4.11.0
IList<Lookup.LookupResult> results = suggester.DoLookup(TestUtil.StringToCharSequence("ear", Random).ToString(), 10, true, true);
assertEquals(2, results.size());
assertEquals("a penny saved is a penny <b>ear</b>ned", results[0].Key);
Expand Down Expand Up @@ -145,7 +145,7 @@ public override string ToString()
internal class TestHighlightAnalyzingInfixSuggester : AnalyzingInfixSuggester
{
public TestHighlightAnalyzingInfixSuggester(AnalyzingInfixSuggesterTest outerInstance, Analyzer a)
: base(TEST_VERSION_CURRENT, NewDirectory(), a, a, 3) //LUCENENET TODO: add extra false param at version 4.11.0
: base(TEST_VERSION_CURRENT, NewDirectory(), a, a, 3) //LUCENENET UPGRADE TODO: add extra false param at version 4.11.0
{
}

Expand Down Expand Up @@ -254,7 +254,7 @@ public void TestRandomMinPrefixLength()

Analyzer a = new MockAnalyzer(Random, MockTokenizer.WHITESPACE, false);
int minPrefixLength = Random.nextInt(10);
AnalyzingInfixSuggester suggester = new AnalyzingInfixSuggester(TEST_VERSION_CURRENT, NewFSDirectory(tempDir), a, a, minPrefixLength); //LUCENENET TODO: add extra false param at version 4.11.0
AnalyzingInfixSuggester suggester = new AnalyzingInfixSuggester(TEST_VERSION_CURRENT, NewFSDirectory(tempDir), a, a, minPrefixLength); //LUCENENET UPGRADE TODO: add extra false param at version 4.11.0
try
{
suggester.Build(new InputArrayEnumerator(keys));
Expand Down Expand Up @@ -330,7 +330,7 @@ public void TestRandomMinPrefixLength()

// Make sure things still work after close and reopen:
suggester.Dispose();
suggester = new AnalyzingInfixSuggester(TEST_VERSION_CURRENT, NewFSDirectory(tempDir), a, a, minPrefixLength); //LUCENENET TODO: add extra false param at version 4.11.0
suggester = new AnalyzingInfixSuggester(TEST_VERSION_CURRENT, NewFSDirectory(tempDir), a, a, minPrefixLength); //LUCENENET UPGRADE TODO: add extra false param at version 4.11.0
}
}
finally
Expand All @@ -348,7 +348,7 @@ public void TestHighlight()
};

Analyzer a = new MockAnalyzer(Random, MockTokenizer.WHITESPACE, false);
using AnalyzingInfixSuggester suggester = new AnalyzingInfixSuggester(TEST_VERSION_CURRENT, NewDirectory(), a, a, 3); //LUCENENET TODO: add extra false param at version 4.11.0
using AnalyzingInfixSuggester suggester = new AnalyzingInfixSuggester(TEST_VERSION_CURRENT, NewDirectory(), a, a, 3); //LUCENENET UPGRADE TODO: add extra false param at version 4.11.0
suggester.Build(new InputArrayEnumerator(keys));
IList<Lookup.LookupResult> results = suggester.DoLookup(TestUtil.StringToCharSequence("penn", Random).ToString(), 10, true, true);
assertEquals(1, results.size());
Expand All @@ -359,7 +359,7 @@ internal class TestHighlightChangeCaseAnalyzingInfixSuggester : AnalyzingInfixSu
{
private readonly AnalyzingInfixSuggesterTest outerInstance;
public TestHighlightChangeCaseAnalyzingInfixSuggester(AnalyzingInfixSuggesterTest outerInstance, Analyzer a)
: base(TEST_VERSION_CURRENT, NewDirectory(), a, a, 3) //LUCENENET TODO: add extra false param at version 4.11.0
: base(TEST_VERSION_CURRENT, NewDirectory(), a, a, 3) //LUCENENET UPGRADE TODO: add extra false param at version 4.11.0
{
this.outerInstance = outerInstance;
}
Expand All @@ -381,7 +381,7 @@ public void TestHighlightCaseChange()

Analyzer a = new MockAnalyzer(Random, MockTokenizer.WHITESPACE, true);
IList<Lookup.LookupResult> results;
using (AnalyzingInfixSuggester suggester = new AnalyzingInfixSuggester(TEST_VERSION_CURRENT, NewDirectory(), a, a, 3)) //LUCENENET TODO: add extra false param at version 4.11.0
using (AnalyzingInfixSuggester suggester = new AnalyzingInfixSuggester(TEST_VERSION_CURRENT, NewDirectory(), a, a, 3)) //LUCENENET UPGRADE TODO: add extra false param at version 4.11.0
{
suggester.Build(new InputArrayEnumerator(keys));
results = suggester.DoLookup(TestUtil.StringToCharSequence("penn", Random).ToString(), 10, true, true);
Expand Down Expand Up @@ -445,7 +445,7 @@ public void TestSuggestStopFilter()
public void TestEmptyAtStart()
{
Analyzer a = new MockAnalyzer(Random, MockTokenizer.WHITESPACE, false);
using AnalyzingInfixSuggester suggester = new AnalyzingInfixSuggester(TEST_VERSION_CURRENT, NewDirectory(), a, a, 3); //LUCENENET TODO: add extra false param at version 4.11.0
using AnalyzingInfixSuggester suggester = new AnalyzingInfixSuggester(TEST_VERSION_CURRENT, NewDirectory(), a, a, 3); //LUCENENET UPGRADE TODO: add extra false param at version 4.11.0
suggester.Build(new InputArrayEnumerator(new Input[0]));
suggester.Add(new BytesRef("a penny saved is a penny earned"), null, 10, new BytesRef("foobaz"));
suggester.Add(new BytesRef("lend me your ear"), null, 8, new BytesRef("foobar"));
Expand Down Expand Up @@ -483,7 +483,7 @@ public void TestEmptyAtStart()
public void TestBothExactAndPrefix()
{
Analyzer a = new MockAnalyzer(Random, MockTokenizer.WHITESPACE, false);
using AnalyzingInfixSuggester suggester = new AnalyzingInfixSuggester(TEST_VERSION_CURRENT, NewDirectory(), a, a, 3); //LUCENENET TODO: add extra false param at version 4.11.0
using AnalyzingInfixSuggester suggester = new AnalyzingInfixSuggester(TEST_VERSION_CURRENT, NewDirectory(), a, a, 3); //LUCENENET UPGRADE TODO: add extra false param at version 4.11.0
suggester.Build(new InputArrayEnumerator(new Input[0]));
suggester.Add(new BytesRef("the pen is pretty"), null, 10, new BytesRef("foobaz"));
suggester.Refresh();
Expand Down Expand Up @@ -595,7 +595,7 @@ public void TestRandomNRT()
Console.WriteLine(" minPrefixChars=" + minPrefixChars);
}

AnalyzingInfixSuggester suggester = new AnalyzingInfixSuggester(TEST_VERSION_CURRENT, NewFSDirectory(tempDir), a, a, minPrefixChars); //LUCENENET TODO: add extra false param at version 4.11.0
AnalyzingInfixSuggester suggester = new AnalyzingInfixSuggester(TEST_VERSION_CURRENT, NewFSDirectory(tempDir), a, a, minPrefixChars); //LUCENENET UPGRADE TODO: add extra false param at version 4.11.0
try
{

Expand Down Expand Up @@ -692,7 +692,7 @@ public void TestRandomNRT()
}
lookupThread.Finish();
suggester.Dispose();
suggester = new AnalyzingInfixSuggester(TEST_VERSION_CURRENT, NewFSDirectory(tempDir), a, a, minPrefixChars); //LUCENENET TODO: add extra false param at version 4.11.0
suggester = new AnalyzingInfixSuggester(TEST_VERSION_CURRENT, NewFSDirectory(tempDir), a, a, minPrefixChars); //LUCENENET UPGRADE TODO: add extra false param at version 4.11.0
lookupThread = new LookupThread(this, suggester);
lookupThread.Start();

Expand Down Expand Up @@ -896,7 +896,7 @@ public void TestBasicNRT()
};

Analyzer a = new MockAnalyzer(Random, MockTokenizer.WHITESPACE, false);
using AnalyzingInfixSuggester suggester = new AnalyzingInfixSuggester(TEST_VERSION_CURRENT, NewDirectory(), a, a, 3); //LUCENENET TODO: add extra false param at version 4.11.0
using AnalyzingInfixSuggester suggester = new AnalyzingInfixSuggester(TEST_VERSION_CURRENT, NewDirectory(), a, a, 3); //LUCENENET UPGRADE TODO: add extra false param at version 4.11.0
suggester.Build(new InputArrayEnumerator(keys));

IList<Lookup.LookupResult> results = suggester.DoLookup(TestUtil.StringToCharSequence("ear", Random).ToString(), 10, true, true);
Expand Down Expand Up @@ -1053,13 +1053,13 @@ public void TestBasicContext()
Analyzer a = new MockAnalyzer(Random, MockTokenizer.WHITESPACE, false);
if (iter == 0)
{
suggester = new AnalyzingInfixSuggester(TEST_VERSION_CURRENT, NewFSDirectory(tempDir), a, a, 3); //LUCENENET TODO: add extra false param at version 4.11.0
suggester = new AnalyzingInfixSuggester(TEST_VERSION_CURRENT, NewFSDirectory(tempDir), a, a, 3); //LUCENENET UPGRADE TODO: add extra false param at version 4.11.0
suggester.Build(new InputArrayEnumerator(keys));
}
else
{
// Test again, after close/reopen:
suggester = new AnalyzingInfixSuggester(TEST_VERSION_CURRENT, NewFSDirectory(tempDir), a, a, 3); //LUCENENET TODO: add extra false param at version 4.11.0
suggester = new AnalyzingInfixSuggester(TEST_VERSION_CURRENT, NewFSDirectory(tempDir), a, a, 3); //LUCENENET UPGRADE TODO: add extra false param at version 4.11.0
}

// No context provided, all results returned
Expand Down
Loading
Loading