Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
111 commits
Select commit Hold shift + click to select a range
ce72959
Update build.yml
Shazwazza Jul 21, 2023
4d03424
Update docfx-gh-pages.yml
Shazwazza Jul 21, 2023
98d852c
Update searching.md
vivekBoii Oct 27, 2023
403bfa7
Merge pull request #354 from vivekBoii/release/3.0
Shazwazza Oct 27, 2023
8765159
Update searching.md
vivekBoii Oct 27, 2023
11ef198
Merge pull request #355 from vivekBoii/boii
Shazwazza Oct 27, 2023
10fbef3
Fixes #335
Shazwazza Nov 30, 2023
03d208b
don't allocate if not needed
Shazwazza Nov 30, 2023
f82ae8c
Fix docs for synchronous index building
jakoss Dec 18, 2023
c5a0403
Update indexing.md
jakoss Dec 18, 2023
5004b13
Merge pull request #371 from jakoss/feature/fix-sync-import-docs
Shazwazza Dec 18, 2023
a72e67c
commit ignored test
Shazwazza Dec 20, 2023
56c8971
Adds Id query
Shazwazza Dec 21, 2023
a4ef706
Bump nokogiri from 1.15.4 to 1.16.3 in /docs
dependabot[bot] Mar 19, 2024
7eb3c0d
Merge pull request #380 from Shazwazza/dependabot/bundler/docs/nokogi…
Shazwazza Apr 4, 2024
c8c9579
Bumps to LTS versions of .NET and dependencies. Uses FSDirectory.Open…
Shazwazza May 2, 2024
d36618b
Bump nokogiri from 1.16.3 to 1.16.5 in /docs
dependabot[bot] May 13, 2024
7b81af0
Bump rexml from 3.2.5 to 3.2.8 in /docs
dependabot[bot] May 16, 2024
7899063
Fixes #351
Shazwazza Jun 14, 2024
a367eab
Fixing SyncedFileSystemDirectoryFactory when the main index is corrup…
Shazwazza Jun 26, 2024
c15b7c8
Adds more checks and logging
Shazwazza Jun 26, 2024
41c2221
Adds test
Shazwazza Jun 26, 2024
2a3bcd2
Adds test case
Shazwazza Jun 26, 2024
162c468
missed file
Shazwazza Jun 26, 2024
190b08e
Another test case
Shazwazza Jun 26, 2024
e1a12d0
Merge pull request #384 from Shazwazza/dependabot/bundler/docs/nokogi…
Shazwazza Jun 27, 2024
ef1a5d8
Merge pull request #385 from Shazwazza/dependabot/bundler/docs/rexml-…
Shazwazza Jun 27, 2024
75f5a70
Adds functionality to sync from local to main if main is corrupt with…
Shazwazza Jun 27, 2024
3cb55ea
Makes it optional whether to attempt to fix the indexes, default is f…
Shazwazza Jun 27, 2024
f1857c6
mostly just analysis changes
Shazwazza Jul 17, 2024
d85b1e1
update test output
Shazwazza Jul 18, 2024
5a5c5f2
trying to get tests to work
Shazwazza Jul 18, 2024
7c17e5d
adds logging
Shazwazza Jul 18, 2024
328dcd8
try again
Shazwazza Jul 19, 2024
5fb1fd1
try again
Shazwazza Jul 19, 2024
5129af2
try again
Shazwazza Jul 19, 2024
7c25530
Fix tests
Shazwazza Jul 31, 2024
6332d84
Merge branch 'release/3.0' of https://github.com/Shazwazza/Examine in…
Shazwazza Jul 31, 2024
9727b62
adds notes
Shazwazza Jul 31, 2024
92b514b
Adds Concurrency search tests
Shazwazza Aug 15, 2024
aa098e1
Updates ConcurrencyTests
Shazwazza Aug 15, 2024
52da13e
Adds benchmarks
Shazwazza Aug 16, 2024
b25fa83
adds results
Shazwazza Aug 16, 2024
00cb2a4
Updates various places to reduce the need to acquire a searcher/reade…
Shazwazza Aug 20, 2024
45849a1
Makes lucene simple benchmarks behave more like examine implementation
Shazwazza Aug 20, 2024
3760023
Don't ever use MaxDocs, avoid a query and ensure that max docs used i…
Shazwazza Aug 21, 2024
aaa3d7e
Cleanup, ensure correct disposal, ensure absolute max results
Shazwazza Aug 21, 2024
5090ef1
exclude benchmarks from running in build
Shazwazza Aug 21, 2024
42babc2
try without backslash
Shazwazza Aug 21, 2024
0115e05
try quotes
Shazwazza Aug 21, 2024
6c92de0
brackets?
Shazwazza Aug 21, 2024
ede285e
doh, double dashes
Shazwazza Aug 21, 2024
7728971
Fixes tests, adds notes
Shazwazza Sep 4, 2024
6378213
Ensure we try to refresh when NRT is not enabled.
Shazwazza Sep 4, 2024
64c3d25
oops, make sure we apply all deletes.
Shazwazza Sep 4, 2024
8567da5
don't enable NRT in our synced dir tests
Shazwazza Sep 4, 2024
2283e40
fix build
Shazwazza Sep 4, 2024
e75b43f
Trying to get the build working while ignore running benchmarks.
Shazwazza Sep 4, 2024
9ec6277
try filtering differently?
Shazwazza Sep 4, 2024
47a4240
separate benchmark proj
Shazwazza Sep 4, 2024
24e6405
don't pack
Shazwazza Sep 4, 2024
b2bde05
no assembly info
Shazwazza Sep 4, 2024
f7f8f4c
Fix backward compat
Shazwazza Sep 4, 2024
b566aa3
Updates benchmarks
Shazwazza Sep 10, 2024
6b134b5
fix build
Shazwazza Sep 12, 2024
937b04d
fix build
Shazwazza Sep 12, 2024
c5b761e
fix build
Shazwazza Sep 12, 2024
b78465d
Sorts docs by id for, don't cast, less allocations for better perf. U…
Shazwazza Sep 18, 2024
dc0b886
reverts some last minute changes, ensures multiple searches work when…
Shazwazza Sep 26, 2024
fdcf98e
notes
Shazwazza Sep 26, 2024
3e8bf11
Fixing tests
Shazwazza Sep 30, 2024
7301932
Update build.yml
Shazwazza Oct 1, 2024
f0f5e94
Start adding version comparisons
Shazwazza Oct 10, 2024
5b3b025
Getting nuget comparison benchmarks working
Shazwazza Oct 16, 2024
2f66fe2
fix build
Shazwazza Oct 16, 2024
6719014
fix build
Shazwazza Oct 16, 2024
00dbecc
Ensure benchmarks work between versions (including old buggy ones)
Shazwazza Oct 16, 2024
af8734a
Reduce default max limit
Shazwazza Oct 16, 2024
35ee885
Adds more scenarios for SyncedFileSystemDirectoryFactory and fixes an…
Shazwazza Oct 17, 2024
5fff5b9
ensure commit just in case
Shazwazza Oct 17, 2024
f10f0c5
Merge remote-tracking branch 'origin/master' into hotfix/3.4.0-beta0001
Shazwazza Oct 17, 2024
a8b31e7
Move to support branches.
Shazwazza Oct 17, 2024
88a4a29
bumping gitversion date
Shazwazza Oct 25, 2024
b315503
try making gitversion actually work
Shazwazza Oct 25, 2024
74f194d
Bump rexml from 3.2.8 to 3.3.9 in /docs
dependabot[bot] Oct 28, 2024
f4d9f72
Bump Lucene version
Shazwazza Nov 13, 2024
06f9795
warnings as errors
Shazwazza Nov 21, 2024
654a994
warnings as errors
Shazwazza Nov 21, 2024
295c45d
Merge pull request #394 from Shazwazza/dependabot/bundler/docs/rexml-…
Shazwazza Nov 21, 2024
3c5b47e
fix pre release warning
Shazwazza Nov 22, 2024
8275c80
Updates paging test
Shazwazza Jan 10, 2025
b7ca3aa
fixing gitversino again
Shazwazza Jan 10, 2025
6ec92e4
Adds feature to increase max skiptake dataset size or pre-calculate
Shazwazza Jan 10, 2025
efeff6d
merge 3.6.0
Feb 11, 2025
c4b445d
Fixes SyncedFileSystemDirectory
Shazwazza Feb 26, 2025
c3babdc
Adjust index writer options and commit scheduler timer
Shazwazza Apr 21, 2025
b8b1d62
re-check if index exists after syncing from local
Shazwazza Apr 21, 2025
7ab3746
Better support for detailed logging
Shazwazza Apr 22, 2025
8d543b4
Merge branch 'support/3.x' into v4/feature/merge-v360
Shazwazza Jun 2, 2025
36bbdd4
WIP Starts large cleanup/fixing
Shazwazza Jun 2, 2025
2276866
Handles a lot of obsolete and nullable issues, gets luceneindex into …
Shazwazza Jun 2, 2025
4d50855
it builds but the api compat xml docs are not right
Shazwazza Jun 2, 2025
33eacf7
Quite an overhaul and updating nullability sln wide
Shazwazza Jun 3, 2025
400b02f
It builds
Shazwazza Jun 3, 2025
bcef6e1
fix tests
Shazwazza Jun 4, 2025
1c30991
always use facets
Shazwazza Jun 5, 2025
6f124bc
remove code
Shazwazza Jun 5, 2025
5f74f5e
taxonomy as first class citizen
Shazwazza Jun 5, 2025
a8cd531
SyncedFileSystemDirectoryFactory incorporates taxonomy dir, and gets …
Shazwazza Jun 17, 2025
0d81207
Getting closer, just need to get tests passing
Shazwazza Jun 30, 2025
d911410
Fixing more tests
Shazwazza Sep 15, 2025
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
21 changes: 12 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@ on:
- 'master'
- 'dev'
- 'release/*'
- 'support/*'
- 'hotfix/*'
tags:
- 'v*'
pull_request:
branches:
- 'master'
- 'dev'
- 'release/*'
- 'support/*'
- 'hotfix/*'

