From fdcf98ecfb7b8e88a37aec88f43c4430552d0fc0 Mon Sep 17 00:00:00 2001 From: Shannon Date: Thu, 26 Sep 2024 09:10:26 -0600 Subject: [PATCH] notes --- src/Examine.Lucene/Search/LuceneSearchExecutor.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Examine.Lucene/Search/LuceneSearchExecutor.cs b/src/Examine.Lucene/Search/LuceneSearchExecutor.cs index 11e4ac80..2f89151f 100644 --- a/src/Examine.Lucene/Search/LuceneSearchExecutor.cs +++ b/src/Examine.Lucene/Search/LuceneSearchExecutor.cs @@ -128,9 +128,12 @@ public ISearchResults Execute() var results = new List(topDocs.ScoreDocs.Length); - // Order by Doc Id for improved perf! + // TODO: Order by Doc Id for improved perf?? + // Our benchmarks show this is isn't a significant performance improvement, + // but they could be wrong. Sorting by DocId here could only be done if there + // are no sort options. // See https://cwiki.apache.org/confluence/display/lucene/ImproveSearchingSpeed - foreach (var scoreDoc in topDocs.ScoreDocs/*.OrderBy(x => x.Doc)*/) + foreach (var scoreDoc in topDocs.ScoreDocs) { var result = GetSearchResult(scoreDoc, topDocs, searcher.IndexSearcher); results.Add(result);