jobs:
build:
Expand All @@ -40,18 +44,17 @@ jobs:
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
5.0.x
dotnet-version: |
6.0.x
7.0.x
8.0.x

- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0.9.9
uses: gittools/actions/gitversion/setup@v3.0.3
with:
versionSpec: '5.x'
versionSpec: '6.0.x'

- name: Determine Version
uses: gittools/actions/gitversion/execute@v0.9.9
uses: gittools/actions/gitversion/execute@v3.0.3

- name: Install dependencies
run: dotnet restore ${{ env.Solution_File }}
Expand All @@ -60,10 +63,10 @@ jobs:
run: dotnet build ${{ env.Solution_File }} --configuration ${{ env.Configuration }} --no-restore

- name: Test
run: dotnet test "${{ env.Test_Proj }}" --no-build --verbosity normal --results-directory ${{ github.workspace }}/_TestResults --logger "trx;logfilename=tests.trx"
run: dotnet test "${{ env.Test_Proj }}" --no-build --verbosity normal --results-directory ${{ github.workspace }}/_TestResults --logger "trx;logfilename=tests.trx" --filter "TestCategory!~Benchmarks"

- name: Upload test results
uses: actions/upload-artifact@v2 # upload test results
uses: actions/upload-artifact@v4 # upload test results
if: success() || failure() # run this step even if previous step failed
with:
name: examine-test-results
Expand All @@ -85,7 +88,7 @@ jobs:
--output=${{ github.workspace }}/_NugetOutput

- name: Upload artifacts
uses: actions/upload-artifact@v2 # upload nuget
uses: actions/upload-artifact@v4 # upload nuget
if: success()
with:
name: examine-nuget-${{ env.GitVersion_SemVer }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/docfx-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
# Runs on pushes targeting the default branch
push:
branches: ["feature/docfx"]
pull_request:
branches:
- 'feature/docfx'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
report:
runs-on: ubuntu-latest
steps:
- uses: dorny/test-reporter@v1.4.2
- uses: dorny/test-reporter@v1
with:
artifact: examine-test-results # artifact name
name: Publish Tests # Name of the check run which will be created
Expand Down
15 changes: 2 additions & 13 deletions GitVersion.yml → GitVersion.yml.bak
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,5 @@ commit-message-incrementing: Enabled
commit-date-format: 'yyyy-MM-dd'
ignore:
sha: []
commits-before: 2020-12-21T00:00:00
merge-message-formats: {}
branches:
main:
regex: ^master(\-0\.x)?$|^main(\-0\.x)?$
source-branches: []
develop:
regex: ^dev(elop)?(ment)?(\-0\.x)?$
source-branches:
- main
release:
mode: ContinuousDeployment
source-branches: ['develop']
commits-before: 2021-01-01T00:00:00
merge-message-formats: {}
7 changes: 4 additions & 3 deletions docs/articles/indexing.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,10 @@ myIndex.IndexItem(new ValueSet(
Be default all indexing is done asynchronously. If you need to run indexing synchronously you should create a synchronous scope. This is for instance a necessary step for unit tests.

```cs
using (myIndex.ProcessNonAsync())
using (var luceneIndex = (LuceneIndex)myIndex)
using (var syncIndexContext = luceneIndex.WithThreadingMode(IndexThreadingMode.Synchronous))
{
myIndex.IndexItem(new ValueSet(
luceneIndex.IndexItem(new ValueSet(
"SKU987",
"Product",
new Dictionary<string, object>()
Expand Down Expand Up @@ -251,4 +252,4 @@ private void IndexCommited(object sender, EventArgs e)
{
// Triggered when the index is commited
}
```
```
2 changes: 1 addition & 1 deletion docs/articles/searching.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ query.Field("nodeTypeAlias", "CWS_Home".Boost(20));
var results = query.Execute();
```

This will boost the term `CWS_Home` and make enteries with `nodeTypeAlias:CWS_Home` score higher in the results.
This will boost the term `CWS_Home` and make entries with `nodeTypeAlias:CWS_Home` score higher in the results.

## Proximity

Expand Down
4 changes: 2 additions & 2 deletions docs/docs-v1-v2/searching.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ query.Field("nodeTypeAlias", "CWS_Home".Boost(20));
var results = query.Execute();
```

This will boost the term `CWS_Home` and make enteries with `nodeTypeAlias:CWS_Home` score higher in the results.
This will boost the term `CWS_Home` and make entries with `nodeTypeAlias:CWS_Home` score higher in the results.

## Proximity

Expand Down Expand Up @@ -248,4 +248,4 @@ var query = searcher.CreateQuery();
var query = (LuceneSearchQuery)query.NativeQuery("hello:world").And(); // Make query ready for extending
query.LuceneQuery(NumericRangeQuery.NewInt64Range("numTest", 4, 5, true, true)); // Add the raw lucene query
var results = query.Execute();
```
```
19 changes: 11 additions & 8 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,16 @@
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<NoWarn>NU5104</NoWarn>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All"/>
</ItemGroup>
<PropertyGroup>

<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>

<PackageProjectUrl>https://github.com/Shazwazza/Examine</PackageProjectUrl>
<RepositoryUrl>https://github.com/Shazwazza/Examine</RepositoryUrl>
<RepositoryType>git</RepositoryType>
Expand All @@ -19,14 +24,12 @@
<Authors>shandem</Authors>
<PackageIcon>logo-round-small.png</PackageIcon>
<PackageLicenseExpression>MS-PL</PackageLicenseExpression>
<VersionPrefix>2.0.0</VersionPrefix>
</PropertyGroup>
<PropertyGroup Condition="'$(MSBuildProjectName)' != 'Examine.Web.Demo' AND '$(MSBuildProjectName)' != 'Examine.Test'">
<TargetFrameworks>net6.0;netstandard2.1;netstandard2.0</TargetFrameworks>
<VersionPrefix>4.0.0</VersionPrefix>
</PropertyGroup>

<!-- Disable the nullable warnings when compiling for .NET Standard 2.0 -->
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<NoWarn>$(NoWarn);nullable</NoWarn>
<PropertyGroup>
<TargetFrameworks>net6.0;net8.0;</TargetFrameworks>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>
143 changes: 143 additions & 0 deletions src/Examine.Benchmarks/ConcurrentAcquireBenchmarks.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
using System.Diagnostics;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Jobs;
using Lucene.Net.Analysis;
using Lucene.Net.Analysis.Standard;
using Lucene.Net.Index;
using Lucene.Net.Search;
using Lucene.Net.Store;
using Lucene.Net.Util;
using Microsoft.Extensions.Logging;

namespace Examine.Benchmarks
{
[MediumRunJob(RuntimeMoniker.Net80)]
[ThreadingDiagnoser]
[MemoryDiagnoser]
public class ConcurrentAcquireBenchmarks : ExamineBaseTest
{
private readonly StandardAnalyzer _analyzer = new StandardAnalyzer(LuceneInfo.CurrentVersion);
private string? _tempBasePath;
private FSDirectory? _indexDir;
private IndexWriter? _writer;
private SearcherManager? _searcherManager;

[GlobalSetup]
public override void Setup()
{
base.Setup();

_tempBasePath = Path.Combine(Path.GetTempPath(), "ExamineTests");

// indexer for lucene
InitializeAndIndexItems(_tempBasePath, _analyzer, out var indexDir);
_indexDir = FSDirectory.Open(indexDir);
var writerConfig = new IndexWriterConfig(LuceneVersion.LUCENE_48, _analyzer);
//writerConfig.SetMaxBufferedDocs(1000);
//writerConfig.SetReaderTermsIndexDivisor(4);
//writerConfig.SetOpenMode(OpenMode.APPEND);
//writerConfig.SetReaderPooling(true);
//writerConfig.SetCodec(new Lucene46Codec());
_writer = new IndexWriter(_indexDir, writerConfig);
var trackingWriter = new TrackingIndexWriter(_writer);
_searcherManager = new SearcherManager(trackingWriter.IndexWriter, applyAllDeletes: true, new SearcherFactory());
}

[GlobalCleanup]
public override void TearDown()
{
_searcherManager?.Dispose();
_writer?.Dispose();
_indexDir?.Dispose();

base.TearDown();

System.IO.Directory.Delete(_tempBasePath!, true);
}

[Params(1, 15, 30, 100)]
public int ThreadCount { get; set; }

[Benchmark(Baseline = true)]
public async Task SimpleMultiThreadLoop()
{
var tasks = new List<Task>();

for (var i = 0; i < ThreadCount; i++)
{
tasks.Add(new Task(() => Debug.Write(i)));
}

foreach (var task in tasks)
{
task.Start();
}

await Task.WhenAll(tasks);
}

[Benchmark]
public async Task TestAcquireThreadContention()
{
var tasks = new List<Task>();

for (var i = 0; i < ThreadCount; i++)
{
tasks.Add(new Task(() =>
{
var searcher = _searcherManager!.Acquire();
try
{
if (searcher.IndexReader.RefCount > (ThreadCount + 1))
{
Console.WriteLine(searcher.IndexReader.RefCount);
}
}
finally
{
_searcherManager.Release(searcher);
}
}));
}

foreach (var task in tasks)
{
task.Start();
}

await Task.WhenAll(tasks);
}

#if RELEASE
protected override ILoggerFactory CreateLoggerFactory()
=> Microsoft.Extensions.Logging.LoggerFactory.Create(builder => builder.AddConsole().SetMinimumLevel(LogLevel.Information));
#endif
private void InitializeAndIndexItems(
string tempBasePath,
Analyzer analyzer,
out DirectoryInfo indexDir)
{
var tempPath = Path.Combine(tempBasePath, Guid.NewGuid().ToString());
System.IO.Directory.CreateDirectory(tempPath);
indexDir = new DirectoryInfo(tempPath);
using var luceneDirectory = FSDirectory.Open(indexDir);
using var luceneTaxonomyDir = FSDirectory.Open(Path.Combine(tempPath, "Taxonomy"));
using var indexer = GetTestIndex(luceneDirectory, luceneTaxonomyDir, analyzer);

var random = new Random();
var valueSets = new List<ValueSet>();

for (var i = 0; i < 1000; i++)
{
valueSets.Add(ValueSet.FromObject(Guid.NewGuid().ToString(), "content",
new
{
nodeName = "location " + i,
bodyText = Enumerable.Range(0, random.Next(10, 100)).Select(x => Guid.NewGuid().ToString())
}));
}

indexer.IndexItems(valueSets);
}
}
}
Loading
Loading