From aa62f25edc0675e8754c159635ae8c3e5ddfd1ec Mon Sep 17 00:00:00 2001 From: Shannon Deminick Date: Fri, 5 May 2023 04:15:58 +1000 Subject: [PATCH 01/12] Update README.md --- README.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index f46de364b..29734a2f1 100644 --- a/README.md +++ b/README.md @@ -62,16 +62,18 @@ Information and downloads for Examine releases ## Documentation +The [documentation site is here](https://shazwazza.github.io/Examine/index.html) + _**Tip**: There are many unit tests in the source code that can be used as Examples of how to do things. There is also a test web project that has plenty of examples of how to configure indexes and search them._ -* [Indexing](https://shazwazza.github.io/Examine/indexing) -* [Configuration](https://shazwazza.github.io/Examine/configuration) -* [Searching](https://shazwazza.github.io/Examine/searching) -* [Sorting](https://shazwazza.github.io/Examine/sorting) +* [Indexing](https://shazwazza.github.io/Examine/articles/indexing.html) +* [Configuration](https://shazwazza.github.io/Examine/articles/configuration.html) +* [Searching](https://shazwazza.github.io/Examine/articles/searching.html) +* [Sorting](https://shazwazza.github.io/Examine/articles/sorting.html) ## Copyright & Licence -© 2021 by Shannon Deminick +© 2023 by Shannon Deminick This is free software and is licensed under the [Microsoft Public License (Ms-PL)](http://opensource.org/licenses/MS-PL) From f87c68a227b2a922330cd3b105ca32ae106774db Mon Sep 17 00:00:00 2001 From: Nikolaj Brask-Nielsen Date: Thu, 13 Oct 2022 14:33:37 +0200 Subject: [PATCH 02/12] docs: Added some more information on Indexing --- docs/indexing.md | 113 +++++++++++++++++++- src/Examine.Lucene/Providers/LuceneIndex.cs | 3 + 2 files changed, 115 insertions(+), 1 deletion(-) diff --git a/docs/indexing.md b/docs/indexing.md index 2b71bae64..d9c7c9f76 100644 --- a/docs/indexing.md +++ b/docs/indexing.md @@ -142,7 +142,9 @@ Data is easily deleted from the index by the unique identifier you provided in y
- + + + @@ -189,6 +191,115 @@ If using Examine with the default Lucene implementation then the `IIndex` implem You can use this event to entirely customize how the data is stored in the Lucene index, including adding custom boosting profiles, changing the `Document`'s field values or types, etc... + +
+ +### IIndex.IndexOperationComplete + +This event is part of the base interface `IIndex` so it is available to use on any implementation of an Examine index. This can be useful to know when an indexing operation is completed. + +Example of how to listen the event: + +```csharp +if (!_examineManager.TryGetIndex(indexName, out var index)) +{ + throw new ArgumentException($"Index '{indexName}' not found"); +} + +index.IndexOperationComplete += IndexOperationComplete; + +private void IndexOperationComplete(object sender, IndexOperationEventArgs e) +{ + // Index operation completed +} +``` + +### BaseIndexProvider.TransformingIndexValues + +Most Examine index implementations will inherit from `BaseIndexProvider`. This event allows for customizing the `ValueSet` before it is passed to the indexer to be indexed. You can use this event to add additional field values or modify existing field values. + +Example of how to listen the event: + +```csharp +if (!_examineManager.TryGetIndex(indexName, out var index)) +{ + throw new ArgumentException($"Index '{indexName}' not found"); +} + +index.TransformingIndexValues += TransformingIndexValues; + +private void TransformingIndexValues(object sender, IndexingItemEventArgs e) +{ + // Customize the ValueSet +} +``` + +### BaseIndexProvider.IndexingError + +Most Examine index implementations will inherit from `BaseIndexProvider`. This event can be used for reacting to when an error occurs during index. For example, you could add an event handler for this event to facilitate error logging. + +Example of how to listen the event: + +```csharp +if (!_examineManager.TryGetIndex(indexName, out var index)) +{ + throw new ArgumentException($"Index '{indexName}' not found"); +} + +index.IndexingError += IndexingError; + +private void IndexingError(object sender, IndexingErrorEventArgs e) +{ + // An indexing error occored +} +``` + +### LuceneIndex.DocumentWriting + +If using Examine with the default Lucene implementation then the `IIndex` implementation will be `LuceneIndex`. This event provides access to the Lucene `Document` object before it gets added to the Lucene Index. + +You can use this event to entirely customize how the data is stored in the Lucene index, including adding custom boosting profiles, changing the `Document`'s field values or types, etc... + +Example of how to listen the event: + +```csharp +if (!_examineManager.TryGetIndex(indexName, out var index)) +{ + throw new ArgumentException($"Index '{indexName}' not found"); +} + +if (index is LuceneIndex luceneIndex){ + luceneIndex.DocumentWriting += DocumentWriting; +} + +private void DocumentWriting(object sender, DocumentWritingEventArgs e) +{ + // Customize how the data is stored in the Lucene index +} +``` + +### LuceneIndex.IndexCommitted + +If using Examine with the default Lucene implementation then the `IIndex` implementation will be `LuceneIndex`. This event is triggered when the index is commited. For example when clearing the index this event is run once when commiting. When rebuilding the event will be run once the rebuild commits a clearing of the index and when it's commiting the rebuilt index. + +Example of how to listen the event: + +```csharp +if (!_examineManager.TryGetIndex(indexName, out var index)) +{ + throw new ArgumentException($"Index '{indexName}' not found"); +} + +if (index is LuceneIndex luceneIndex){ + luceneIndex.IndexCommitted += IndexCommited; +} + +private void IndexCommited(object sender, EventArgs e) +{ + // Triggered when the index is commited +} +``` +
\ No newline at end of file diff --git a/src/Examine.Lucene/Providers/LuceneIndex.cs b/src/Examine.Lucene/Providers/LuceneIndex.cs index 6ac9124eb..66958bf20 100644 --- a/src/Examine.Lucene/Providers/LuceneIndex.cs +++ b/src/Examine.Lucene/Providers/LuceneIndex.cs @@ -183,6 +183,9 @@ internal LuceneIndex( /// public event EventHandler DocumentWriting; + /// + /// Occors when the index is commited + /// public event EventHandler IndexCommitted; #endregion From c0c264e02d94dc6147c9a9645ff13d68540276a5 Mon Sep 17 00:00:00 2001 From: Nikolaj Brask-Nielsen Date: Wed, 30 Nov 2022 09:43:29 +0100 Subject: [PATCH 03/12] docs: Events on IIndex --- docs/indexing.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/indexing.md b/docs/indexing.md index d9c7c9f76..a40775668 100644 --- a/docs/indexing.md +++ b/docs/indexing.md @@ -214,9 +214,9 @@ private void IndexOperationComplete(object sender, IndexOperationEventArgs e) } ``` -### BaseIndexProvider.TransformingIndexValues +### IIndex.TransformingIndexValues -Most Examine index implementations will inherit from `BaseIndexProvider`. This event allows for customizing the `ValueSet` before it is passed to the indexer to be indexed. You can use this event to add additional field values or modify existing field values. +This event is part of the base interface `IIndex` so it is available to use on any implementation of an Examine index. This event allows for customizing the `ValueSet` before it is passed to the indexer to be indexed. You can use this event to add additional field values or modify existing field values. Example of how to listen the event: @@ -234,9 +234,9 @@ private void TransformingIndexValues(object sender, IndexingItemEventArgs e) } ``` -### BaseIndexProvider.IndexingError +### IIndex.IndexingError -Most Examine index implementations will inherit from `BaseIndexProvider`. This event can be used for reacting to when an error occurs during index. For example, you could add an event handler for this event to facilitate error logging. +This event is part of the base interface `IIndex` so it is available to use on any implementation of an Examine index. This event can be used for reacting to when an error occurs during index. For example, you could add an event handler for this event to facilitate error logging. Example of how to listen the event: From d8ea46369b196aa32a5a98c4f0e9e1b182a8c9a6 Mon Sep 17 00:00:00 2001 From: Nikolaj Brask-Nielsen Date: Sun, 18 Jun 2023 13:41:34 +0200 Subject: [PATCH 04/12] docs: Migrate the changes to the new docfx system --- docs/indexing.md | 10 ++++ docs/v2/articles/indexing.md | 102 +++++++++++++++++++++++++++++++++-- 2 files changed, 109 insertions(+), 3 deletions(-) diff --git a/docs/indexing.md b/docs/indexing.md index a40775668..ce669b11d 100644 --- a/docs/indexing.md +++ b/docs/indexing.md @@ -207,7 +207,9 @@ if (!_examineManager.TryGetIndex(indexName, out var index)) } index.IndexOperationComplete += IndexOperationComplete; +``` +```csharp private void IndexOperationComplete(object sender, IndexOperationEventArgs e) { // Index operation completed @@ -227,7 +229,9 @@ if (!_examineManager.TryGetIndex(indexName, out var index)) } index.TransformingIndexValues += TransformingIndexValues; +``` +```csharp private void TransformingIndexValues(object sender, IndexingItemEventArgs e) { // Customize the ValueSet @@ -247,7 +251,9 @@ if (!_examineManager.TryGetIndex(indexName, out var index)) } index.IndexingError += IndexingError; +``` +```csharp private void IndexingError(object sender, IndexingErrorEventArgs e) { // An indexing error occored @@ -271,7 +277,9 @@ if (!_examineManager.TryGetIndex(indexName, out var index)) if (index is LuceneIndex luceneIndex){ luceneIndex.DocumentWriting += DocumentWriting; } +``` +```csharp private void DocumentWriting(object sender, DocumentWritingEventArgs e) { // Customize how the data is stored in the Lucene index @@ -293,7 +301,9 @@ if (!_examineManager.TryGetIndex(indexName, out var index)) if (index is LuceneIndex luceneIndex){ luceneIndex.IndexCommitted += IndexCommited; } +``` +```csharp private void IndexCommited(object sender, EventArgs e) { // Triggered when the index is commited diff --git a/docs/v2/articles/indexing.md b/docs/v2/articles/indexing.md index 2358cb8b8..946328376 100644 --- a/docs/v2/articles/indexing.md +++ b/docs/v2/articles/indexing.md @@ -144,16 +144,112 @@ Data is easily deleted from the index by the unique identifier you provided in y This event is part of the base interface [`IIndex`](xref:Examine.IIndex) so it is available to use on any implementation of an Examine index. This can be useful to know when an indexing operation is completed. +Example of how to listen the event: + +```csharp +if (!_examineManager.TryGetIndex(indexName, out var index)) +{ + throw new ArgumentException($"Index '{indexName}' not found"); +} + +index.IndexOperationComplete += IndexOperationComplete; +``` + +```csharp +private void IndexOperationComplete(object sender, IndexOperationEventArgs e) +{ + // Index operation completed +} +``` + #### [IIndex.TransformingIndexValues](xref:Examine.IIndex#Examine_IIndex_TransformingIndexValues) -This event allows for customizing the [`ValueSet`](xref:Examine.ValueSet) before it is passed to the indexer to be indexed. You can use this event to add additional field values or modify existing field values. +This event is part of the base interface [`IIndex`](xref:Examine.IIndex) so it is available to use on any implementation of an Examine index. This event allows for customizing the [`ValueSet`](xref:Examine.ValueSet) before it is passed to the indexer to be indexed. You can use this event to add additional field values or modify existing field values. + +Example of how to listen the event: + +```csharp +if (!_examineManager.TryGetIndex(indexName, out var index)) +{ + throw new ArgumentException($"Index '{indexName}' not found"); +} + +index.TransformingIndexValues += TransformingIndexValues; +``` + +```csharp +private void TransformingIndexValues(object sender, IndexingItemEventArgs e) +{ + // Customize the ValueSet +} +``` #### [IIndex.IndexingError](xref:Examine.IIndex#Examine_IIndex_IndexingError) -This event can be used for reacting to when an error occurs during index. For example, you could add an event handler for this event to facilitate error logging. +This event is part of the base interface [`IIndex`](xref:Examine.IIndex) so it is available to use on any implementation of an Examine index. This event can be used for reacting to when an error occurs during index. For example, you could add an event handler for this event to facilitate error logging. + +Example of how to listen the event: + +```csharp +if (!_examineManager.TryGetIndex(indexName, out var index)) +{ + throw new ArgumentException($"Index '{indexName}' not found"); +} + +index.IndexingError += IndexingError; +``` + +```csharp +private void IndexingError(object sender, IndexingErrorEventArgs e) +{ + // An indexing error occored +} +``` #### [LuceneIndex.DocumentWriting](xref:Examine.Lucene.Providers.LuceneIndex#Examine_Lucene_Providers_LuceneIndex_DocumentWriting) If using Examine with the default Lucene implementation then the [`IIndex`](xref:Examine.IIndex) implementation will be [`LuceneIndex`](xref:Examine.Lucene.Providers.LuceneIndex). This event provides access to the Lucene [`Document`](https://lucenenet.apache.org/docs/4.8.0-beta00016/api/core/Lucene.Net.Documents.Document.html) object before it gets added to the Lucene Index. -You can use this event to entirely customize how the data is stored in the Lucene index, including adding custom boosting profiles, changing the [`Document`](https://lucenenet.apache.org/docs/4.8.0-beta00016/api/core/Lucene.Net.Documents.Document.html)'s field values or types, etc... \ No newline at end of file +You can use this event to entirely customize how the data is stored in the Lucene index, including adding custom boosting profiles, changing the [`Document`](https://lucenenet.apache.org/docs/4.8.0-beta00016/api/core/Lucene.Net.Documents.Document.html)'s field values or types, etc... + +Example of how to listen the event: + +```csharp +if (!_examineManager.TryGetIndex(indexName, out var index)) +{ + throw new ArgumentException($"Index '{indexName}' not found"); +} + +if (index is LuceneIndex luceneIndex){ + luceneIndex.DocumentWriting += DocumentWriting; +} +``` + +```csharp +private void DocumentWriting(object sender, DocumentWritingEventArgs e) +{ + // Customize how the data is stored in the Lucene index +} +``` + +### [LuceneIndex.IndexCommitted](xref:Examine.Lucene.Providers.LuceneIndex#Examine_Lucene_Providers_LuceneIndex_IndexCommitted) +If using Examine with the default Lucene implementation then the [`IIndex`](xref:Examine.IIndex) implementation will be [`LuceneIndex`](xref:Examine.Lucene.Providers.LuceneIndex). This event is triggered when the index is commited. For example when clearing the index this event is run once when commiting. When rebuilding the event will be run once the rebuild commits a clearing of the index and when it's commiting the rebuilt index. +Example of how to listen the event: + +```csharp +if (!_examineManager.TryGetIndex(indexName, out var index)) +{ + throw new ArgumentException($"Index '{indexName}' not found"); +} + +if (index is LuceneIndex luceneIndex){ + luceneIndex.IndexCommitted += IndexCommited; +} +``` + +```csharp +private void IndexCommited(object sender, EventArgs e) +{ + // Triggered when the index is commited +} +``` \ No newline at end of file From fa3af08bc0333a8960d2a6088567cefbbc71ca20 Mon Sep 17 00:00:00 2001 From: Nikolaj Brask-Nielsen Date: Wed, 30 Nov 2022 10:13:02 +0100 Subject: [PATCH 05/12] test: Add .NET 7 target to tests --- .github/workflows/build.yml | 14 ++++++-------- src/Examine.Test/Examine.Test.csproj | 2 +- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5e17d1166..bfea60730 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,15 +35,13 @@ jobs: echo ("Copyright=" + $Copyright) >> $Env:GITHUB_ENV shell: pwsh - - name: Setup .NET Core SDK 5.0.x - uses: actions/setup-dotnet@v1.7.2 + - name: Setup dotnet + uses: actions/setup-dotnet@v3 with: - dotnet-version: 5.0.x - - - name: Setup .NET SDK 6.0.x - uses: actions/setup-dotnet@v2 - with: - dotnet-version: 6.0.x + dotnet-version: | + 5.0.x + 6.0.x + 7.0.x - name: Install GitVersion uses: gittools/actions/gitversion/setup@v0.9.9 diff --git a/src/Examine.Test/Examine.Test.csproj b/src/Examine.Test/Examine.Test.csproj index dfb880a48..39b6d109c 100644 --- a/src/Examine.Test/Examine.Test.csproj +++ b/src/Examine.Test/Examine.Test.csproj @@ -11,7 +11,7 @@ - net6.0; + net7.0;net6.0; false false From 18cacaa32c2624ac9faa16b195c0341058331485 Mon Sep 17 00:00:00 2001 From: Shannon Deminick Date: Sat, 22 Jul 2023 04:55:40 +1000 Subject: [PATCH 06/12] Update build.yml Try to get build to run on PRs --- .github/workflows/build.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bfea60730..01ddaba25 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,7 +11,9 @@ on: - 'v*' pull_request: branches: - - '*' + - 'master' + - 'dev' + - 'release/*' jobs: build: @@ -88,6 +90,3 @@ jobs: with: name: examine-nuget-${{ env.GitVersion_SemVer }} path: ${{ github.workspace }}/_NugetOutput/*.* - - - name: Publish to GitHub Packages - run: dotnet nuget push "${{ github.workspace }}/_NugetOutput/*.nupkg" --api-key ${{ secrets.GITHUB_TOKEN }} --source "https://nuget.pkg.github.com/shazwazza/index.json" \ No newline at end of file From 4ddf9695cffd633cd4abfab260f02b2831d509e5 Mon Sep 17 00:00:00 2001 From: Chad Currie Date: Sat, 29 Jul 2023 21:18:16 +1200 Subject: [PATCH 07/12] Microsoft.CodeAnalysis.PublicApiAnalyzers added. 3.x public api shipped --- src/Examine.Core/EmptySearchResults.cs | 6 +- src/Examine.Core/Examine.Core.csproj | 4 + src/Examine.Core/PublicAPI.Shipped.txt | 311 +++++++++++++ src/Examine.Core/PublicAPI.Unshipped.txt | 0 src/Examine.Host/Examine.csproj | 4 + src/Examine.Host/PublicAPI.Shipped.txt | 15 + src/Examine.Host/PublicAPI.Unshipped.txt | 0 src/Examine.Lucene/Examine.Lucene.csproj | 4 + .../Indexing/IndexFieldRangeValueType.cs | 4 + .../Providers/BaseLuceneSearcher.cs | 4 +- .../Providers/MultiIndexSearcher.cs | 4 + src/Examine.Lucene/PublicAPI.Shipped.txt | 439 ++++++++++++++++++ src/Examine.Lucene/PublicAPI.Unshipped.txt | 0 13 files changed, 793 insertions(+), 2 deletions(-) create mode 100644 src/Examine.Core/PublicAPI.Shipped.txt create mode 100644 src/Examine.Core/PublicAPI.Unshipped.txt create mode 100644 src/Examine.Host/PublicAPI.Shipped.txt create mode 100644 src/Examine.Host/PublicAPI.Unshipped.txt create mode 100644 src/Examine.Lucene/PublicAPI.Shipped.txt create mode 100644 src/Examine.Lucene/PublicAPI.Unshipped.txt diff --git a/src/Examine.Core/EmptySearchResults.cs b/src/Examine.Core/EmptySearchResults.cs index 84c68e399..18dcbe216 100644 --- a/src/Examine.Core/EmptySearchResults.cs +++ b/src/Examine.Core/EmptySearchResults.cs @@ -25,12 +25,16 @@ IEnumerator IEnumerable.GetEnumerator() public long TotalItemCount => 0; +#pragma warning disable IDE0060 // Remove unused parameter public IEnumerable Skip(int skip) - { +#pragma warning restore IDE0060 // Remove unused parameter + { return Enumerable.Empty(); } +#pragma warning disable IDE0060 // Remove unused parameter public IEnumerable SkipTake(int skip, int? take = null) +#pragma warning restore IDE0060 // Remove unused parameter { return Enumerable.Empty(); } diff --git a/src/Examine.Core/Examine.Core.csproj b/src/Examine.Core/Examine.Core.csproj index d25704669..9ca9e7ac8 100644 --- a/src/Examine.Core/Examine.Core.csproj +++ b/src/Examine.Core/Examine.Core.csproj @@ -12,6 +12,10 @@ + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/src/Examine.Core/PublicAPI.Shipped.txt b/src/Examine.Core/PublicAPI.Shipped.txt new file mode 100644 index 000000000..08049caec --- /dev/null +++ b/src/Examine.Core/PublicAPI.Shipped.txt @@ -0,0 +1,311 @@ +abstract Examine.BaseIndexProvider.CreateIndex() -> void +abstract Examine.BaseIndexProvider.IndexExists() -> bool +abstract Examine.BaseIndexProvider.PerformDeleteFromIndex(System.Collections.Generic.IEnumerable itemIds, System.Action onComplete) -> void +abstract Examine.BaseIndexProvider.PerformIndexItems(System.Collections.Generic.IEnumerable values, System.Action onComplete) -> void +abstract Examine.BaseIndexProvider.Searcher.get -> Examine.ISearcher +abstract Examine.BaseSearchProvider.CreateQuery(string category = null, Examine.Search.BooleanOperation defaultOperation = Examine.Search.BooleanOperation.And) -> Examine.Search.IQuery +abstract Examine.BaseSearchProvider.Search(string searchText, Examine.Search.QueryOptions options = null) -> Examine.ISearchResults +abstract Examine.DisposableObjectSlim.DisposeResources() -> void +const Examine.ExamineFieldNames.CategoryFieldName = "__IndexType" -> string +const Examine.ExamineFieldNames.ItemIdFieldName = "__NodeId" -> string +const Examine.ExamineFieldNames.ItemTypeFieldName = "__NodeTypeAlias" -> string +const Examine.ExamineFieldNames.SortedFieldNamePrefix = "__Sort_" -> string +const Examine.ExamineFieldNames.SpecialFieldPrefix = "__" -> string +const Examine.FieldDefinitionTypes.DateDay = "date.day" -> string +const Examine.FieldDefinitionTypes.DateHour = "date.hour" -> string +const Examine.FieldDefinitionTypes.DateMinute = "date.minute" -> string +const Examine.FieldDefinitionTypes.DateMonth = "date.month" -> string +const Examine.FieldDefinitionTypes.DateTime = "datetime" -> string +const Examine.FieldDefinitionTypes.DateYear = "date.year" -> string +const Examine.FieldDefinitionTypes.Double = "double" -> string +const Examine.FieldDefinitionTypes.EmailAddress = "emailaddress" -> string +const Examine.FieldDefinitionTypes.Float = "float" -> string +const Examine.FieldDefinitionTypes.FullText = "fulltext" -> string +const Examine.FieldDefinitionTypes.FullTextSortable = "fulltextsortable" -> string +const Examine.FieldDefinitionTypes.Integer = "int" -> string +const Examine.FieldDefinitionTypes.InvariantCultureIgnoreCase = "invariantcultureignorecase" -> string +const Examine.FieldDefinitionTypes.Long = "long" -> string +const Examine.FieldDefinitionTypes.Raw = "raw" -> string +const Examine.Search.QueryOptions.DefaultMaxResults = 500 -> int +Examine.BaseIndexProvider +Examine.BaseIndexProvider.BaseIndexProvider(Microsoft.Extensions.Logging.ILoggerFactory loggerFactory, string name, Microsoft.Extensions.Options.IOptionsMonitor indexOptions) -> void +Examine.BaseIndexProvider.DeleteFromIndex(System.Collections.Generic.IEnumerable itemIds) -> void +Examine.BaseIndexProvider.FieldDefinitions.get -> Examine.ReadOnlyFieldDefinitionCollection +Examine.BaseIndexProvider.IndexingError -> System.EventHandler +Examine.BaseIndexProvider.IndexItems(System.Collections.Generic.IEnumerable values) -> void +Examine.BaseIndexProvider.IndexOperationComplete -> System.EventHandler +Examine.BaseIndexProvider.LoggerFactory.get -> Microsoft.Extensions.Logging.ILoggerFactory +Examine.BaseIndexProvider.OnIndexOperationComplete(Examine.IndexOperationEventArgs e) -> void +Examine.BaseIndexProvider.TransformingIndexValues -> System.EventHandler +Examine.BaseIndexProvider.ValidateItem(Examine.ValueSet item) -> Examine.ValueSetValidationResult +Examine.BaseIndexProvider.ValueSetValidator.get -> Examine.IValueSetValidator +Examine.BaseSearchProvider +Examine.BaseSearchProvider.BaseSearchProvider(string name) -> void +Examine.BaseSearchProvider.Name.get -> string +Examine.DisposableObjectSlim +Examine.DisposableObjectSlim.DisposableObjectSlim() -> void +Examine.DisposableObjectSlim.Dispose() -> void +Examine.DisposableObjectSlim.Disposed.get -> bool +Examine.EmptySearchResults +Examine.EmptySearchResults.GetEnumerator() -> System.Collections.Generic.IEnumerator +Examine.EmptySearchResults.Skip(int skip) -> System.Collections.Generic.IEnumerable +Examine.EmptySearchResults.SkipTake(int skip, int? take = null) -> System.Collections.Generic.IEnumerable +Examine.EmptySearchResults.TotalItemCount.get -> long +Examine.ExamineExtensions +Examine.ExamineFieldNames +Examine.ExamineManager +Examine.ExamineManager.Dispose() -> void +Examine.ExamineManager.ExamineManager(System.Collections.Generic.IEnumerable indexes, System.Collections.Generic.IEnumerable searchers) -> void +Examine.ExamineManager.Indexes.get -> System.Collections.Generic.IEnumerable +Examine.ExamineManager.RegisteredSearchers.get -> System.Collections.Generic.IEnumerable +Examine.ExamineManager.TryGetIndex(string indexName, out Examine.IIndex index) -> bool +Examine.ExamineManager.TryGetSearcher(string searcherName, out Examine.ISearcher searcher) -> bool +Examine.FieldDefinition +Examine.FieldDefinition.Equals(Examine.FieldDefinition other) -> bool +Examine.FieldDefinition.FieldDefinition() -> void +Examine.FieldDefinition.FieldDefinition(string name, string type) -> void +Examine.FieldDefinition.Name.get -> string +Examine.FieldDefinition.Type.get -> string +Examine.FieldDefinitionCollection +Examine.FieldDefinitionCollection.AddOrUpdate(Examine.FieldDefinition definition) -> void +Examine.FieldDefinitionCollection.FieldDefinitionCollection() -> void +Examine.FieldDefinitionCollection.FieldDefinitionCollection(params Examine.FieldDefinition[] definitions) -> void +Examine.FieldDefinitionCollection.GetOrAdd(string fieldName, System.Func add) -> Examine.FieldDefinition +Examine.FieldDefinitionCollection.TryAdd(Examine.FieldDefinition definition) -> bool +Examine.FieldDefinitionTypes +Examine.IExamineManager +Examine.IExamineManager.Dispose() -> void +Examine.IExamineManager.Indexes.get -> System.Collections.Generic.IEnumerable +Examine.IExamineManager.RegisteredSearchers.get -> System.Collections.Generic.IEnumerable +Examine.IExamineManager.TryGetIndex(string indexName, out Examine.IIndex index) -> bool +Examine.IExamineManager.TryGetSearcher(string searcherName, out Examine.ISearcher searcher) -> bool +Examine.IIndex +Examine.IIndex.CreateIndex() -> void +Examine.IIndex.DeleteFromIndex(System.Collections.Generic.IEnumerable itemIds) -> void +Examine.IIndex.FieldDefinitions.get -> Examine.ReadOnlyFieldDefinitionCollection +Examine.IIndex.IndexExists() -> bool +Examine.IIndex.IndexingError -> System.EventHandler +Examine.IIndex.IndexItems(System.Collections.Generic.IEnumerable values) -> void +Examine.IIndex.IndexOperationComplete -> System.EventHandler +Examine.IIndex.Name.get -> string +Examine.IIndex.Searcher.get -> Examine.ISearcher +Examine.IIndex.TransformingIndexValues -> System.EventHandler +Examine.IIndexStats +Examine.IIndexStats.GetDocumentCount() -> long +Examine.IIndexStats.GetFieldNames() -> System.Collections.Generic.IEnumerable +Examine.IndexingErrorEventArgs +Examine.IndexingErrorEventArgs.Exception.get -> System.Exception +Examine.IndexingErrorEventArgs.Index.get -> Examine.IIndex +Examine.IndexingErrorEventArgs.IndexingErrorEventArgs(Examine.IIndex index, string message, string itemId, System.Exception exception) -> void +Examine.IndexingErrorEventArgs.ItemId.get -> string +Examine.IndexingErrorEventArgs.Message.get -> string +Examine.IndexingItemEventArgs +Examine.IndexingItemEventArgs.Index.get -> Examine.IIndex +Examine.IndexingItemEventArgs.IndexingItemEventArgs(Examine.IIndex index, Examine.ValueSet valueSet) -> void +Examine.IndexingItemEventArgs.SetValues(System.Collections.Generic.IDictionary> values) -> void +Examine.IndexingItemEventArgs.ValueSet.get -> Examine.ValueSet +Examine.IndexOperation +Examine.IndexOperation.IndexOperation() -> void +Examine.IndexOperation.IndexOperation(Examine.ValueSet valueSet, Examine.IndexOperationType operation) -> void +Examine.IndexOperation.Operation.get -> Examine.IndexOperationType +Examine.IndexOperation.ValueSet.get -> Examine.ValueSet +Examine.IndexOperationEventArgs +Examine.IndexOperationEventArgs.Index.get -> Examine.IIndex +Examine.IndexOperationEventArgs.IndexOperationEventArgs(Examine.IIndex index, int itemsIndexed) -> void +Examine.IndexOperationEventArgs.ItemsIndexed.get -> int +Examine.IndexOperationType +Examine.IndexOperationType.Add = 0 -> Examine.IndexOperationType +Examine.IndexOperationType.Delete = 1 -> Examine.IndexOperationType +Examine.IndexOptions +Examine.IndexOptions.FieldDefinitions.get -> Examine.FieldDefinitionCollection +Examine.IndexOptions.FieldDefinitions.set -> void +Examine.IndexOptions.IndexOptions() -> void +Examine.IndexOptions.Validator.get -> Examine.IValueSetValidator +Examine.IndexOptions.Validator.set -> void +Examine.ISearcher +Examine.ISearcher.CreateQuery(string category = null, Examine.Search.BooleanOperation defaultOperation = Examine.Search.BooleanOperation.And) -> Examine.Search.IQuery +Examine.ISearcher.Name.get -> string +Examine.ISearcher.Search(string searchText, Examine.Search.QueryOptions options = null) -> Examine.ISearchResults +Examine.ISearchResult +Examine.ISearchResult.AllValues.get -> System.Collections.Generic.IReadOnlyDictionary> +Examine.ISearchResult.GetValues(string key) -> System.Collections.Generic.IEnumerable +Examine.ISearchResult.Id.get -> string +Examine.ISearchResult.Score.get -> float +Examine.ISearchResult.this[int resultIndex].get -> System.Collections.Generic.KeyValuePair +Examine.ISearchResult.this[string key].get -> string +Examine.ISearchResult.Values.get -> System.Collections.Generic.IReadOnlyDictionary +Examine.ISearchResults +Examine.ISearchResults.TotalItemCount.get -> long +Examine.IValueSetValidator +Examine.IValueSetValidator.Validate(Examine.ValueSet valueSet) -> Examine.ValueSetValidationResult +Examine.ObjectExtensions +Examine.OrderedDictionary +Examine.OrderedDictionary.Add(TKey key, TVal value) -> void +Examine.OrderedDictionary.ContainsKey(TKey key) -> bool +Examine.OrderedDictionary.GetItem(int index) -> TVal +Examine.OrderedDictionary.IndexOf(TKey key) -> int +Examine.OrderedDictionary.Keys.get -> System.Collections.Generic.ICollection +Examine.OrderedDictionary.OrderedDictionary() -> void +Examine.OrderedDictionary.OrderedDictionary(System.Collections.Generic.IEqualityComparer comparer) -> void +Examine.OrderedDictionary.TryGetValue(TKey key, out TVal value) -> bool +Examine.OrderedDictionary.Values.get -> System.Collections.Generic.ICollection +Examine.ReadOnlyFieldDefinitionCollection +Examine.ReadOnlyFieldDefinitionCollection.Count.get -> int +Examine.ReadOnlyFieldDefinitionCollection.Definitions.get -> System.Collections.Concurrent.ConcurrentDictionary +Examine.ReadOnlyFieldDefinitionCollection.GetEnumerator() -> System.Collections.Generic.IEnumerator +Examine.ReadOnlyFieldDefinitionCollection.ReadOnlyFieldDefinitionCollection() -> void +Examine.ReadOnlyFieldDefinitionCollection.ReadOnlyFieldDefinitionCollection(params Examine.FieldDefinition[] definitions) -> void +Examine.ReadOnlyFieldDefinitionCollection.ReadOnlyFieldDefinitionCollection(System.Collections.Generic.IEnumerable definitions) -> void +Examine.Search.BooleanOperation +Examine.Search.BooleanOperation.And = 0 -> Examine.Search.BooleanOperation +Examine.Search.BooleanOperation.Not = 2 -> Examine.Search.BooleanOperation +Examine.Search.BooleanOperation.Or = 1 -> Examine.Search.BooleanOperation +Examine.Search.Examineness +Examine.Search.Examineness.Boosted = 5 -> Examine.Search.Examineness +Examine.Search.Examineness.ComplexWildcard = 2 -> Examine.Search.Examineness +Examine.Search.Examineness.Escaped = 4 -> Examine.Search.Examineness +Examine.Search.Examineness.Explicit = 3 -> Examine.Search.Examineness +Examine.Search.Examineness.Fuzzy = 0 -> Examine.Search.Examineness +Examine.Search.Examineness.Proximity = 6 -> Examine.Search.Examineness +Examine.Search.Examineness.SimpleWildcard = 1 -> Examine.Search.Examineness +Examine.Search.ExamineValue +Examine.Search.ExamineValue.Examineness.get -> Examine.Search.Examineness +Examine.Search.ExamineValue.ExamineValue() -> void +Examine.Search.ExamineValue.ExamineValue(Examine.Search.Examineness vagueness, string value) -> void +Examine.Search.ExamineValue.ExamineValue(Examine.Search.Examineness vagueness, string value, float level) -> void +Examine.Search.ExamineValue.Level.get -> float +Examine.Search.ExamineValue.Value.get -> string +Examine.Search.IBooleanOperation +Examine.Search.IBooleanOperation.And() -> Examine.Search.IQuery +Examine.Search.IBooleanOperation.And(System.Func inner, Examine.Search.BooleanOperation defaultOp = Examine.Search.BooleanOperation.And) -> Examine.Search.IBooleanOperation +Examine.Search.IBooleanOperation.AndNot(System.Func inner, Examine.Search.BooleanOperation defaultOp = Examine.Search.BooleanOperation.And) -> Examine.Search.IBooleanOperation +Examine.Search.IBooleanOperation.Not() -> Examine.Search.IQuery +Examine.Search.IBooleanOperation.Or() -> Examine.Search.IQuery +Examine.Search.IBooleanOperation.Or(System.Func inner, Examine.Search.BooleanOperation defaultOp = Examine.Search.BooleanOperation.And) -> Examine.Search.IBooleanOperation +Examine.Search.IExamineValue +Examine.Search.IExamineValue.Examineness.get -> Examine.Search.Examineness +Examine.Search.IExamineValue.Level.get -> float +Examine.Search.IExamineValue.Value.get -> string +Examine.Search.INestedBooleanOperation +Examine.Search.INestedBooleanOperation.And() -> Examine.Search.INestedQuery +Examine.Search.INestedBooleanOperation.And(System.Func inner, Examine.Search.BooleanOperation defaultOp = Examine.Search.BooleanOperation.And) -> Examine.Search.INestedBooleanOperation +Examine.Search.INestedBooleanOperation.AndNot(System.Func inner, Examine.Search.BooleanOperation defaultOp = Examine.Search.BooleanOperation.And) -> Examine.Search.INestedBooleanOperation +Examine.Search.INestedBooleanOperation.Not() -> Examine.Search.INestedQuery +Examine.Search.INestedBooleanOperation.Or() -> Examine.Search.INestedQuery +Examine.Search.INestedBooleanOperation.Or(System.Func inner, Examine.Search.BooleanOperation defaultOp = Examine.Search.BooleanOperation.And) -> Examine.Search.INestedBooleanOperation +Examine.Search.INestedQuery +Examine.Search.INestedQuery.Field(string fieldName, Examine.Search.IExamineValue fieldValue) -> Examine.Search.INestedBooleanOperation +Examine.Search.INestedQuery.Field(string fieldName, string fieldValue) -> Examine.Search.INestedBooleanOperation +Examine.Search.INestedQuery.Field(string fieldName, T fieldValue) -> Examine.Search.INestedBooleanOperation +Examine.Search.INestedQuery.GroupedAnd(System.Collections.Generic.IEnumerable fields, params Examine.Search.IExamineValue[] query) -> Examine.Search.INestedBooleanOperation +Examine.Search.INestedQuery.GroupedAnd(System.Collections.Generic.IEnumerable fields, params string[] query) -> Examine.Search.INestedBooleanOperation +Examine.Search.INestedQuery.GroupedNot(System.Collections.Generic.IEnumerable fields, params Examine.Search.IExamineValue[] query) -> Examine.Search.INestedBooleanOperation +Examine.Search.INestedQuery.GroupedNot(System.Collections.Generic.IEnumerable fields, params string[] query) -> Examine.Search.INestedBooleanOperation +Examine.Search.INestedQuery.GroupedOr(System.Collections.Generic.IEnumerable fields, params Examine.Search.IExamineValue[] query) -> Examine.Search.INestedBooleanOperation +Examine.Search.INestedQuery.GroupedOr(System.Collections.Generic.IEnumerable fields, params string[] query) -> Examine.Search.INestedBooleanOperation +Examine.Search.INestedQuery.ManagedQuery(string query, string[] fields = null) -> Examine.Search.INestedBooleanOperation +Examine.Search.INestedQuery.RangeQuery(string[] fields, T? min, T? max, bool minInclusive = true, bool maxInclusive = true) -> Examine.Search.INestedBooleanOperation +Examine.Search.IOrdering +Examine.Search.IOrdering.OrderBy(params Examine.Search.SortableField[] fields) -> Examine.Search.IOrdering +Examine.Search.IOrdering.OrderByDescending(params Examine.Search.SortableField[] fields) -> Examine.Search.IOrdering +Examine.Search.IOrdering.SelectAllFields() -> Examine.Search.IOrdering +Examine.Search.IOrdering.SelectField(string fieldName) -> Examine.Search.IOrdering +Examine.Search.IOrdering.SelectFields(System.Collections.Generic.ISet fieldNames) -> Examine.Search.IOrdering +Examine.Search.IQuery +Examine.Search.IQuery.All() -> Examine.Search.IOrdering +Examine.Search.IQuery.Field(string fieldName, Examine.Search.IExamineValue fieldValue) -> Examine.Search.IBooleanOperation +Examine.Search.IQuery.Field(string fieldName, string fieldValue) -> Examine.Search.IBooleanOperation +Examine.Search.IQuery.Field(string fieldName, T fieldValue) -> Examine.Search.IBooleanOperation +Examine.Search.IQuery.Group(System.Func inner, Examine.Search.BooleanOperation defaultOp = Examine.Search.BooleanOperation.Or) -> Examine.Search.IBooleanOperation +Examine.Search.IQuery.GroupedAnd(System.Collections.Generic.IEnumerable fields, params Examine.Search.IExamineValue[] query) -> Examine.Search.IBooleanOperation +Examine.Search.IQuery.GroupedAnd(System.Collections.Generic.IEnumerable fields, params string[] query) -> Examine.Search.IBooleanOperation +Examine.Search.IQuery.GroupedNot(System.Collections.Generic.IEnumerable fields, params Examine.Search.IExamineValue[] query) -> Examine.Search.IBooleanOperation +Examine.Search.IQuery.GroupedNot(System.Collections.Generic.IEnumerable fields, params string[] query) -> Examine.Search.IBooleanOperation +Examine.Search.IQuery.GroupedOr(System.Collections.Generic.IEnumerable fields, params Examine.Search.IExamineValue[] query) -> Examine.Search.IBooleanOperation +Examine.Search.IQuery.GroupedOr(System.Collections.Generic.IEnumerable fields, params string[] query) -> Examine.Search.IBooleanOperation +Examine.Search.IQuery.Id(string id) -> Examine.Search.IBooleanOperation +Examine.Search.IQuery.ManagedQuery(string query, string[] fields = null) -> Examine.Search.IBooleanOperation +Examine.Search.IQuery.NativeQuery(string query) -> Examine.Search.IBooleanOperation +Examine.Search.IQuery.RangeQuery(string[] fields, T? min, T? max, bool minInclusive = true, bool maxInclusive = true) -> Examine.Search.IBooleanOperation +Examine.Search.IQueryExecutor +Examine.Search.IQueryExecutor.Execute(Examine.Search.QueryOptions options = null) -> Examine.ISearchResults +Examine.Search.QueryOptions +Examine.Search.QueryOptions.QueryOptions(int skip, int? take = null) -> void +Examine.Search.QueryOptions.Skip.get -> int +Examine.Search.QueryOptions.Take.get -> int +Examine.Search.SortableField +Examine.Search.SortableField.FieldName.get -> string +Examine.Search.SortableField.SortableField() -> void +Examine.Search.SortableField.SortableField(string fieldName) -> void +Examine.Search.SortableField.SortableField(string fieldName, Examine.Search.SortType sortType) -> void +Examine.Search.SortableField.SortType.get -> Examine.Search.SortType +Examine.Search.SortType +Examine.Search.SortType.DocumentOrder = 1 -> Examine.Search.SortType +Examine.Search.SortType.Double = 6 -> Examine.Search.SortType +Examine.Search.SortType.Float = 4 -> Examine.Search.SortType +Examine.Search.SortType.Int = 3 -> Examine.Search.SortType +Examine.Search.SortType.Long = 5 -> Examine.Search.SortType +Examine.Search.SortType.Score = 0 -> Examine.Search.SortType +Examine.Search.SortType.String = 2 -> Examine.Search.SortType +Examine.SearchExtensions +Examine.SearchResult +Examine.SearchResult.AllValues.get -> System.Collections.Generic.IReadOnlyDictionary> +Examine.SearchResult.GetValues(string key) -> System.Collections.Generic.IEnumerable +Examine.SearchResult.Id.get -> string +Examine.SearchResult.Score.get -> float +Examine.SearchResult.SearchResult(string id, float score, System.Func>> lazyFieldVals) -> void +Examine.SearchResult.this[int resultIndex].get -> System.Collections.Generic.KeyValuePair +Examine.SearchResult.this[string key].get -> string +Examine.SearchResult.Values.get -> System.Collections.Generic.IReadOnlyDictionary +Examine.ValueSet +Examine.ValueSet.Category.get -> string +Examine.ValueSet.Clone() -> Examine.ValueSet +Examine.ValueSet.GetValue(string key) -> object +Examine.ValueSet.GetValues(string key) -> System.Collections.Generic.IEnumerable +Examine.ValueSet.Id.get -> string +Examine.ValueSet.ItemType.get -> string +Examine.ValueSet.Values.get -> System.Collections.Generic.IReadOnlyDictionary> +Examine.ValueSet.ValueSet(string id) -> void +Examine.ValueSet.ValueSet(string id, string category, string itemType, System.Collections.Generic.IDictionary values) -> void +Examine.ValueSet.ValueSet(string id, string category, string itemType, System.Collections.Generic.IDictionary> values) -> void +Examine.ValueSet.ValueSet(string id, string category, System.Collections.Generic.IDictionary values) -> void +Examine.ValueSet.ValueSet(string id, string category, System.Collections.Generic.IDictionary> values) -> void +Examine.ValueSetValidationResult +Examine.ValueSetValidationResult.Status.get -> Examine.ValueSetValidationStatus +Examine.ValueSetValidationResult.ValueSet.get -> Examine.ValueSet +Examine.ValueSetValidationResult.ValueSetValidationResult() -> void +Examine.ValueSetValidationResult.ValueSetValidationResult(Examine.ValueSetValidationStatus status, Examine.ValueSet valueSet) -> void +Examine.ValueSetValidationStatus +Examine.ValueSetValidationStatus.Failed = 1 -> Examine.ValueSetValidationStatus +Examine.ValueSetValidationStatus.Filtered = 2 -> Examine.ValueSetValidationStatus +Examine.ValueSetValidationStatus.Valid = 0 -> Examine.ValueSetValidationStatus +override Examine.FieldDefinition.Equals(object obj) -> bool +override Examine.FieldDefinition.GetHashCode() -> int +override Examine.OrderedDictionary.GetKeyForItem(System.Collections.Generic.KeyValuePair item) -> TKey +override Examine.SearchResult.Equals(object obj) -> bool +override Examine.SearchResult.GetHashCode() -> int +static Examine.EmptySearchResults.Instance.get -> Examine.ISearchResults +static Examine.ExamineExtensions.DeleteFromIndex(this Examine.IIndex index, string itemId) -> void +static Examine.ExamineExtensions.GetIndex(this Examine.IExamineManager examineManager, string indexName) -> Examine.IIndex +static Examine.ExamineExtensions.GetNamedOptions(this Microsoft.Extensions.Options.IOptionsMonitor optionsMonitor, string name) -> T +static Examine.ExamineExtensions.IndexItem(this Examine.IIndex index, Examine.ValueSet node) -> void +static Examine.FieldDefinition.operator !=(Examine.FieldDefinition left, Examine.FieldDefinition right) -> bool +static Examine.FieldDefinition.operator ==(Examine.FieldDefinition left, Examine.FieldDefinition right) -> bool +static Examine.ObjectExtensions.ConvertObjectToDictionary(object o, params string[] ignoreProperties) -> System.Collections.Generic.IDictionary +static Examine.Search.QueryOptions.Default.get -> Examine.Search.QueryOptions +static Examine.Search.QueryOptions.SkipTake(int skip, int? take = null) -> Examine.Search.QueryOptions +static Examine.SearchExtensions.Boost(this string s, float boost) -> Examine.Search.IExamineValue +static Examine.SearchExtensions.Escape(this string s) -> Examine.Search.IExamineValue +static Examine.SearchExtensions.Fuzzy(this string s) -> Examine.Search.IExamineValue +static Examine.SearchExtensions.Fuzzy(this string s, float fuzzieness) -> Examine.Search.IExamineValue +static Examine.SearchExtensions.MultipleCharacterWildcard(this string s) -> Examine.Search.IExamineValue +static Examine.SearchExtensions.Proximity(this string s, int proximity) -> Examine.Search.IExamineValue +static Examine.SearchExtensions.SingleCharacterWildcard(this string s) -> Examine.Search.IExamineValue +static Examine.ValueSet.FromObject(string id, string category, object values) -> Examine.ValueSet +static Examine.ValueSet.FromObject(string id, string category, string itemType, object values) -> Examine.ValueSet +virtual Examine.BaseIndexProvider.Name.get -> string +virtual Examine.BaseIndexProvider.OnIndexingError(Examine.IndexingErrorEventArgs e) -> void +virtual Examine.BaseIndexProvider.OnTransformingIndexValues(Examine.IndexingItemEventArgs e) -> void +virtual Examine.ExamineManager.Dispose(bool disposing) -> void +virtual Examine.ExamineManager.Stop(bool immediate) -> void +virtual Examine.ReadOnlyFieldDefinitionCollection.TryGetValue(string fieldName, out Examine.FieldDefinition fieldDefinition) -> bool diff --git a/src/Examine.Core/PublicAPI.Unshipped.txt b/src/Examine.Core/PublicAPI.Unshipped.txt new file mode 100644 index 000000000..e69de29bb diff --git a/src/Examine.Host/Examine.csproj b/src/Examine.Host/Examine.csproj index 8d183149b..1109bfac0 100644 --- a/src/Examine.Host/Examine.csproj +++ b/src/Examine.Host/Examine.csproj @@ -11,6 +11,10 @@ + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/src/Examine.Host/PublicAPI.Shipped.txt b/src/Examine.Host/PublicAPI.Shipped.txt new file mode 100644 index 000000000..e2586438e --- /dev/null +++ b/src/Examine.Host/PublicAPI.Shipped.txt @@ -0,0 +1,15 @@ +Examine.AspNetCoreApplicationIdentifier +Examine.AspNetCoreApplicationIdentifier.AspNetCoreApplicationIdentifier(System.IServiceProvider services) -> void +Examine.AspNetCoreApplicationIdentifier.GetApplicationUniqueIdentifier() -> string +Examine.CurrentEnvironmentApplicationRoot +Examine.CurrentEnvironmentApplicationRoot.ApplicationRoot.get -> System.IO.DirectoryInfo +Examine.CurrentEnvironmentApplicationRoot.CurrentEnvironmentApplicationRoot() -> void +Examine.IApplicationRoot +Examine.IApplicationRoot.ApplicationRoot.get -> System.IO.DirectoryInfo +Examine.ServicesCollectionExtensions +static Examine.ServicesCollectionExtensions.AddExamine(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, System.IO.DirectoryInfo appRootDirectory = null) -> Microsoft.Extensions.DependencyInjection.IServiceCollection +static Examine.ServicesCollectionExtensions.AddExamineLuceneIndex(this Microsoft.Extensions.DependencyInjection.IServiceCollection serviceCollection, string name, Examine.FieldDefinitionCollection fieldDefinitions = null, Lucene.Net.Analysis.Analyzer analyzer = null, Examine.IValueSetValidator validator = null, System.Collections.Generic.IReadOnlyDictionary indexValueTypesFactory = null) -> Microsoft.Extensions.DependencyInjection.IServiceCollection +static Examine.ServicesCollectionExtensions.AddExamineLuceneIndex(this Microsoft.Extensions.DependencyInjection.IServiceCollection serviceCollection, string name, Examine.FieldDefinitionCollection fieldDefinitions = null, Lucene.Net.Analysis.Analyzer analyzer = null, Examine.IValueSetValidator validator = null, System.Collections.Generic.IReadOnlyDictionary indexValueTypesFactory = null) -> Microsoft.Extensions.DependencyInjection.IServiceCollection +static Examine.ServicesCollectionExtensions.AddExamineLuceneIndex(this Microsoft.Extensions.DependencyInjection.IServiceCollection serviceCollection, string name, Examine.FieldDefinitionCollection fieldDefinitions = null, Lucene.Net.Analysis.Analyzer analyzer = null, Examine.IValueSetValidator validator = null, System.Collections.Generic.IReadOnlyDictionary indexValueTypesFactory = null) -> Microsoft.Extensions.DependencyInjection.IServiceCollection +static Examine.ServicesCollectionExtensions.AddExamineLuceneMultiSearcher(this Microsoft.Extensions.DependencyInjection.IServiceCollection serviceCollection, string name, string[] indexNames, Lucene.Net.Analysis.Analyzer analyzer = null) -> Microsoft.Extensions.DependencyInjection.IServiceCollection +static Examine.ServicesCollectionExtensions.AddExamineSearcher(this Microsoft.Extensions.DependencyInjection.IServiceCollection serviceCollection, string name, System.Func> parameterFactory) -> Microsoft.Extensions.DependencyInjection.IServiceCollection diff --git a/src/Examine.Host/PublicAPI.Unshipped.txt b/src/Examine.Host/PublicAPI.Unshipped.txt new file mode 100644 index 000000000..e69de29bb diff --git a/src/Examine.Lucene/Examine.Lucene.csproj b/src/Examine.Lucene/Examine.Lucene.csproj index 29ef82ada..fae4e7b99 100644 --- a/src/Examine.Lucene/Examine.Lucene.csproj +++ b/src/Examine.Lucene/Examine.Lucene.csproj @@ -21,6 +21,10 @@ 4.8.0-beta00016 + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + 4.3.0 diff --git a/src/Examine.Lucene/Indexing/IndexFieldRangeValueType.cs b/src/Examine.Lucene/Indexing/IndexFieldRangeValueType.cs index a0b54b01e..254df7958 100644 --- a/src/Examine.Lucene/Indexing/IndexFieldRangeValueType.cs +++ b/src/Examine.Lucene/Indexing/IndexFieldRangeValueType.cs @@ -10,9 +10,13 @@ protected IndexFieldRangeValueType(string fieldName, ILoggerFactory logger, bool { } +#pragma warning disable RS0026 // Do not add multiple public overloads with optional parameters public abstract Query GetQuery(T? lower, T? upper, bool lowerInclusive = true, bool upperInclusive = true); +#pragma warning restore RS0026 // Do not add multiple public overloads with optional parameters +#pragma warning disable RS0026 // Do not add multiple public overloads with optional parameters public Query GetQuery(string lower, string upper, bool lowerInclusive = true, bool upperInclusive = true) +#pragma warning restore RS0026 // Do not add multiple public overloads with optional parameters { var lowerParsed = TryConvert(lower, out var lowerValue); var upperParsed = TryConvert(upper, out var upperValue); diff --git a/src/Examine.Lucene/Providers/BaseLuceneSearcher.cs b/src/Examine.Lucene/Providers/BaseLuceneSearcher.cs index 0c4a2c29c..a2e9a1756 100644 --- a/src/Examine.Lucene/Providers/BaseLuceneSearcher.cs +++ b/src/Examine.Lucene/Providers/BaseLuceneSearcher.cs @@ -32,7 +32,9 @@ protected BaseLuceneSearcher(string name, Analyzer analyzer) public abstract ISearchContext GetSearchContext(); /// - public override IQuery CreateQuery(string category = null, BooleanOperation defaultOperation = BooleanOperation.And) +#pragma warning disable RS0027 // API with optional parameter(s) should have the most parameters amongst its public overloads + public override IQuery CreateQuery(string category = null, BooleanOperation defaultOperation = BooleanOperation.And) +#pragma warning restore RS0027 // API with optional parameter(s) should have the most parameters amongst its public overloads => CreateQuery(category, defaultOperation, LuceneAnalyzer, new LuceneSearchOptions()); /// diff --git a/src/Examine.Lucene/Providers/MultiIndexSearcher.cs b/src/Examine.Lucene/Providers/MultiIndexSearcher.cs index 7fe503efe..ee499b152 100644 --- a/src/Examine.Lucene/Providers/MultiIndexSearcher.cs +++ b/src/Examine.Lucene/Providers/MultiIndexSearcher.cs @@ -21,7 +21,9 @@ public class MultiIndexSearcher : BaseLuceneSearcher /// /// /// +#pragma warning disable RS0026 // Do not add multiple public overloads with optional parameters public MultiIndexSearcher(string name, IEnumerable indexes, Analyzer analyzer = null) +#pragma warning restore RS0026 // Do not add multiple public overloads with optional parameters : base(name, analyzer ?? new StandardAnalyzer(LuceneInfo.CurrentVersion)) { _searchers = new Lazy>(() => indexes.Select(x => x.Searcher)); @@ -33,7 +35,9 @@ public MultiIndexSearcher(string name, IEnumerable indexes, Analyzer ana /// /// /// +#pragma warning disable RS0026 // Do not add multiple public overloads with optional parameters public MultiIndexSearcher(string name, Lazy> searchers, Analyzer analyzer = null) +#pragma warning restore RS0026 // Do not add multiple public overloads with optional parameters : base(name, analyzer ?? new StandardAnalyzer(LuceneInfo.CurrentVersion)) { _searchers = searchers; diff --git a/src/Examine.Lucene/PublicAPI.Shipped.txt b/src/Examine.Lucene/PublicAPI.Shipped.txt new file mode 100644 index 000000000..f6c62cc63 --- /dev/null +++ b/src/Examine.Lucene/PublicAPI.Shipped.txt @@ -0,0 +1,439 @@ +abstract Examine.Lucene.Directories.DirectoryFactoryBase.CreateDirectory(Examine.Lucene.Providers.LuceneIndex luceneIndex, bool forceUnlock) -> Lucene.Net.Store.Directory +abstract Examine.Lucene.Indexing.IndexFieldRangeValueType.GetQuery(T? lower, T? upper, bool lowerInclusive = true, bool upperInclusive = true) -> Lucene.Net.Search.Query +abstract Examine.Lucene.Indexing.IndexFieldValueTypeBase.AddSingleValue(Lucene.Net.Documents.Document doc, object value) -> void +abstract Examine.Lucene.Providers.BaseLuceneSearcher.GetSearchContext() -> Examine.Lucene.Search.ISearchContext +abstract Examine.Lucene.Search.LuceneBooleanOperationBase.And() -> Examine.Search.IQuery +abstract Examine.Lucene.Search.LuceneBooleanOperationBase.AndNested() -> Examine.Search.INestedQuery +abstract Examine.Lucene.Search.LuceneBooleanOperationBase.Execute(Examine.Search.QueryOptions options = null) -> Examine.ISearchResults +abstract Examine.Lucene.Search.LuceneBooleanOperationBase.Not() -> Examine.Search.IQuery +abstract Examine.Lucene.Search.LuceneBooleanOperationBase.NotNested() -> Examine.Search.INestedQuery +abstract Examine.Lucene.Search.LuceneBooleanOperationBase.Or() -> Examine.Search.IQuery +abstract Examine.Lucene.Search.LuceneBooleanOperationBase.OrderBy(params Examine.Search.SortableField[] fields) -> Examine.Search.IOrdering +abstract Examine.Lucene.Search.LuceneBooleanOperationBase.OrderByDescending(params Examine.Search.SortableField[] fields) -> Examine.Search.IOrdering +abstract Examine.Lucene.Search.LuceneBooleanOperationBase.OrNested() -> Examine.Search.INestedQuery +abstract Examine.Lucene.Search.LuceneBooleanOperationBase.SelectAllFields() -> Examine.Search.IOrdering +abstract Examine.Lucene.Search.LuceneBooleanOperationBase.SelectField(string fieldName) -> Examine.Search.IOrdering +abstract Examine.Lucene.Search.LuceneBooleanOperationBase.SelectFields(System.Collections.Generic.ISet fieldNames) -> Examine.Search.IOrdering +abstract Examine.Lucene.Search.LuceneSearchQueryBase.CreateOp() -> Examine.Lucene.Search.LuceneBooleanOperationBase +abstract Examine.Lucene.Search.LuceneSearchQueryBase.Field(string fieldName, T fieldValue) -> Examine.Search.IBooleanOperation +abstract Examine.Lucene.Search.LuceneSearchQueryBase.FieldNested(string fieldName, T fieldValue) -> Examine.Search.INestedBooleanOperation +abstract Examine.Lucene.Search.LuceneSearchQueryBase.ManagedQuery(string query, string[] fields = null) -> Examine.Search.IBooleanOperation +abstract Examine.Lucene.Search.LuceneSearchQueryBase.ManagedQueryNested(string query, string[] fields = null) -> Examine.Search.INestedBooleanOperation +abstract Examine.Lucene.Search.LuceneSearchQueryBase.RangeQuery(string[] fields, T? min, T? max, bool minInclusive = true, bool maxInclusive = true) -> Examine.Search.IBooleanOperation +abstract Examine.Lucene.Search.LuceneSearchQueryBase.RangeQueryNested(string[] fields, T? min, T? max, bool minInclusive = true, bool maxInclusive = true) -> Examine.Search.INestedBooleanOperation +Examine.Lucene.Analyzers.CultureInvariantStandardAnalyzer +Examine.Lucene.Analyzers.CultureInvariantStandardAnalyzer.CultureInvariantStandardAnalyzer() -> void +Examine.Lucene.Analyzers.CultureInvariantStandardAnalyzer.CultureInvariantStandardAnalyzer(Lucene.Net.Analysis.Util.CharArraySet stopWords) -> void +Examine.Lucene.Analyzers.CultureInvariantStandardAnalyzer.CultureInvariantStandardAnalyzer(Lucene.Net.Analysis.Util.CharArraySet stopWords, bool caseInsensitive, bool ignoreLanguageAccents) -> void +Examine.Lucene.Analyzers.CultureInvariantStandardAnalyzer.MaxTokenLength.get -> int +Examine.Lucene.Analyzers.CultureInvariantStandardAnalyzer.MaxTokenLength.set -> void +Examine.Lucene.Analyzers.CultureInvariantWhitespaceAnalyzer +Examine.Lucene.Analyzers.CultureInvariantWhitespaceAnalyzer.CultureInvariantWhitespaceAnalyzer() -> void +Examine.Lucene.Analyzers.CultureInvariantWhitespaceAnalyzer.CultureInvariantWhitespaceAnalyzer(bool caseInsensitive, bool ignoreLanguageAccents) -> void +Examine.Lucene.Analyzers.EmailAddressAnalyzer +Examine.Lucene.Analyzers.EmailAddressAnalyzer.EmailAddressAnalyzer() -> void +Examine.Lucene.Analyzers.PatternAnalyzer +Examine.Lucene.Analyzers.PatternAnalyzer.PatternAnalyzer(string format, int regexGroup, bool lowercase = false, Lucene.Net.Analysis.Util.CharArraySet stopWords = null) -> void +Examine.Lucene.DelegateFieldValueTypeFactory +Examine.Lucene.DelegateFieldValueTypeFactory.Create(string fieldName) -> Examine.Lucene.Indexing.IIndexFieldValueType +Examine.Lucene.DelegateFieldValueTypeFactory.DelegateFieldValueTypeFactory(System.Func factory) -> void +Examine.Lucene.Directories.DefaultLockFactory +Examine.Lucene.Directories.DefaultLockFactory.DefaultLockFactory() -> void +Examine.Lucene.Directories.DefaultLockFactory.GetLockFactory(System.IO.DirectoryInfo directory) -> Lucene.Net.Store.LockFactory +Examine.Lucene.Directories.DirectoryFactoryBase +Examine.Lucene.Directories.DirectoryFactoryBase.DirectoryFactoryBase() -> void +Examine.Lucene.Directories.DirectoryFactoryBase.Dispose() -> void +Examine.Lucene.Directories.FileSystemDirectoryFactory +Examine.Lucene.Directories.FileSystemDirectoryFactory.FileSystemDirectoryFactory(System.IO.DirectoryInfo baseDir, Examine.Lucene.Directories.ILockFactory lockFactory) -> void +Examine.Lucene.Directories.FileSystemDirectoryFactory.LockFactory.get -> Examine.Lucene.Directories.ILockFactory +Examine.Lucene.Directories.GenericDirectoryFactory +Examine.Lucene.Directories.GenericDirectoryFactory.GenericDirectoryFactory(System.Func factory) -> void +Examine.Lucene.Directories.IApplicationIdentifier +Examine.Lucene.Directories.IApplicationIdentifier.GetApplicationUniqueIdentifier() -> string +Examine.Lucene.Directories.IDirectoryFactory +Examine.Lucene.Directories.IDirectoryFactory.CreateDirectory(Examine.Lucene.Providers.LuceneIndex luceneIndex, bool forceUnlock) -> Lucene.Net.Store.Directory +Examine.Lucene.Directories.ILockFactory +Examine.Lucene.Directories.ILockFactory.GetLockFactory(System.IO.DirectoryInfo directory) -> Lucene.Net.Store.LockFactory +Examine.Lucene.Directories.MultiIndexLockFactory +Examine.Lucene.Directories.MultiIndexLockFactory.MultiIndexLockFactory(Lucene.Net.Store.Directory master, Lucene.Net.Store.Directory child) -> void +Examine.Lucene.Directories.MultiIndexLockFactory.MultiIndexLockFactory(Lucene.Net.Store.LockFactory master, Lucene.Net.Store.LockFactory child) -> void +Examine.Lucene.Directories.SyncedFileSystemDirectoryFactory +Examine.Lucene.Directories.SyncedFileSystemDirectoryFactory.SyncedFileSystemDirectoryFactory(System.IO.DirectoryInfo localDir, System.IO.DirectoryInfo mainDir, Examine.Lucene.Directories.ILockFactory lockFactory, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory) -> void +Examine.Lucene.Directories.TempEnvFileSystemDirectoryFactory +Examine.Lucene.Directories.TempEnvFileSystemDirectoryFactory.TempEnvFileSystemDirectoryFactory(Examine.Lucene.Directories.IApplicationIdentifier applicationIdentifier, Examine.Lucene.Directories.ILockFactory lockFactory) -> void +Examine.Lucene.DocumentWritingEventArgs +Examine.Lucene.DocumentWritingEventArgs.Document.get -> Lucene.Net.Documents.Document +Examine.Lucene.DocumentWritingEventArgs.DocumentWritingEventArgs(Examine.ValueSet valueSet, Lucene.Net.Documents.Document d) -> void +Examine.Lucene.DocumentWritingEventArgs.ValueSet.get -> Examine.ValueSet +Examine.Lucene.ExamineReplicator +Examine.Lucene.ExamineReplicator.Dispose() -> void +Examine.Lucene.ExamineReplicator.ExamineReplicator(Microsoft.Extensions.Logging.ILoggerFactory loggerFactory, Examine.Lucene.Providers.LuceneIndex sourceIndex, Lucene.Net.Store.Directory destinationDirectory, System.IO.DirectoryInfo tempStorage) -> void +Examine.Lucene.ExamineReplicator.ReplicateIndex() -> void +Examine.Lucene.ExamineReplicator.StartIndexReplicationOnSchedule(int milliseconds) -> void +Examine.Lucene.FieldValueTypeCollection +Examine.Lucene.FieldValueTypeCollection.Analyzer.get -> Lucene.Net.Analysis.Miscellaneous.PerFieldAnalyzerWrapper +Examine.Lucene.FieldValueTypeCollection.FieldValueTypeCollection(Lucene.Net.Analysis.Analyzer defaultAnalyzer, System.Collections.Generic.IReadOnlyDictionary valueTypeFactories, Examine.ReadOnlyFieldDefinitionCollection fieldDefinitionCollection) -> void +Examine.Lucene.FieldValueTypeCollection.GetValueType(string fieldName) -> Examine.Lucene.Indexing.IIndexFieldValueType +Examine.Lucene.FieldValueTypeCollection.GetValueType(string fieldName, Examine.Lucene.IFieldValueTypeFactory fieldValueTypeFactory) -> Examine.Lucene.Indexing.IIndexFieldValueType +Examine.Lucene.FieldValueTypeCollection.ValueTypeFactories.get -> Examine.Lucene.ValueTypeFactoryCollection +Examine.Lucene.FieldValueTypeCollection.ValueTypes.get -> System.Collections.Generic.IEnumerable +Examine.Lucene.IFieldValueTypeFactory +Examine.Lucene.IFieldValueTypeFactory.Create(string fieldName) -> Examine.Lucene.Indexing.IIndexFieldValueType +Examine.Lucene.Indexing.DateTimeType +Examine.Lucene.Indexing.DateTimeType.DateTimeType(string fieldName, Microsoft.Extensions.Logging.ILoggerFactory logger, Lucene.Net.Documents.DateResolution resolution, bool store = true) -> void +Examine.Lucene.Indexing.DateTimeType.DateToLong(System.DateTime date) -> long +Examine.Lucene.Indexing.DateTimeType.Resolution.get -> Lucene.Net.Documents.DateResolution +Examine.Lucene.Indexing.DoubleType +Examine.Lucene.Indexing.DoubleType.DoubleType(string fieldName, Microsoft.Extensions.Logging.ILoggerFactory logger, bool store = true) -> void +Examine.Lucene.Indexing.FullTextType +Examine.Lucene.Indexing.FullTextType.FullTextType(string fieldName, Microsoft.Extensions.Logging.ILoggerFactory logger, Lucene.Net.Analysis.Analyzer analyzer = null, bool sortable = false) -> void +Examine.Lucene.Indexing.GenericAnalyzerFieldValueType +Examine.Lucene.Indexing.GenericAnalyzerFieldValueType.GenericAnalyzerFieldValueType(string fieldName, Microsoft.Extensions.Logging.ILoggerFactory logger, Lucene.Net.Analysis.Analyzer analyzer, bool sortable = false) -> void +Examine.Lucene.Indexing.IIndexFieldValueType +Examine.Lucene.Indexing.IIndexFieldValueType.AddValue(Lucene.Net.Documents.Document doc, object value) -> void +Examine.Lucene.Indexing.IIndexFieldValueType.Analyzer.get -> Lucene.Net.Analysis.Analyzer +Examine.Lucene.Indexing.IIndexFieldValueType.FieldName.get -> string +Examine.Lucene.Indexing.IIndexFieldValueType.GetQuery(string query) -> Lucene.Net.Search.Query +Examine.Lucene.Indexing.IIndexFieldValueType.SortableFieldName.get -> string +Examine.Lucene.Indexing.IIndexFieldValueType.Store.get -> bool +Examine.Lucene.Indexing.IIndexRangeValueType +Examine.Lucene.Indexing.IIndexRangeValueType.GetQuery(string lower, string upper, bool lowerInclusive = true, bool upperInclusive = true) -> Lucene.Net.Search.Query +Examine.Lucene.Indexing.IIndexRangeValueType +Examine.Lucene.Indexing.IIndexRangeValueType.GetQuery(T? lower, T? upper, bool lowerInclusive = true, bool upperInclusive = true) -> Lucene.Net.Search.Query +Examine.Lucene.Indexing.IndexFieldRangeValueType +Examine.Lucene.Indexing.IndexFieldRangeValueType.GetQuery(string lower, string upper, bool lowerInclusive = true, bool upperInclusive = true) -> Lucene.Net.Search.Query +Examine.Lucene.Indexing.IndexFieldRangeValueType.IndexFieldRangeValueType(string fieldName, Microsoft.Extensions.Logging.ILoggerFactory logger, bool store = true) -> void +Examine.Lucene.Indexing.IndexFieldValueTypeBase +Examine.Lucene.Indexing.IndexFieldValueTypeBase.FieldName.get -> string +Examine.Lucene.Indexing.IndexFieldValueTypeBase.IndexFieldValueTypeBase(string fieldName, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory, bool store = true) -> void +Examine.Lucene.Indexing.IndexFieldValueTypeBase.Logger.get -> Microsoft.Extensions.Logging.ILogger +Examine.Lucene.Indexing.IndexFieldValueTypeBase.Store.get -> bool +Examine.Lucene.Indexing.IndexFieldValueTypeBase.TryConvert(object val, out T parsedVal) -> bool +Examine.Lucene.Indexing.Int32Type +Examine.Lucene.Indexing.Int32Type.Int32Type(string fieldName, Microsoft.Extensions.Logging.ILoggerFactory logger, bool store = true) -> void +Examine.Lucene.Indexing.Int64Type +Examine.Lucene.Indexing.Int64Type.Int64Type(string fieldName, Microsoft.Extensions.Logging.ILoggerFactory logger, bool store = true) -> void +Examine.Lucene.Indexing.RawStringType +Examine.Lucene.Indexing.RawStringType.RawStringType(string fieldName, Microsoft.Extensions.Logging.ILoggerFactory logger, bool store = true) -> void +Examine.Lucene.Indexing.SingleType +Examine.Lucene.Indexing.SingleType.SingleType(string fieldName, Microsoft.Extensions.Logging.ILoggerFactory logger, bool store = true) -> void +Examine.Lucene.LoggingReplicationClient +Examine.Lucene.LoggingReplicationClient.LoggingReplicationClient(Microsoft.Extensions.Logging.ILogger logger, Lucene.Net.Replicator.IReplicator replicator, Lucene.Net.Replicator.IReplicationHandler handler, Lucene.Net.Replicator.ISourceDirectoryFactory factory) -> void +Examine.Lucene.LuceneDirectoryIndexOptions +Examine.Lucene.LuceneDirectoryIndexOptions.DirectoryFactory.get -> Examine.Lucene.Directories.IDirectoryFactory +Examine.Lucene.LuceneDirectoryIndexOptions.DirectoryFactory.set -> void +Examine.Lucene.LuceneDirectoryIndexOptions.LuceneDirectoryIndexOptions() -> void +Examine.Lucene.LuceneDirectoryIndexOptions.UnlockIndex.get -> bool +Examine.Lucene.LuceneDirectoryIndexOptions.UnlockIndex.set -> void +Examine.Lucene.LuceneExtensions +Examine.Lucene.LuceneIndexOptions +Examine.Lucene.LuceneIndexOptions.Analyzer.get -> Lucene.Net.Analysis.Analyzer +Examine.Lucene.LuceneIndexOptions.Analyzer.set -> void +Examine.Lucene.LuceneIndexOptions.IndexDeletionPolicy.get -> Lucene.Net.Index.IndexDeletionPolicy +Examine.Lucene.LuceneIndexOptions.IndexDeletionPolicy.set -> void +Examine.Lucene.LuceneIndexOptions.IndexValueTypesFactory.get -> System.Collections.Generic.IReadOnlyDictionary +Examine.Lucene.LuceneIndexOptions.IndexValueTypesFactory.set -> void +Examine.Lucene.LuceneIndexOptions.LuceneIndexOptions() -> void +Examine.Lucene.Providers.BaseLuceneSearcher +Examine.Lucene.Providers.BaseLuceneSearcher.BaseLuceneSearcher(string name, Lucene.Net.Analysis.Analyzer analyzer) -> void +Examine.Lucene.Providers.BaseLuceneSearcher.CreateQuery(string category, Examine.Search.BooleanOperation defaultOperation, Lucene.Net.Analysis.Analyzer luceneAnalyzer, Examine.Lucene.Search.LuceneSearchOptions searchOptions) -> Examine.Search.IQuery +Examine.Lucene.Providers.BaseLuceneSearcher.LuceneAnalyzer.get -> Lucene.Net.Analysis.Analyzer +Examine.Lucene.Providers.ErrorCheckingScoringBooleanQueryRewrite +Examine.Lucene.Providers.ErrorCheckingScoringBooleanQueryRewrite.ErrorCheckingScoringBooleanQueryRewrite() -> void +Examine.Lucene.Providers.IndexThreadingMode +Examine.Lucene.Providers.IndexThreadingMode.Asynchronous = 0 -> Examine.Lucene.Providers.IndexThreadingMode +Examine.Lucene.Providers.IndexThreadingMode.Synchronous = 1 -> Examine.Lucene.Providers.IndexThreadingMode +Examine.Lucene.Providers.LuceneIndex +Examine.Lucene.Providers.LuceneIndex.CommitCount.get -> int +Examine.Lucene.Providers.LuceneIndex.CommitCount.set -> void +Examine.Lucene.Providers.LuceneIndex.DefaultAnalyzer.get -> Lucene.Net.Analysis.Analyzer +Examine.Lucene.Providers.LuceneIndex.Dispose() -> void +Examine.Lucene.Providers.LuceneIndex.DocumentWriting -> System.EventHandler +Examine.Lucene.Providers.LuceneIndex.EnsureIndex(bool forceOverwrite) -> void +Examine.Lucene.Providers.LuceneIndex.FieldAnalyzer.get -> Lucene.Net.Analysis.Miscellaneous.PerFieldAnalyzerWrapper +Examine.Lucene.Providers.LuceneIndex.FieldValueTypeCollection.get -> Examine.Lucene.FieldValueTypeCollection +Examine.Lucene.Providers.LuceneIndex.GetDocumentCount() -> long +Examine.Lucene.Providers.LuceneIndex.GetFieldNames() -> System.Collections.Generic.IEnumerable +Examine.Lucene.Providers.LuceneIndex.GetLuceneDirectory() -> Lucene.Net.Store.Directory +Examine.Lucene.Providers.LuceneIndex.IndexCommitted -> System.EventHandler +Examine.Lucene.Providers.LuceneIndex.IndexReady() -> bool +Examine.Lucene.Providers.LuceneIndex.IndexWriter.get -> Lucene.Net.Index.TrackingIndexWriter +Examine.Lucene.Providers.LuceneIndex.IsCancellationRequested.get -> bool +Examine.Lucene.Providers.LuceneIndex.IsReadable(out System.Exception ex) -> bool +Examine.Lucene.Providers.LuceneIndex.LuceneIndex(Microsoft.Extensions.Logging.ILoggerFactory loggerFactory, string name, Microsoft.Extensions.Options.IOptionsMonitor indexOptions) -> void +Examine.Lucene.Providers.LuceneIndex.RunAsync.get -> bool +Examine.Lucene.Providers.LuceneIndex.RunAsync.set -> void +Examine.Lucene.Providers.LuceneIndex.WaitForChanges() -> void +Examine.Lucene.Providers.LuceneIndex.WithThreadingMode(Examine.Lucene.Providers.IndexThreadingMode mode) -> System.IDisposable +Examine.Lucene.Providers.LuceneSearcher +Examine.Lucene.Providers.LuceneSearcher.Dispose() -> void +Examine.Lucene.Providers.LuceneSearcher.LuceneSearcher(string name, Lucene.Net.Search.SearcherManager searcherManager, Lucene.Net.Analysis.Analyzer analyzer, Examine.Lucene.FieldValueTypeCollection fieldValueTypeCollection) -> void +Examine.Lucene.Providers.MultiIndexSearcher +Examine.Lucene.Providers.MultiIndexSearcher.MultiIndexSearcher(string name, System.Collections.Generic.IEnumerable indexes, Lucene.Net.Analysis.Analyzer analyzer = null) -> void +Examine.Lucene.Providers.MultiIndexSearcher.MultiIndexSearcher(string name, System.Lazy> searchers, Lucene.Net.Analysis.Analyzer analyzer = null) -> void +Examine.Lucene.Providers.MultiIndexSearcher.Searchers.get -> System.Collections.Generic.IEnumerable +Examine.Lucene.Providers.MultiIndexSearcher.SearchersInitialized.get -> bool +Examine.Lucene.Providers.ValueSetValidatorDelegate +Examine.Lucene.Providers.ValueSetValidatorDelegate.Validate(Examine.ValueSet valueSet) -> Examine.ValueSetValidationResult +Examine.Lucene.Providers.ValueSetValidatorDelegate.ValueSetValidatorDelegate(System.Func validator) -> void +Examine.Lucene.ReaderStatus +Examine.Lucene.ReaderStatus.Closed = 1 -> Examine.Lucene.ReaderStatus +Examine.Lucene.ReaderStatus.Current = 0 -> Examine.Lucene.ReaderStatus +Examine.Lucene.ReaderStatus.NotCurrent = 2 -> Examine.Lucene.ReaderStatus +Examine.Lucene.Search.CustomMultiFieldQueryParser +Examine.Lucene.Search.CustomMultiFieldQueryParser.CustomMultiFieldQueryParser(Lucene.Net.Util.LuceneVersion matchVersion, string[] fields, Lucene.Net.Analysis.Analyzer analyzer) -> void +Examine.Lucene.Search.CustomMultiFieldQueryParser.GetFieldQueryInternal(string field, string queryText) -> Lucene.Net.Search.Query +Examine.Lucene.Search.CustomMultiFieldQueryParser.SearchableFields.get -> string[] +Examine.Lucene.Search.ExamineMultiFieldQueryParser +Examine.Lucene.Search.ExamineMultiFieldQueryParser.ExamineMultiFieldQueryParser(Examine.Lucene.Search.ISearchContext searchContext, Lucene.Net.Util.LuceneVersion matchVersion, Lucene.Net.Analysis.Analyzer analyzer) -> void +Examine.Lucene.Search.ILuceneSearchResults +Examine.Lucene.Search.ILuceneSearchResults.MaxScore.get -> float +Examine.Lucene.Search.ILuceneSearchResults.SearchAfter.get -> Examine.Lucene.Search.SearchAfterOptions +Examine.Lucene.Search.ISearchContext +Examine.Lucene.Search.ISearchContext.GetFieldValueType(string fieldName) -> Examine.Lucene.Indexing.IIndexFieldValueType +Examine.Lucene.Search.ISearchContext.GetSearcher() -> Examine.Lucene.Search.ISearcherReference +Examine.Lucene.Search.ISearchContext.SearchableFields.get -> string[] +Examine.Lucene.Search.ISearcherReference +Examine.Lucene.Search.ISearcherReference.IndexSearcher.get -> Lucene.Net.Search.IndexSearcher +Examine.Lucene.Search.LateBoundQuery +Examine.Lucene.Search.LateBoundQuery.LateBoundQuery(System.Func factory) -> void +Examine.Lucene.Search.LateBoundQuery.Wrapped.get -> Lucene.Net.Search.Query +Examine.Lucene.Search.LuceneBooleanOperation +Examine.Lucene.Search.LuceneBooleanOperation.LuceneBooleanOperation(Examine.Lucene.Search.LuceneSearchQuery search) -> void +Examine.Lucene.Search.LuceneBooleanOperationBase +Examine.Lucene.Search.LuceneBooleanOperationBase.And(System.Func inner, Examine.Search.BooleanOperation defaultOp = Examine.Search.BooleanOperation.And) -> Examine.Search.IBooleanOperation +Examine.Lucene.Search.LuceneBooleanOperationBase.AndNot(System.Func inner, Examine.Search.BooleanOperation defaultOp = Examine.Search.BooleanOperation.And) -> Examine.Search.IBooleanOperation +Examine.Lucene.Search.LuceneBooleanOperationBase.LuceneBooleanOperationBase(Examine.Lucene.Search.LuceneSearchQueryBase search) -> void +Examine.Lucene.Search.LuceneBooleanOperationBase.Op(System.Func inner, Examine.Search.BooleanOperation outerOp, Examine.Search.BooleanOperation? defaultInnerOp = null) -> Examine.Lucene.Search.LuceneBooleanOperationBase +Examine.Lucene.Search.LuceneBooleanOperationBase.Or(System.Func inner, Examine.Search.BooleanOperation defaultOp = Examine.Search.BooleanOperation.And) -> Examine.Search.IBooleanOperation +Examine.Lucene.Search.LuceneQuery +Examine.Lucene.Search.LuceneQuery.All() -> Examine.Search.IOrdering +Examine.Lucene.Search.LuceneQuery.Category.get -> string +Examine.Lucene.Search.LuceneQuery.Field(string fieldName, Examine.Search.IExamineValue fieldValue) -> Examine.Search.IBooleanOperation +Examine.Lucene.Search.LuceneQuery.Field(string fieldName, string fieldValue) -> Examine.Search.IBooleanOperation +Examine.Lucene.Search.LuceneQuery.Field(string fieldName, T fieldValue) -> Examine.Search.IBooleanOperation +Examine.Lucene.Search.LuceneQuery.Group(System.Func inner, Examine.Search.BooleanOperation defaultOp = Examine.Search.BooleanOperation.Or) -> Examine.Search.IBooleanOperation +Examine.Lucene.Search.LuceneQuery.GroupedAnd(System.Collections.Generic.IEnumerable fields, params Examine.Search.IExamineValue[] query) -> Examine.Search.IBooleanOperation +Examine.Lucene.Search.LuceneQuery.GroupedAnd(System.Collections.Generic.IEnumerable fields, params string[] query) -> Examine.Search.IBooleanOperation +Examine.Lucene.Search.LuceneQuery.GroupedNot(System.Collections.Generic.IEnumerable fields, params Examine.Search.IExamineValue[] query) -> Examine.Search.IBooleanOperation +Examine.Lucene.Search.LuceneQuery.GroupedNot(System.Collections.Generic.IEnumerable fields, params string[] query) -> Examine.Search.IBooleanOperation +Examine.Lucene.Search.LuceneQuery.GroupedOr(System.Collections.Generic.IEnumerable fields, params Examine.Search.IExamineValue[] query) -> Examine.Search.IBooleanOperation +Examine.Lucene.Search.LuceneQuery.GroupedOr(System.Collections.Generic.IEnumerable fields, params string[] query) -> Examine.Search.IBooleanOperation +Examine.Lucene.Search.LuceneQuery.Id(string id) -> Examine.Search.IBooleanOperation +Examine.Lucene.Search.LuceneQuery.LuceneQuery(Examine.Lucene.Search.LuceneSearchQuery search, Lucene.Net.Search.Occur occurrence) -> void +Examine.Lucene.Search.LuceneQuery.ManagedQuery(string query, string[] fields = null) -> Examine.Search.IBooleanOperation +Examine.Lucene.Search.LuceneQuery.NativeQuery(string query) -> Examine.Search.IBooleanOperation +Examine.Lucene.Search.LuceneQuery.RangeQuery(string[] fields, T? min, T? max, bool minInclusive = true, bool maxInclusive = true) -> Examine.Search.IBooleanOperation +Examine.Lucene.Search.LuceneQueryOptions +Examine.Lucene.Search.LuceneQueryOptions.LuceneQueryOptions(int skip, int? take = null, Examine.Lucene.Search.SearchAfterOptions searchAfter = null, bool trackDocumentScores = false, bool trackDocumentMaxScore = false) -> void +Examine.Lucene.Search.LuceneQueryOptions.SearchAfter.get -> Examine.Lucene.Search.SearchAfterOptions +Examine.Lucene.Search.LuceneQueryOptions.TrackDocumentMaxScore.get -> bool +Examine.Lucene.Search.LuceneQueryOptions.TrackDocumentScores.get -> bool +Examine.Lucene.Search.LuceneSearchExecutor +Examine.Lucene.Search.LuceneSearchExecutor.Execute() -> Examine.ISearchResults +Examine.Lucene.Search.LuceneSearchExtensions +Examine.Lucene.Search.LuceneSearchOptions +Examine.Lucene.Search.LuceneSearchOptions.AllowLeadingWildcard.get -> bool? +Examine.Lucene.Search.LuceneSearchOptions.AllowLeadingWildcard.set -> void +Examine.Lucene.Search.LuceneSearchOptions.DateResolution.get -> Lucene.Net.Documents.DateResolution? +Examine.Lucene.Search.LuceneSearchOptions.DateResolution.set -> void +Examine.Lucene.Search.LuceneSearchOptions.EnablePositionIncrements.get -> bool? +Examine.Lucene.Search.LuceneSearchOptions.EnablePositionIncrements.set -> void +Examine.Lucene.Search.LuceneSearchOptions.FuzzyMinSim.get -> float? +Examine.Lucene.Search.LuceneSearchOptions.FuzzyMinSim.set -> void +Examine.Lucene.Search.LuceneSearchOptions.FuzzyPrefixLength.get -> int? +Examine.Lucene.Search.LuceneSearchOptions.FuzzyPrefixLength.set -> void +Examine.Lucene.Search.LuceneSearchOptions.Locale.get -> System.Globalization.CultureInfo +Examine.Lucene.Search.LuceneSearchOptions.Locale.set -> void +Examine.Lucene.Search.LuceneSearchOptions.LowercaseExpandedTerms.get -> bool? +Examine.Lucene.Search.LuceneSearchOptions.LowercaseExpandedTerms.set -> void +Examine.Lucene.Search.LuceneSearchOptions.LuceneSearchOptions() -> void +Examine.Lucene.Search.LuceneSearchOptions.MultiTermRewriteMethod.get -> Lucene.Net.Search.MultiTermQuery.RewriteMethod +Examine.Lucene.Search.LuceneSearchOptions.MultiTermRewriteMethod.set -> void +Examine.Lucene.Search.LuceneSearchOptions.PhraseSlop.get -> int? +Examine.Lucene.Search.LuceneSearchOptions.PhraseSlop.set -> void +Examine.Lucene.Search.LuceneSearchOptions.TimeZone.get -> System.TimeZoneInfo +Examine.Lucene.Search.LuceneSearchOptions.TimeZone.set -> void +Examine.Lucene.Search.LuceneSearchQuery +Examine.Lucene.Search.LuceneSearchQuery.Execute(Examine.Search.QueryOptions options = null) -> Examine.ISearchResults +Examine.Lucene.Search.LuceneSearchQuery.LuceneSearchQuery(Examine.Lucene.Search.ISearchContext searchContext, string category, Lucene.Net.Analysis.Analyzer analyzer, Examine.Lucene.Search.LuceneSearchOptions searchOptions, Examine.Search.BooleanOperation occurance) -> void +Examine.Lucene.Search.LuceneSearchQuery.SelectAllFieldsInternal() -> Examine.Search.IBooleanOperation +Examine.Lucene.Search.LuceneSearchQueryBase +Examine.Lucene.Search.LuceneSearchQueryBase.All() -> Examine.Search.IOrdering +Examine.Lucene.Search.LuceneSearchQueryBase.AllFields.get -> string[] +Examine.Lucene.Search.LuceneSearchQueryBase.BooleanOperation.get -> Examine.Search.BooleanOperation +Examine.Lucene.Search.LuceneSearchQueryBase.BooleanOperation.set -> void +Examine.Lucene.Search.LuceneSearchQueryBase.Category.get -> string +Examine.Lucene.Search.LuceneSearchQueryBase.Field(string fieldName, Examine.Search.IExamineValue fieldValue) -> Examine.Search.IBooleanOperation +Examine.Lucene.Search.LuceneSearchQueryBase.Field(string fieldName, string fieldValue) -> Examine.Search.IBooleanOperation +Examine.Lucene.Search.LuceneSearchQueryBase.FieldInternal(string fieldName, Examine.Search.IExamineValue fieldValue, Lucene.Net.Search.Occur occurrence) -> Examine.Lucene.Search.LuceneBooleanOperationBase +Examine.Lucene.Search.LuceneSearchQueryBase.Group(System.Func inner, Examine.Search.BooleanOperation defaultOp = Examine.Search.BooleanOperation.Or) -> Examine.Search.IBooleanOperation +Examine.Lucene.Search.LuceneSearchQueryBase.GroupedAnd(System.Collections.Generic.IEnumerable fields, params Examine.Search.IExamineValue[] fieldVals) -> Examine.Search.IBooleanOperation +Examine.Lucene.Search.LuceneSearchQueryBase.GroupedAnd(System.Collections.Generic.IEnumerable fields, params string[] query) -> Examine.Search.IBooleanOperation +Examine.Lucene.Search.LuceneSearchQueryBase.GroupedAndInternal(string[] fields, Examine.Search.IExamineValue[] fieldVals, Lucene.Net.Search.Occur occurrence) -> Examine.Lucene.Search.LuceneBooleanOperationBase +Examine.Lucene.Search.LuceneSearchQueryBase.GroupedNot(System.Collections.Generic.IEnumerable fields, params Examine.Search.IExamineValue[] query) -> Examine.Search.IBooleanOperation +Examine.Lucene.Search.LuceneSearchQueryBase.GroupedNot(System.Collections.Generic.IEnumerable fields, params string[] query) -> Examine.Search.IBooleanOperation +Examine.Lucene.Search.LuceneSearchQueryBase.GroupedNotInternal(string[] fields, Examine.Search.IExamineValue[] fieldVals) -> Examine.Lucene.Search.LuceneBooleanOperationBase +Examine.Lucene.Search.LuceneSearchQueryBase.GroupedOr(System.Collections.Generic.IEnumerable fields, params Examine.Search.IExamineValue[] query) -> Examine.Search.IBooleanOperation +Examine.Lucene.Search.LuceneSearchQueryBase.GroupedOr(System.Collections.Generic.IEnumerable fields, params string[] query) -> Examine.Search.IBooleanOperation +Examine.Lucene.Search.LuceneSearchQueryBase.GroupedOrInternal(string[] fields, Examine.Search.IExamineValue[] fieldVals, Lucene.Net.Search.Occur occurrence) -> Examine.Lucene.Search.LuceneBooleanOperationBase +Examine.Lucene.Search.LuceneSearchQueryBase.Id(string id) -> Examine.Search.IBooleanOperation +Examine.Lucene.Search.LuceneSearchQueryBase.IdInternal(string id, Lucene.Net.Search.Occur occurrence) -> Examine.Lucene.Search.LuceneBooleanOperationBase +Examine.Lucene.Search.LuceneSearchQueryBase.LuceneQuery(Lucene.Net.Search.Query query, Examine.Search.BooleanOperation? op = null) -> Examine.Lucene.Search.LuceneBooleanOperationBase +Examine.Lucene.Search.LuceneSearchQueryBase.LuceneSearchQueryBase(Examine.Lucene.Search.CustomMultiFieldQueryParser queryParser, string category, Examine.Lucene.Search.LuceneSearchOptions searchOptions, Examine.Search.BooleanOperation occurance) -> void +Examine.Lucene.Search.LuceneSearchQueryBase.NativeQuery(string query) -> Examine.Search.IBooleanOperation +Examine.Lucene.Search.LuceneSearchQueryBase.Occurrence.get -> Lucene.Net.Search.Occur +Examine.Lucene.Search.LuceneSearchQueryBase.Occurrence.set -> void +Examine.Lucene.Search.LuceneSearchQueryBase.Query.get -> Lucene.Net.Search.BooleanQuery +Examine.Lucene.Search.LuceneSearchQueryBase.QueryParser.get -> Lucene.Net.QueryParsers.Classic.QueryParser +Examine.Lucene.Search.LuceneSearchQueryBase.SearchOptions.get -> Examine.Lucene.Search.LuceneSearchOptions +Examine.Lucene.Search.LuceneSearchQueryBase.SortFields.get -> System.Collections.Generic.IList +Examine.Lucene.Search.LuceneSearchResult +Examine.Lucene.Search.LuceneSearchResult.LuceneSearchResult(string id, float score, System.Func>> lazyFieldVals, int shardId) -> void +Examine.Lucene.Search.LuceneSearchResult.ShardIndex.get -> int +Examine.Lucene.Search.LuceneSearchResults +Examine.Lucene.Search.LuceneSearchResults.GetEnumerator() -> System.Collections.Generic.IEnumerator +Examine.Lucene.Search.LuceneSearchResults.LuceneSearchResults(System.Collections.Generic.IReadOnlyCollection results, int totalItemCount) -> void +Examine.Lucene.Search.LuceneSearchResults.TotalItemCount.get -> long +Examine.Lucene.Search.MultiSearchContext +Examine.Lucene.Search.MultiSearchContext.GetFieldValueType(string fieldName) -> Examine.Lucene.Indexing.IIndexFieldValueType +Examine.Lucene.Search.MultiSearchContext.GetSearcher() -> Examine.Lucene.Search.ISearcherReference +Examine.Lucene.Search.MultiSearchContext.MultiSearchContext(Examine.Lucene.Search.ISearchContext[] inner) -> void +Examine.Lucene.Search.MultiSearchContext.SearchableFields.get -> string[] +Examine.Lucene.Search.MultiSearchSearcherReference +Examine.Lucene.Search.MultiSearchSearcherReference.Dispose() -> void +Examine.Lucene.Search.MultiSearchSearcherReference.IndexSearcher.get -> Lucene.Net.Search.IndexSearcher +Examine.Lucene.Search.MultiSearchSearcherReference.MultiSearchSearcherReference(Examine.Lucene.Search.ISearcherReference[] inner) -> void +Examine.Lucene.Search.SearchAfterOptions +Examine.Lucene.Search.SearchAfterOptions.DocumentId.get -> int +Examine.Lucene.Search.SearchAfterOptions.DocumentScore.get -> float +Examine.Lucene.Search.SearchAfterOptions.Fields.get -> object[] +Examine.Lucene.Search.SearchAfterOptions.SearchAfterOptions(int documentId, float documentScore, object[] fields, int shardIndex) -> void +Examine.Lucene.Search.SearchAfterOptions.ShardIndex.get -> int? +Examine.Lucene.Search.SearchContext +Examine.Lucene.Search.SearchContext.GetFieldValueType(string fieldName) -> Examine.Lucene.Indexing.IIndexFieldValueType +Examine.Lucene.Search.SearchContext.GetSearcher() -> Examine.Lucene.Search.ISearcherReference +Examine.Lucene.Search.SearchContext.SearchableFields.get -> string[] +Examine.Lucene.Search.SearchContext.SearchContext(Lucene.Net.Search.SearcherManager searcherManager, Examine.Lucene.FieldValueTypeCollection fieldValueTypeCollection) -> void +Examine.Lucene.Search.SearcherReference +Examine.Lucene.Search.SearcherReference.Dispose() -> void +Examine.Lucene.Search.SearcherReference.IndexSearcher.get -> Lucene.Net.Search.IndexSearcher +Examine.Lucene.Search.SearcherReference.SearcherReference(Lucene.Net.Search.SearcherManager searcherManager) -> void +Examine.Lucene.ValueTypeFactoryCollection +Examine.Lucene.ValueTypeFactoryCollection.Count.get -> int +Examine.Lucene.ValueTypeFactoryCollection.GetEnumerator() -> System.Collections.Generic.IEnumerator> +Examine.Lucene.ValueTypeFactoryCollection.GetRequiredFactory(string valueTypeName) -> Examine.Lucene.IFieldValueTypeFactory +Examine.Lucene.ValueTypeFactoryCollection.TryGetFactory(string valueTypeName, out Examine.Lucene.IFieldValueTypeFactory fieldValueTypeFactory) -> bool +Examine.Lucene.ValueTypeFactoryCollection.ValueTypeFactoryCollection(System.Collections.Generic.IReadOnlyDictionary valueTypeFactories) -> void +Examine.LuceneInfo +Examine.StringExtensions +override Examine.Lucene.Analyzers.EmailAddressAnalyzer.CreateComponents(string fieldName, System.IO.TextReader reader) -> Lucene.Net.Analysis.TokenStreamComponents +override Examine.Lucene.Analyzers.PatternAnalyzer.CreateComponents(string fieldName, System.IO.TextReader reader) -> Lucene.Net.Analysis.TokenStreamComponents +override Examine.Lucene.Directories.FileSystemDirectoryFactory.CreateDirectory(Examine.Lucene.Providers.LuceneIndex luceneIndex, bool forceUnlock) -> Lucene.Net.Store.Directory +override Examine.Lucene.Directories.GenericDirectoryFactory.CreateDirectory(Examine.Lucene.Providers.LuceneIndex luceneIndex, bool forceUnlock) -> Lucene.Net.Store.Directory +override Examine.Lucene.Directories.MultiIndexLockFactory.ClearLock(string lockName) -> void +override Examine.Lucene.Directories.MultiIndexLockFactory.MakeLock(string lockName) -> Lucene.Net.Store.Lock +override Examine.Lucene.Directories.SyncedFileSystemDirectoryFactory.CreateDirectory(Examine.Lucene.Providers.LuceneIndex luceneIndex, bool forceUnlock) -> Lucene.Net.Store.Directory +override Examine.Lucene.Directories.SyncedFileSystemDirectoryFactory.Dispose(bool disposing) -> void +override Examine.Lucene.Indexing.DateTimeType.AddSingleValue(Lucene.Net.Documents.Document doc, object value) -> void +override Examine.Lucene.Indexing.DateTimeType.GetQuery(string query) -> Lucene.Net.Search.Query +override Examine.Lucene.Indexing.DateTimeType.GetQuery(System.DateTime? lower, System.DateTime? upper, bool lowerInclusive = true, bool upperInclusive = true) -> Lucene.Net.Search.Query +override Examine.Lucene.Indexing.DateTimeType.SortableFieldName.get -> string +override Examine.Lucene.Indexing.DoubleType.AddSingleValue(Lucene.Net.Documents.Document doc, object value) -> void +override Examine.Lucene.Indexing.DoubleType.GetQuery(double? lower, double? upper, bool lowerInclusive = true, bool upperInclusive = true) -> Lucene.Net.Search.Query +override Examine.Lucene.Indexing.DoubleType.GetQuery(string query) -> Lucene.Net.Search.Query +override Examine.Lucene.Indexing.DoubleType.SortableFieldName.get -> string +override Examine.Lucene.Indexing.FullTextType.AddSingleValue(Lucene.Net.Documents.Document doc, object value) -> void +override Examine.Lucene.Indexing.FullTextType.Analyzer.get -> Lucene.Net.Analysis.Analyzer +override Examine.Lucene.Indexing.FullTextType.GetQuery(string query) -> Lucene.Net.Search.Query +override Examine.Lucene.Indexing.FullTextType.SortableFieldName.get -> string +override Examine.Lucene.Indexing.GenericAnalyzerFieldValueType.AddSingleValue(Lucene.Net.Documents.Document doc, object value) -> void +override Examine.Lucene.Indexing.GenericAnalyzerFieldValueType.Analyzer.get -> Lucene.Net.Analysis.Analyzer +override Examine.Lucene.Indexing.GenericAnalyzerFieldValueType.SortableFieldName.get -> string +override Examine.Lucene.Indexing.Int32Type.AddSingleValue(Lucene.Net.Documents.Document doc, object value) -> void +override Examine.Lucene.Indexing.Int32Type.GetQuery(int? lower, int? upper, bool lowerInclusive = true, bool upperInclusive = true) -> Lucene.Net.Search.Query +override Examine.Lucene.Indexing.Int32Type.GetQuery(string query) -> Lucene.Net.Search.Query +override Examine.Lucene.Indexing.Int32Type.SortableFieldName.get -> string +override Examine.Lucene.Indexing.Int64Type.AddSingleValue(Lucene.Net.Documents.Document doc, object value) -> void +override Examine.Lucene.Indexing.Int64Type.GetQuery(long? lower, long? upper, bool lowerInclusive = true, bool upperInclusive = true) -> Lucene.Net.Search.Query +override Examine.Lucene.Indexing.Int64Type.GetQuery(string query) -> Lucene.Net.Search.Query +override Examine.Lucene.Indexing.Int64Type.SortableFieldName.get -> string +override Examine.Lucene.Indexing.RawStringType.AddSingleValue(Lucene.Net.Documents.Document doc, object value) -> void +override Examine.Lucene.Indexing.RawStringType.Analyzer.get -> Lucene.Net.Analysis.Analyzer +override Examine.Lucene.Indexing.SingleType.AddSingleValue(Lucene.Net.Documents.Document doc, object value) -> void +override Examine.Lucene.Indexing.SingleType.GetQuery(float? lower, float? upper, bool lowerInclusive = true, bool upperInclusive = true) -> Lucene.Net.Search.Query +override Examine.Lucene.Indexing.SingleType.GetQuery(string query) -> Lucene.Net.Search.Query +override Examine.Lucene.Indexing.SingleType.SortableFieldName.get -> string +override Examine.Lucene.LoggingReplicationClient.HandleUpdateException(System.Exception exception) -> void +override Examine.Lucene.Providers.BaseLuceneSearcher.CreateQuery(string category = null, Examine.Search.BooleanOperation defaultOperation = Examine.Search.BooleanOperation.And) -> Examine.Search.IQuery +override Examine.Lucene.Providers.BaseLuceneSearcher.Search(string searchText, Examine.Search.QueryOptions options = null) -> Examine.ISearchResults +override Examine.Lucene.Providers.ErrorCheckingScoringBooleanQueryRewrite.Rewrite(Lucene.Net.Index.IndexReader reader, Lucene.Net.Search.MultiTermQuery query) -> Lucene.Net.Search.Query +override Examine.Lucene.Providers.LuceneIndex.CreateIndex() -> void +override Examine.Lucene.Providers.LuceneIndex.IndexExists() -> bool +override Examine.Lucene.Providers.LuceneIndex.OnIndexingError(Examine.IndexingErrorEventArgs e) -> void +override Examine.Lucene.Providers.LuceneIndex.PerformDeleteFromIndex(System.Collections.Generic.IEnumerable itemIds, System.Action onComplete) -> void +override Examine.Lucene.Providers.LuceneIndex.PerformIndexItems(System.Collections.Generic.IEnumerable values, System.Action onComplete) -> void +override Examine.Lucene.Providers.LuceneIndex.Searcher.get -> Examine.ISearcher +override Examine.Lucene.Providers.LuceneSearcher.GetSearchContext() -> Examine.Lucene.Search.ISearchContext +override Examine.Lucene.Providers.MultiIndexSearcher.GetSearchContext() -> Examine.Lucene.Search.ISearchContext +override Examine.Lucene.Search.CustomMultiFieldQueryParser.GetRangeQuery(string field, string part1, string part2, bool startInclusive, bool endInclusive) -> Lucene.Net.Search.Query +override Examine.Lucene.Search.ExamineMultiFieldQueryParser.GetRangeQuery(string field, string part1, string part2, bool startInclusive, bool endInclusive) -> Lucene.Net.Search.Query +override Examine.Lucene.Search.LateBoundQuery.Boost.get -> float +override Examine.Lucene.Search.LateBoundQuery.Boost.set -> void +override Examine.Lucene.Search.LateBoundQuery.Clone() -> object +override Examine.Lucene.Search.LateBoundQuery.CreateWeight(Lucene.Net.Search.IndexSearcher searcher) -> Lucene.Net.Search.Weight +override Examine.Lucene.Search.LateBoundQuery.ExtractTerms(System.Collections.Generic.ISet terms) -> void +override Examine.Lucene.Search.LateBoundQuery.Rewrite(Lucene.Net.Index.IndexReader reader) -> Lucene.Net.Search.Query +override Examine.Lucene.Search.LateBoundQuery.ToString(string field) -> string +override Examine.Lucene.Search.LuceneBooleanOperation.And() -> Examine.Search.IQuery +override Examine.Lucene.Search.LuceneBooleanOperation.AndNested() -> Examine.Search.INestedQuery +override Examine.Lucene.Search.LuceneBooleanOperation.Execute(Examine.Search.QueryOptions options = null) -> Examine.ISearchResults +override Examine.Lucene.Search.LuceneBooleanOperation.Not() -> Examine.Search.IQuery +override Examine.Lucene.Search.LuceneBooleanOperation.NotNested() -> Examine.Search.INestedQuery +override Examine.Lucene.Search.LuceneBooleanOperation.Or() -> Examine.Search.IQuery +override Examine.Lucene.Search.LuceneBooleanOperation.OrderBy(params Examine.Search.SortableField[] fields) -> Examine.Search.IOrdering +override Examine.Lucene.Search.LuceneBooleanOperation.OrderByDescending(params Examine.Search.SortableField[] fields) -> Examine.Search.IOrdering +override Examine.Lucene.Search.LuceneBooleanOperation.OrNested() -> Examine.Search.INestedQuery +override Examine.Lucene.Search.LuceneBooleanOperation.SelectAllFields() -> Examine.Search.IOrdering +override Examine.Lucene.Search.LuceneBooleanOperation.SelectField(string fieldName) -> Examine.Search.IOrdering +override Examine.Lucene.Search.LuceneBooleanOperation.SelectFields(System.Collections.Generic.ISet fieldNames) -> Examine.Search.IOrdering +override Examine.Lucene.Search.LuceneBooleanOperation.ToString() -> string +override Examine.Lucene.Search.LuceneSearchQuery.CreateOp() -> Examine.Lucene.Search.LuceneBooleanOperationBase +override Examine.Lucene.Search.LuceneSearchQuery.Field(string fieldName, T fieldValue) -> Examine.Search.IBooleanOperation +override Examine.Lucene.Search.LuceneSearchQuery.FieldNested(string fieldName, T fieldValue) -> Examine.Search.INestedBooleanOperation +override Examine.Lucene.Search.LuceneSearchQuery.ManagedQuery(string query, string[] fields = null) -> Examine.Search.IBooleanOperation +override Examine.Lucene.Search.LuceneSearchQuery.ManagedQueryNested(string query, string[] fields = null) -> Examine.Search.INestedBooleanOperation +override Examine.Lucene.Search.LuceneSearchQuery.RangeQuery(string[] fields, T? min, T? max, bool minInclusive = true, bool maxInclusive = true) -> Examine.Search.IBooleanOperation +override Examine.Lucene.Search.LuceneSearchQuery.RangeQueryNested(string[] fields, T? min, T? max, bool minInclusive = true, bool maxInclusive = true) -> Examine.Search.INestedBooleanOperation +override Examine.Lucene.Search.LuceneSearchQueryBase.ToString() -> string +static Examine.Lucene.Directories.TempEnvFileSystemDirectoryFactory.GetTempPath(Examine.Lucene.Directories.IApplicationIdentifier applicationIdentifier) -> string +static Examine.Lucene.Indexing.FullTextType.GenerateQuery(string fieldName, string query, Lucene.Net.Analysis.Analyzer analyzer) -> Lucene.Net.Search.Query +static Examine.Lucene.Search.LuceneSearchExtensions.ToBooleanOperation(this Lucene.Net.Search.Occur o) -> Examine.Search.BooleanOperation +static Examine.Lucene.Search.LuceneSearchExtensions.ToLuceneOccurrence(this Examine.Search.BooleanOperation o) -> Lucene.Net.Search.Occur +static Examine.Lucene.Search.LuceneSearchResults.Empty.get -> Examine.Lucene.Search.LuceneSearchResults +static Examine.Lucene.ValueTypeFactoryCollection.GetDefaultValueTypes(Microsoft.Extensions.Logging.ILoggerFactory loggerFactory, Lucene.Net.Analysis.Analyzer defaultAnalyzer) -> System.Collections.Generic.IReadOnlyDictionary +static Examine.LuceneInfo.CurrentVersion.get -> Lucene.Net.Util.LuceneVersion +static Examine.StringExtensions.GenerateHash(this string str) -> string +static Examine.StringExtensions.GenerateMd5(this string str) -> string +static Examine.StringExtensions.GenerateSha1Hash(this string str) -> string +static Examine.StringExtensions.RemoveStopWords(this string searchText) -> string +virtual Examine.Lucene.Directories.DirectoryFactoryBase.Dispose(bool disposing) -> void +virtual Examine.Lucene.ExamineReplicator.Dispose(bool disposing) -> void +virtual Examine.Lucene.Indexing.IndexFieldValueTypeBase.AddValue(Lucene.Net.Documents.Document doc, object value) -> void +virtual Examine.Lucene.Indexing.IndexFieldValueTypeBase.Analyzer.get -> Lucene.Net.Analysis.Analyzer +virtual Examine.Lucene.Indexing.IndexFieldValueTypeBase.GetQuery(string query) -> Lucene.Net.Search.Query +virtual Examine.Lucene.Indexing.IndexFieldValueTypeBase.SortableFieldName.get -> string +virtual Examine.Lucene.Providers.LuceneIndex.AddDocument(Lucene.Net.Documents.Document doc, Examine.ValueSet valueSet) -> void +virtual Examine.Lucene.Providers.LuceneIndex.CreateFieldValueTypes(System.Collections.Generic.IReadOnlyDictionary indexValueTypesFactory = null) -> Examine.Lucene.FieldValueTypeCollection +virtual Examine.Lucene.Providers.LuceneIndex.CreateIndexWriter(Lucene.Net.Store.Directory d) -> Lucene.Net.Index.IndexWriter +virtual Examine.Lucene.Providers.LuceneIndex.Dispose(bool disposing) -> void +virtual Examine.Lucene.Providers.LuceneIndex.OnDocumentWriting(Examine.Lucene.DocumentWritingEventArgs docArgs) -> void +virtual Examine.Lucene.Providers.LuceneSearcher.Dispose(bool disposing) -> void +virtual Examine.Lucene.Search.CustomMultiFieldQueryParser.GetFuzzyQueryInternal(string field, string termStr, float minSimilarity) -> Lucene.Net.Search.Query +virtual Examine.Lucene.Search.CustomMultiFieldQueryParser.GetProximityQueryInternal(string field, string queryText, int slop) -> Lucene.Net.Search.Query +virtual Examine.Lucene.Search.CustomMultiFieldQueryParser.GetWildcardQueryInternal(string field, string termStr) -> Lucene.Net.Search.Query +virtual Examine.Lucene.Search.LuceneSearchQuery.OrderBy(params Examine.Search.SortableField[] fields) -> Examine.Search.IBooleanOperation +virtual Examine.Lucene.Search.LuceneSearchQuery.OrderByDescending(params Examine.Search.SortableField[] fields) -> Examine.Search.IBooleanOperation +virtual Examine.Lucene.Search.LuceneSearchQueryBase.GetFieldInternalQuery(string fieldName, Examine.Search.IExamineValue fieldValue, bool useQueryParser) -> Lucene.Net.Search.Query +virtual Examine.Lucene.Search.MultiSearchSearcherReference.Dispose(bool disposing) -> void +virtual Examine.Lucene.Search.SearcherReference.Dispose(bool disposing) -> void diff --git a/src/Examine.Lucene/PublicAPI.Unshipped.txt b/src/Examine.Lucene/PublicAPI.Unshipped.txt new file mode 100644 index 000000000..e69de29bb From 1a0407b681481ddc4667c04bee6a70516aab9ced Mon Sep 17 00:00:00 2001 From: Chad Currie Date: Sat, 29 Jul 2023 21:50:52 +1200 Subject: [PATCH 08/12] Ignore RS0036 till v4 release. --- src/Examine.Core/Examine.Core.csproj | 1 + src/Examine.Core/PublicAPI.Shipped.txt | 1 + src/Examine.Host/Examine.csproj | 1 + src/Examine.Host/PublicAPI.Shipped.txt | 1 + src/Examine.Host/PublicAPI.Unshipped.txt | 1 + src/Examine.Lucene/Examine.Lucene.csproj | 1 + src/Examine.Lucene/PublicAPI.Shipped.txt | 1 + src/Examine.Lucene/PublicAPI.Unshipped.txt | 1 + 8 files changed, 8 insertions(+) diff --git a/src/Examine.Core/Examine.Core.csproj b/src/Examine.Core/Examine.Core.csproj index b83672ce1..82aa2abc9 100644 --- a/src/Examine.Core/Examine.Core.csproj +++ b/src/Examine.Core/Examine.Core.csproj @@ -8,6 +8,7 @@ True enable 9 + RS0036 diff --git a/src/Examine.Core/PublicAPI.Shipped.txt b/src/Examine.Core/PublicAPI.Shipped.txt index 08049caec..5cf70419d 100644 --- a/src/Examine.Core/PublicAPI.Shipped.txt +++ b/src/Examine.Core/PublicAPI.Shipped.txt @@ -1,3 +1,4 @@ +#nullable enable abstract Examine.BaseIndexProvider.CreateIndex() -> void abstract Examine.BaseIndexProvider.IndexExists() -> bool abstract Examine.BaseIndexProvider.PerformDeleteFromIndex(System.Collections.Generic.IEnumerable itemIds, System.Action onComplete) -> void diff --git a/src/Examine.Host/Examine.csproj b/src/Examine.Host/Examine.csproj index 84682c04a..dde7336d1 100644 --- a/src/Examine.Host/Examine.csproj +++ b/src/Examine.Host/Examine.csproj @@ -6,6 +6,7 @@ True enable 9 + RS0036 diff --git a/src/Examine.Host/PublicAPI.Shipped.txt b/src/Examine.Host/PublicAPI.Shipped.txt index e2586438e..bef45fdef 100644 --- a/src/Examine.Host/PublicAPI.Shipped.txt +++ b/src/Examine.Host/PublicAPI.Shipped.txt @@ -1,3 +1,4 @@ +#nullable enable Examine.AspNetCoreApplicationIdentifier Examine.AspNetCoreApplicationIdentifier.AspNetCoreApplicationIdentifier(System.IServiceProvider services) -> void Examine.AspNetCoreApplicationIdentifier.GetApplicationUniqueIdentifier() -> string diff --git a/src/Examine.Host/PublicAPI.Unshipped.txt b/src/Examine.Host/PublicAPI.Unshipped.txt index e69de29bb..7dc5c5811 100644 --- a/src/Examine.Host/PublicAPI.Unshipped.txt +++ b/src/Examine.Host/PublicAPI.Unshipped.txt @@ -0,0 +1 @@ +#nullable enable diff --git a/src/Examine.Lucene/Examine.Lucene.csproj b/src/Examine.Lucene/Examine.Lucene.csproj index e944adab0..964b22f97 100644 --- a/src/Examine.Lucene/Examine.Lucene.csproj +++ b/src/Examine.Lucene/Examine.Lucene.csproj @@ -7,6 +7,7 @@ True enable 9 + RS0036 diff --git a/src/Examine.Lucene/PublicAPI.Shipped.txt b/src/Examine.Lucene/PublicAPI.Shipped.txt index f6c62cc63..d2fc027cc 100644 --- a/src/Examine.Lucene/PublicAPI.Shipped.txt +++ b/src/Examine.Lucene/PublicAPI.Shipped.txt @@ -1,3 +1,4 @@ +#nullable enable abstract Examine.Lucene.Directories.DirectoryFactoryBase.CreateDirectory(Examine.Lucene.Providers.LuceneIndex luceneIndex, bool forceUnlock) -> Lucene.Net.Store.Directory abstract Examine.Lucene.Indexing.IndexFieldRangeValueType.GetQuery(T? lower, T? upper, bool lowerInclusive = true, bool upperInclusive = true) -> Lucene.Net.Search.Query abstract Examine.Lucene.Indexing.IndexFieldValueTypeBase.AddSingleValue(Lucene.Net.Documents.Document doc, object value) -> void diff --git a/src/Examine.Lucene/PublicAPI.Unshipped.txt b/src/Examine.Lucene/PublicAPI.Unshipped.txt index e69de29bb..7dc5c5811 100644 --- a/src/Examine.Lucene/PublicAPI.Unshipped.txt +++ b/src/Examine.Lucene/PublicAPI.Unshipped.txt @@ -0,0 +1 @@ +#nullable enable From 62bd01302c5b10f564d987c9672c6d8fbdfe0b00 Mon Sep 17 00:00:00 2001 From: Chad Currie Date: Sun, 30 Jul 2023 00:14:44 +1200 Subject: [PATCH 09/12] Ensure backwards compatibility with v3. Ensure new api's don't create back compatabiltiy issues for future releases. --- src/Examine.Core/Search/IFacetOperations.cs | 16 +- .../ServicesCollectionExtensions.cs | 68 +++++- .../Directories/DirectoryFactory.cs | 18 +- src/Examine.Lucene/Indexing/DateTimeType.cs | 5 +- src/Examine.Lucene/Indexing/DoubleType.cs | 6 +- src/Examine.Lucene/Indexing/FullTextType.cs | 7 +- src/Examine.Lucene/Indexing/Int32Type.cs | 6 +- src/Examine.Lucene/Indexing/Int64Type.cs | 6 +- src/Examine.Lucene/Indexing/SingleType.cs | 6 +- .../Providers/BaseLuceneSearcher.cs | 31 +++ .../Providers/LuceneSearcher.cs | 16 ++ .../Providers/MultiIndexSearcher.cs | 26 +++ src/Examine.Lucene/ReaderStatus.cs | 6 + .../Search/ILuceneSearchResults.cs | 2 +- .../Search/LuceneFacetOperation.cs | 8 +- .../Search/LuceneQueryOptions.cs | 21 +- .../Search/LuceneSearchExecutor.cs | 15 +- .../Search/LuceneSearchQuery.cs | 29 ++- .../Search/LuceneSearchResults.cs | 14 +- .../ValueTypeFactoryCollection.cs | 48 ++--- .../Options/ConfigureOptionsTests.cs | 2 +- .../Examine.Lucene/Search/FluentApiTests.cs | 194 +++++++++--------- src/Examine.Web.Demo/Pages/FacetSearch.razor | 4 +- 23 files changed, 387 insertions(+), 167 deletions(-) create mode 100644 src/Examine.Lucene/ReaderStatus.cs diff --git a/src/Examine.Core/Search/IFacetOperations.cs b/src/Examine.Core/Search/IFacetOperations.cs index c0439398b..bb1f8687a 100644 --- a/src/Examine.Core/Search/IFacetOperations.cs +++ b/src/Examine.Core/Search/IFacetOperations.cs @@ -8,14 +8,6 @@ namespace Examine.Search /// public interface IFacetOperations : IQueryExecutor { - /// - /// Add a facet string to the current query - /// - /// - /// - /// - IFacetOperations Facet(string field, Action? facetConfiguration = null); - /// /// Add a facet string to the current query, filtered by a single value or multiple values /// @@ -23,21 +15,21 @@ public interface IFacetOperations : IQueryExecutor /// /// /// - IFacetOperations Facet(string field, Action? facetConfiguration = null, params string[] values); + IFacetOperations FacetString(string field, Action? facetConfiguration = null, params string[] values); /// /// Add a range facet to the current query /// - IFacetOperations Facet(string field, params DoubleRange[] doubleRanges); + IFacetOperations FacetDoubleRange(string field, params DoubleRange[] doubleRanges); /// /// Add a range facet to the current query /// - IFacetOperations Facet(string field, params FloatRange[] floatRanges); + IFacetOperations FacetFloatRange(string field, params FloatRange[] floatRanges); /// /// Add a range facet to the current query /// - IFacetOperations Facet(string field, params Int64Range[] longRanges); + IFacetOperations FacetLongRange(string field, params Int64Range[] longRanges); } } diff --git a/src/Examine.Host/ServicesCollectionExtensions.cs b/src/Examine.Host/ServicesCollectionExtensions.cs index 8594e121d..0f0ad87ad 100644 --- a/src/Examine.Host/ServicesCollectionExtensions.cs +++ b/src/Examine.Host/ServicesCollectionExtensions.cs @@ -19,6 +19,49 @@ namespace Examine /// public static class ServicesCollectionExtensions { + /// + /// Registers a file system based Lucene Examine index + /// + [Obsolete("To remove in Examine V5")] + public static IServiceCollection AddExamineLuceneIndex( + this IServiceCollection serviceCollection, + string name, + FieldDefinitionCollection fieldDefinitions = null, + Analyzer analyzer = null, + IValueSetValidator validator = null, + IReadOnlyDictionary indexValueTypesFactory = null) + => serviceCollection.AddExamineLuceneIndex(name, fieldDefinitions, analyzer, validator, indexValueTypesFactory); + + /// + /// Registers a file system based Lucene Examine index + /// + [Obsolete("To remove in Examine V5")] + public static IServiceCollection AddExamineLuceneIndex( + this IServiceCollection serviceCollection, + string name, + FieldDefinitionCollection fieldDefinitions = null, + Analyzer analyzer = null, + IValueSetValidator validator = null, + IReadOnlyDictionary indexValueTypesFactory = null) + where TIndex : LuceneIndex + => serviceCollection.AddExamineLuceneIndex(name, fieldDefinitions, analyzer, validator, indexValueTypesFactory, null); + + /// + /// Registers an Examine index + /// + [Obsolete("To remove in Examien V5")] + public static IServiceCollection AddExamineLuceneIndex( + this IServiceCollection serviceCollection, + string name, + FieldDefinitionCollection fieldDefinitions = null, + Analyzer analyzer = null, + IValueSetValidator validator = null, + IReadOnlyDictionary indexValueTypesFactory = null) + where TIndex : LuceneIndex + where TDirectoryFactory : class, IDirectoryFactory + { + return serviceCollection.AddExamineLuceneIndex(name, fieldDefinitions, analyzer, validator, indexValueTypesFactory, null); + } /// /// Registers a file system based Lucene Examine index @@ -26,12 +69,12 @@ public static class ServicesCollectionExtensions public static IServiceCollection AddExamineLuceneIndex( this IServiceCollection serviceCollection, string name, + FacetsConfig? facetsConfig, FieldDefinitionCollection? fieldDefinitions = null, Analyzer? analyzer = null, IValueSetValidator? validator = null, - IReadOnlyDictionary? indexValueTypesFactory = null, - FacetsConfig? facetsConfig = null) - => serviceCollection.AddExamineLuceneIndex(name, fieldDefinitions, analyzer, validator, indexValueTypesFactory, facetsConfig); + IReadOnlyDictionary? indexValueTypesFactory = null) + => serviceCollection.AddExamineLuceneIndex(name, facetsConfig, fieldDefinitions, analyzer, validator, indexValueTypesFactory); /// /// Registers a file system based Lucene Examine index @@ -39,11 +82,11 @@ public static IServiceCollection AddExamineLuceneIndex( public static IServiceCollection AddExamineLuceneIndex( this IServiceCollection serviceCollection, string name, + FacetsConfig? facetsConfig, FieldDefinitionCollection? fieldDefinitions = null, Analyzer? analyzer = null, IValueSetValidator? validator = null, - IReadOnlyDictionary? indexValueTypesFactory = null, - FacetsConfig? facetsConfig = null) + IReadOnlyDictionary? indexValueTypesFactory = null) where TIndex : LuceneIndex => serviceCollection.AddExamineLuceneIndex(name, fieldDefinitions, analyzer, validator, indexValueTypesFactory, facetsConfig); @@ -167,8 +210,19 @@ public static IServiceCollection AddExamineLuceneMultiSearcher( this IServiceCollection serviceCollection, string name, string[] indexNames, - Analyzer analyzer = null, - FacetsConfig facetsConfig = null) + Analyzer analyzer = null) + => AddExamineLuceneMultiSearcher(serviceCollection, name, indexNames, default, analyzer); + + + /// + /// Registers a lucene multi index searcher + /// + public static IServiceCollection AddExamineLuceneMultiSearcher( + this IServiceCollection serviceCollection, + string name, + string[] indexNames, + FacetsConfig facetsConfig, + Analyzer analyzer = null) => serviceCollection.AddExamineSearcher(name, s => { IEnumerable matchedIndexes = s.GetServices() diff --git a/src/Examine.Lucene/Directories/DirectoryFactory.cs b/src/Examine.Lucene/Directories/DirectoryFactory.cs index c55000baf..7a55cf86b 100644 --- a/src/Examine.Lucene/Directories/DirectoryFactory.cs +++ b/src/Examine.Lucene/Directories/DirectoryFactory.cs @@ -8,10 +8,17 @@ namespace Examine.Lucene.Directories public class GenericDirectoryFactory : DirectoryFactoryBase { private readonly Func _factory; - private readonly Func _taxonomyDirectoryFactory; - + private readonly Func? _taxonomyDirectoryFactory; + /// - public GenericDirectoryFactory(Func factory, Func taxonomyDirectoryFactory = null) + [Obsolete("To remove in Examine V5")] + public GenericDirectoryFactory(Func factory) + { + _factory = factory; + } + + /// + public GenericDirectoryFactory(Func factory, Func taxonomyDirectoryFactory) { _factory = factory; _taxonomyDirectoryFactory = taxonomyDirectoryFactory; @@ -31,6 +38,11 @@ protected override Directory CreateDirectory(LuceneIndex luceneIndex, bool force /// protected override Directory CreateTaxonomyDirectory(LuceneIndex luceneIndex, bool forceUnlock) { + if (_taxonomyDirectoryFactory is null) + { + throw new NullReferenceException("Taxonomy Directory factory is null. Use constructor with all parameters"); + } + Directory dir = _taxonomyDirectoryFactory(luceneIndex.Name + "taxonomy"); if (forceUnlock) { diff --git a/src/Examine.Lucene/Indexing/DateTimeType.cs b/src/Examine.Lucene/Indexing/DateTimeType.cs index f13d6cb49..a8b9f61c0 100644 --- a/src/Examine.Lucene/Indexing/DateTimeType.cs +++ b/src/Examine.Lucene/Indexing/DateTimeType.cs @@ -33,7 +33,7 @@ public class DateTimeType : IndexFieldRangeValueType, IIndexFacetValue public bool IsTaxonomyFaceted => _taxonomyIndex; /// - public DateTimeType(string fieldName, ILoggerFactory logger, DateResolution resolution, bool store, bool isFacetable, bool taxonomyIndex) + public DateTimeType(string fieldName, bool store, bool isFacetable, bool taxonomyIndex, ILoggerFactory logger, DateResolution resolution) : base(fieldName, logger, store) { Resolution = resolution; @@ -42,7 +42,10 @@ public DateTimeType(string fieldName, ILoggerFactory logger, DateResolution reso } /// + [Obsolete("To be removed in Examine V5")] +#pragma warning disable RS0027 // API with optional parameter(s) should have the most parameters amongst its public overloads public DateTimeType(string fieldName, ILoggerFactory logger, DateResolution resolution, bool store = true) +#pragma warning restore RS0027 // API with optional parameter(s) should have the most parameters amongst its public overloads : base(fieldName, logger, store) { Resolution = resolution; diff --git a/src/Examine.Lucene/Indexing/DoubleType.cs b/src/Examine.Lucene/Indexing/DoubleType.cs index c7afdaee6..7afa59686 100644 --- a/src/Examine.Lucene/Indexing/DoubleType.cs +++ b/src/Examine.Lucene/Indexing/DoubleType.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using Examine.Lucene.Providers; using Examine.Lucene.Search; @@ -19,7 +20,7 @@ public class DoubleType : IndexFieldRangeValueType, IIndexFacetValueType private readonly bool _taxonomyIndex; /// - public DoubleType(string fieldName, ILoggerFactory logger, bool store, bool isFacetable, bool taxonomyIndex = false) + public DoubleType(string fieldName, bool isFacetable, bool taxonomyIndex, ILoggerFactory logger, bool store) : base(fieldName, logger, store) { _isFacetable = isFacetable; @@ -27,7 +28,10 @@ public DoubleType(string fieldName, ILoggerFactory logger, bool store, bool isFa } /// + [Obsolete("To be removed in Examine V5")] +#pragma warning disable RS0027 // API with optional parameter(s) should have the most parameters amongst its public overloads public DoubleType(string fieldName, ILoggerFactory logger, bool store = true) +#pragma warning restore RS0027 // API with optional parameter(s) should have the most parameters amongst its public overloads : base(fieldName, logger, store) { _isFacetable = false; diff --git a/src/Examine.Lucene/Indexing/FullTextType.cs b/src/Examine.Lucene/Indexing/FullTextType.cs index d0437e5db..5450b7c9e 100644 --- a/src/Examine.Lucene/Indexing/FullTextType.cs +++ b/src/Examine.Lucene/Indexing/FullTextType.cs @@ -43,11 +43,11 @@ public class FullTextType : IndexFieldValueTypeBase, IIndexFacetValueType /// /// Defaults to /// - public FullTextType(string fieldName, ILoggerFactory logger, bool sortable = false, bool isFacetable = false, Analyzer? analyzer = null, bool taxonomyIndex = false) + public FullTextType(string fieldName, ILoggerFactory logger, bool isFacetable, bool taxonomyIndex, bool sortable, Analyzer analyzer) : base(fieldName, logger, true) { _sortable = sortable; - _analyzer = analyzer ?? new CultureInvariantStandardAnalyzer(); + _analyzer = analyzer; _isFacetable = isFacetable; _taxonomyIndex = taxonomyIndex; } @@ -61,7 +61,10 @@ public FullTextType(string fieldName, ILoggerFactory logger, bool sortable = fal /// Defaults to /// /// + [Obsolete("To be removed in Examine V5")] +#pragma warning disable RS0027 // API with optional parameter(s) should have the most parameters amongst its public overloads public FullTextType(string fieldName, ILoggerFactory logger, Analyzer? analyzer = null, bool sortable = false) +#pragma warning restore RS0027 // API with optional parameter(s) should have the most parameters amongst its public overloads : base(fieldName, logger, true) { _sortable = sortable; diff --git a/src/Examine.Lucene/Indexing/Int32Type.cs b/src/Examine.Lucene/Indexing/Int32Type.cs index 2521d9493..19a53f9fe 100644 --- a/src/Examine.Lucene/Indexing/Int32Type.cs +++ b/src/Examine.Lucene/Indexing/Int32Type.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using Examine.Lucene.Providers; using Examine.Lucene.Search; @@ -19,7 +20,7 @@ public class Int32Type : IndexFieldRangeValueType, IIndexFacetValueType private readonly bool _taxonomyIndex; /// - public Int32Type(string fieldName, ILoggerFactory logger, bool store, bool isFacetable, bool taxonomyIndex = false) + public Int32Type(string fieldName,bool isFacetable, bool taxonomyIndex, ILoggerFactory logger, bool store) : base(fieldName, logger, store) { _isFacetable = isFacetable; @@ -27,7 +28,10 @@ public Int32Type(string fieldName, ILoggerFactory logger, bool store, bool isFac } /// + [Obsolete("To be removed in Examine V5")] +#pragma warning disable RS0027 // API with optional parameter(s) should have the most parameters amongst its public overloads public Int32Type(string fieldName, ILoggerFactory logger, bool store = true) +#pragma warning restore RS0027 // API with optional parameter(s) should have the most parameters amongst its public overloads : base(fieldName, logger, store) { _isFacetable = false; diff --git a/src/Examine.Lucene/Indexing/Int64Type.cs b/src/Examine.Lucene/Indexing/Int64Type.cs index 524124155..8576c2b0c 100644 --- a/src/Examine.Lucene/Indexing/Int64Type.cs +++ b/src/Examine.Lucene/Indexing/Int64Type.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using Examine.Lucene.Providers; using Examine.Lucene.Search; @@ -19,7 +20,7 @@ public class Int64Type : IndexFieldRangeValueType, IIndexFacetValueType private readonly bool _taxonomyIndex; /// - public Int64Type(string fieldName, ILoggerFactory logger, bool store, bool isFacetable, bool taxonomyIndex = false) + public Int64Type(string fieldName, bool isFacetable, bool taxonomyIndex, ILoggerFactory logger, bool store) : base(fieldName, logger, store) { _isFacetable = isFacetable; @@ -27,7 +28,10 @@ public Int64Type(string fieldName, ILoggerFactory logger, bool store, bool isFac } /// + [Obsolete("To be removed in Examine V5")] +#pragma warning disable RS0027 // API with optional parameter(s) should have the most parameters amongst its public overloads public Int64Type(string fieldName, ILoggerFactory logger, bool store = true) +#pragma warning restore RS0027 // API with optional parameter(s) should have the most parameters amongst its public overloads : base(fieldName, logger, store) { _isFacetable = false; diff --git a/src/Examine.Lucene/Indexing/SingleType.cs b/src/Examine.Lucene/Indexing/SingleType.cs index 132877f2d..643539e72 100644 --- a/src/Examine.Lucene/Indexing/SingleType.cs +++ b/src/Examine.Lucene/Indexing/SingleType.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Generic; using Examine.Lucene.Providers; using Examine.Lucene.Search; @@ -20,7 +21,7 @@ public class SingleType : IndexFieldRangeValueType, IIndexFacetValueType private readonly bool _taxonomyIndex; /// - public SingleType(string fieldName, ILoggerFactory logger, bool store, bool isFacetable, bool taxonomyIndex = false) + public SingleType(string fieldName, bool isFacetable, bool taxonomyIndex, ILoggerFactory logger, bool store) : base(fieldName, logger, store) { _isFacetable = isFacetable; @@ -28,7 +29,10 @@ public SingleType(string fieldName, ILoggerFactory logger, bool store, bool isFa } /// + [Obsolete("To be removed in Examine V5")] +#pragma warning disable RS0027 // API with optional parameter(s) should have the most parameters amongst its public overloads public SingleType(string fieldName, ILoggerFactory logger, bool store = true) +#pragma warning restore RS0027 // API with optional parameter(s) should have the most parameters amongst its public overloads : base(fieldName, logger, store) { _isFacetable = false; diff --git a/src/Examine.Lucene/Providers/BaseLuceneSearcher.cs b/src/Examine.Lucene/Providers/BaseLuceneSearcher.cs index c66b67cb7..ef8698bbb 100644 --- a/src/Examine.Lucene/Providers/BaseLuceneSearcher.cs +++ b/src/Examine.Lucene/Providers/BaseLuceneSearcher.cs @@ -14,6 +14,24 @@ public abstract class BaseLuceneSearcher : BaseSearchProvider, IDisposable { private readonly FacetsConfig _facetsConfig; + /// + /// Constructor to allow for creating an indexer at runtime + /// + /// + /// + [Obsolete("To remove in Examine V5")] + protected BaseLuceneSearcher(string name, Analyzer analyzer) + : base(name) + { + if (string.IsNullOrWhiteSpace(name)) + { + throw new ArgumentException("Value cannot be null or whitespace.", nameof(name)); + } + + LuceneAnalyzer = analyzer; + _facetsConfig = GetDefaultFacetConfig(); + } + /// /// Constructor to allow for creating an indexer at runtime /// @@ -24,7 +42,10 @@ protected BaseLuceneSearcher(string name, Analyzer analyzer, FacetsConfig facets : base(name) { if (string.IsNullOrWhiteSpace(name)) + { throw new ArgumentException("Value cannot be null or whitespace.", nameof(name)); + } + LuceneAnalyzer = analyzer; _facetsConfig = facetsConfig; } @@ -69,6 +90,16 @@ public override ISearchResults Search(string searchText, QueryOptions? options = return sc.Execute(options); } + /// + /// Gets a FacetConfig with default configuration + /// + /// Facet Config + [Obsolete("To remove in Examine V5")] + public virtual FacetsConfig GetDefaultFacetConfig() + { + return new FacetsConfig(); + } + /// public virtual void Dispose() { diff --git a/src/Examine.Lucene/Providers/LuceneSearcher.cs b/src/Examine.Lucene/Providers/LuceneSearcher.cs index 7d29f79cc..b8af8629c 100644 --- a/src/Examine.Lucene/Providers/LuceneSearcher.cs +++ b/src/Examine.Lucene/Providers/LuceneSearcher.cs @@ -16,6 +16,22 @@ public class LuceneSearcher : BaseLuceneSearcher, IDisposable private readonly FieldValueTypeCollection _fieldValueTypeCollection; private bool _disposedValue; + + /// + /// Constructor allowing for creating a NRT instance based on a given writer + /// + /// + /// + /// + /// + [Obsolete("To remove in Examine V5")] + public LuceneSearcher(string name, SearcherManager searcherManager, Analyzer analyzer, FieldValueTypeCollection fieldValueTypeCollection) + : base(name, analyzer) + { + _searcherManager = searcherManager; + _fieldValueTypeCollection = fieldValueTypeCollection; + } + /// /// Constructor allowing for creating a NRT instance based on a given writer /// diff --git a/src/Examine.Lucene/Providers/MultiIndexSearcher.cs b/src/Examine.Lucene/Providers/MultiIndexSearcher.cs index 1689ae5bc..3a134dfc3 100644 --- a/src/Examine.Lucene/Providers/MultiIndexSearcher.cs +++ b/src/Examine.Lucene/Providers/MultiIndexSearcher.cs @@ -15,6 +15,32 @@ public class MultiIndexSearcher : BaseLuceneSearcher { private readonly Lazy> _searchers; + /// + /// Constructor to allow for creating a searcher at runtime + /// + /// + /// + /// + [Obsolete("To remove in Examine V5")] + public MultiIndexSearcher(string name, IEnumerable indexes, Analyzer analyzer = null) + : base(name, analyzer ?? new StandardAnalyzer(LuceneInfo.CurrentVersion)) + { + _searchers = new Lazy>(() => indexes.Select(x => x.Searcher)); + } + + /// + /// Constructor to allow for creating a searcher at runtime + /// + /// + /// + /// + [Obsolete("To remove in Examine V5")] + public MultiIndexSearcher(string name, Lazy> searchers, Analyzer analyzer = null) + : base(name, analyzer ?? new StandardAnalyzer(LuceneInfo.CurrentVersion)) + { + _searchers = searchers; + } + /// /// Constructor to allow for creating a searcher at runtime diff --git a/src/Examine.Lucene/ReaderStatus.cs b/src/Examine.Lucene/ReaderStatus.cs new file mode 100644 index 000000000..de99d68ba --- /dev/null +++ b/src/Examine.Lucene/ReaderStatus.cs @@ -0,0 +1,6 @@ +using System; +namespace Examine.Lucene +{ + [Obsolete("To remove in Examine V5")] + public enum ReaderStatus { Current, Closed, NotCurrent } +} diff --git a/src/Examine.Lucene/Search/ILuceneSearchResults.cs b/src/Examine.Lucene/Search/ILuceneSearchResults.cs index 1f45ea1da..5ff67820d 100644 --- a/src/Examine.Lucene/Search/ILuceneSearchResults.cs +++ b/src/Examine.Lucene/Search/ILuceneSearchResults.cs @@ -8,7 +8,7 @@ public interface ILuceneSearchResults : ISearchResults /// /// Options for Searching After. Used for efficent deep paging. /// - SearchAfterOptions SearchAfter { get; } + SearchAfterOptions? SearchAfter { get; } /// /// Returns the maximum score value encountered. Note that in case diff --git a/src/Examine.Lucene/Search/LuceneFacetOperation.cs b/src/Examine.Lucene/Search/LuceneFacetOperation.cs index 0452834d5..d6bc4505a 100644 --- a/src/Examine.Lucene/Search/LuceneFacetOperation.cs +++ b/src/Examine.Lucene/Search/LuceneFacetOperation.cs @@ -29,16 +29,16 @@ public LuceneFacetOperation(LuceneSearchQuery search) public IFacetOperations Facet(string field, Action? facetConfiguration = null) => _search.FacetInternal(field, facetConfiguration, Array.Empty()); /// - public IFacetOperations Facet(string field, Action? facetConfiguration = null, params string[] values) => _search.FacetInternal(field, facetConfiguration, values); + public IFacetOperations FacetString(string field, Action? facetConfiguration = null, params string[] values) => _search.FacetInternal(field, facetConfiguration, values); /// - public IFacetOperations Facet(string field, params DoubleRange[] doubleRanges) => _search.FacetInternal(field, doubleRanges); + public IFacetOperations FacetDoubleRange(string field, params DoubleRange[] doubleRanges) => _search.FacetInternal(field, doubleRanges); /// - public IFacetOperations Facet(string field, params FloatRange[] floatRanges) => _search.FacetInternal(field, floatRanges); + public IFacetOperations FacetFloatRange(string field, params FloatRange[] floatRanges) => _search.FacetInternal(field, floatRanges); /// - public IFacetOperations Facet(string field, params Int64Range[] longRanges) => _search.FacetInternal(field, longRanges); + public IFacetOperations FacetLongRange(string field, params Int64Range[] longRanges) => _search.FacetInternal(field, longRanges); /// public override string ToString() => _search.ToString(); diff --git a/src/Examine.Lucene/Search/LuceneQueryOptions.cs b/src/Examine.Lucene/Search/LuceneQueryOptions.cs index c941c37cb..db4e5c515 100644 --- a/src/Examine.Lucene/Search/LuceneQueryOptions.cs +++ b/src/Examine.Lucene/Search/LuceneQueryOptions.cs @@ -16,8 +16,27 @@ public class LuceneQueryOptions : QueryOptions /// Optionally skip to results after the results from the previous search execution. Used for efficent deep paging. /// Whether to track the maximum document score. For best performance, if not needed, leave false. /// Whether to Track Document Scores. For best performance, if not needed, leave false. + [Obsolete("To remove in Examine 5.0")] +#pragma warning disable RS0027 // API with optional parameter(s) should have the most parameters amongst its public overloads + public LuceneQueryOptions(int skip, int? take = null, SearchAfterOptions? searchAfter = null, bool trackDocumentScores = false, bool trackDocumentMaxScore = false) +#pragma warning restore RS0027 // API with optional parameter(s) should have the most parameters amongst its public overloads + : base(skip, take) + { + TrackDocumentScores = trackDocumentScores; + TrackDocumentMaxScore = trackDocumentMaxScore; + SearchAfter = searchAfter; + } + + /// + /// Constructor + /// /// Whether to apply Facet sampling to improve performance. If not required, leave null - public LuceneQueryOptions(int skip, int? take = null, SearchAfterOptions? searchAfter = null, bool trackDocumentScores = false, bool trackDocumentMaxScore = false, LuceneFacetSamplingQueryOptions? facetSampling = null) + /// Number of result documents to skip. + /// Optional number of result documents to take. + /// Optionally skip to results after the results from the previous search execution. Used for efficent deep paging. + /// Whether to track the maximum document score. For best performance, if not needed, leave false. + /// Whether to Track Document Scores. For best performance, if not needed, leave false. + public LuceneQueryOptions(LuceneFacetSamplingQueryOptions? facetSampling, int skip, int? take, SearchAfterOptions? searchAfter, bool trackDocumentScores, bool trackDocumentMaxScore) : base(skip, take) { TrackDocumentScores = trackDocumentScores; diff --git a/src/Examine.Lucene/Search/LuceneSearchExecutor.cs b/src/Examine.Lucene/Search/LuceneSearchExecutor.cs index 9e59f35f0..3d8e6ceee 100644 --- a/src/Examine.Lucene/Search/LuceneSearchExecutor.cs +++ b/src/Examine.Lucene/Search/LuceneSearchExecutor.cs @@ -30,7 +30,7 @@ public class LuceneSearchExecutor private int? _maxDoc; internal LuceneSearchExecutor(QueryOptions? options, Query query, IEnumerable sortField, ISearchContext searchContext, - ISet fieldsToLoad, IEnumerable facetFields, FacetsConfig facetsConfig) + ISet fieldsToLoad, IEnumerable? facetFields, FacetsConfig? facetsConfig) { _options = options ?? QueryOptions.Default; _luceneQueryOptions = _options as LuceneQueryOptions; @@ -132,11 +132,11 @@ public ISearchResults Execute() topDocsCollector = TopScoreDocCollector.Create(numHits, scoreDocAfter, true); } FacetsCollector facetsCollector = null; - if (_facetFields.Any() && _luceneQueryOptions != null && _luceneQueryOptions.FacetRandomSampling != null) + if (_facetFields != null && _facetFields.Any() && _luceneQueryOptions != null && _luceneQueryOptions.FacetRandomSampling != null) { var facetsCollectors = new RandomSamplingFacetsCollector(_luceneQueryOptions.FacetRandomSampling.SampleSize, _luceneQueryOptions.FacetRandomSampling.Seed); } - else if (_facetFields.Any()) + else if (_facetFields != null && _facetFields.Any()) { facetsCollector = new FacetsCollector(); } @@ -236,7 +236,7 @@ private static SearchAfterOptions GetSearchAfterOptions(TopDocs topDocs) private IReadOnlyDictionary ExtractFacets(FacetsCollector? facetsCollector, ISearcherReference searcher) { var facets = new Dictionary(StringComparer.InvariantCultureIgnoreCase); - if (facetsCollector == null || !_facetFields.Any()) + if (facetsCollector == null || _facetFields is null || !_facetFields.Any()) { return facets; } @@ -252,10 +252,15 @@ private IReadOnlyDictionary ExtractFacets(FacetsCollector? var valueType = _searchContext.GetFieldValueType(field.Field); if (valueType is IIndexFacetValueType facetValueType) { + if (_facetsConfig is null) + { + throw new InvalidOperationException("Facets Config not set. Please use a constructor that passes all parameters"); + } + var facetExtractionContext = new LuceneFacetExtractionContext(facetsCollector, searcher, _facetsConfig); var fieldFacets = facetValueType.ExtractFacets(facetExtractionContext, field); - foreach(var fieldFacet in fieldFacets) + foreach (var fieldFacet in fieldFacets) { // overwrite if necessary (no exceptions thrown in case of collision) facets[fieldFacet.Key] = fieldFacet.Value; diff --git a/src/Examine.Lucene/Search/LuceneSearchQuery.cs b/src/Examine.Lucene/Search/LuceneSearchQuery.cs index 7047fe8f8..ec71e2175 100644 --- a/src/Examine.Lucene/Search/LuceneSearchQuery.cs +++ b/src/Examine.Lucene/Search/LuceneSearchQuery.cs @@ -17,10 +17,20 @@ namespace Examine.Lucene.Search public class LuceneSearchQuery : LuceneSearchQueryBase, IQueryExecutor { private readonly ISearchContext _searchContext; - private readonly FacetsConfig _facetsConfig; + private readonly FacetsConfig? _facetsConfig; private ISet? _fieldsToLoad = null; private readonly IList _facetFields = new List(); + /// + [Obsolete("To be removed in Examine V5")] + public LuceneSearchQuery( + ISearchContext searchContext, + string category, Analyzer analyzer, LuceneSearchOptions searchOptions, BooleanOperation occurance) + : base(CreateQueryParser(searchContext, analyzer, searchOptions), category, searchOptions, occurance) + { + _searchContext = searchContext; + } + /// public LuceneSearchQuery( ISearchContext searchContext, @@ -248,7 +258,7 @@ private ISearchResults Search(QueryOptions? options) } } - var executor = new LuceneSearchExecutor(options, query, SortFields, _searchContext, _fieldsToLoad, _facetFields,_facetsConfig); + var executor = new LuceneSearchExecutor(options, query, SortFields, _searchContext, _fieldsToLoad, _facetFields, _facetsConfig); var pagesResults = executor.Execute(); @@ -406,6 +416,11 @@ internal IFacetOperations FacetInternal(string field, params Int64Range[] longRa private string GetFacetField(string field) { + if(_facetsConfig is null) + { + throw new InvalidOperationException("FacetsConfig not set. User a LuceneSearchQuery constructor with all parameters"); + } + if (_facetsConfig.DimConfigs.ContainsKey(field)) { return _facetsConfig.DimConfigs[field].IndexFieldName; @@ -414,6 +429,11 @@ private string GetFacetField(string field) } private bool GetFacetFieldIsMultiValued(string field) { + if (_facetsConfig is null) + { + throw new InvalidOperationException("FacetsConfig not set. User a LuceneSearchQuery constructor with all parameters"); + } + if (_facetsConfig.DimConfigs.ContainsKey(field)) { return _facetsConfig.DimConfigs[field].IsMultiValued; @@ -422,6 +442,11 @@ private bool GetFacetFieldIsMultiValued(string field) } private bool GetFacetFieldIsHierarchical(string field) { + if (_facetsConfig is null) + { + throw new InvalidOperationException("FacetsConfig not set. User a LuceneSearchQuery constructor with all parameters"); + } + if (_facetsConfig.DimConfigs.ContainsKey(field)) { return _facetsConfig.DimConfigs[field].IsHierarchical; diff --git a/src/Examine.Lucene/Search/LuceneSearchResults.cs b/src/Examine.Lucene/Search/LuceneSearchResults.cs index ab630fab1..f83ffa80e 100644 --- a/src/Examine.Lucene/Search/LuceneSearchResults.cs +++ b/src/Examine.Lucene/Search/LuceneSearchResults.cs @@ -10,6 +10,8 @@ namespace Examine.Lucene.Search /// public class LuceneSearchResults : ISearchResults, ILuceneSearchResults, IFacetResults { + private readonly IReadOnlyDictionary _noFacets = new Dictionary(0, StringComparer.InvariantCultureIgnoreCase); + /// /// Gets an empty search result /// @@ -17,6 +19,16 @@ public class LuceneSearchResults : ISearchResults, ILuceneSearchResults, IFacetR private readonly IReadOnlyCollection _results; + /// + [Obsolete("To remove in Examine V5")] + public LuceneSearchResults(IReadOnlyCollection results, int totalItemCount) + { + _results = results; + TotalItemCount = totalItemCount; + MaxScore = float.NaN; + Facets = _noFacets; + } + /// public LuceneSearchResults(IReadOnlyCollection results, int totalItemCount, IReadOnlyDictionary facets, float maxScore, SearchAfterOptions searchAfterOptions) { @@ -39,7 +51,7 @@ public LuceneSearchResults(IReadOnlyCollection results, int total /// /// Options for skipping documents after a previous search /// - public SearchAfterOptions SearchAfter { get; } + public SearchAfterOptions? SearchAfter { get; } /// public IReadOnlyDictionary Facets { get; } diff --git a/src/Examine.Lucene/ValueTypeFactoryCollection.cs b/src/Examine.Lucene/ValueTypeFactoryCollection.cs index c325b3fb5..9b0c2177b 100644 --- a/src/Examine.Lucene/ValueTypeFactoryCollection.cs +++ b/src/Examine.Lucene/ValueTypeFactoryCollection.cs @@ -86,30 +86,30 @@ private static IReadOnlyDictionary> G {FieldDefinitionTypes.FullTextSortable, name => new FullTextType(name, loggerFactory, defaultAnalyzer, true)}, {FieldDefinitionTypes.InvariantCultureIgnoreCase, name => new GenericAnalyzerFieldValueType(name, loggerFactory, new CultureInvariantWhitespaceAnalyzer())}, {FieldDefinitionTypes.EmailAddress, name => new GenericAnalyzerFieldValueType(name, loggerFactory, new EmailAddressAnalyzer())}, - {FieldDefinitionTypes.FacetInteger, name => new Int32Type(name, loggerFactory, true, true, false)}, - {FieldDefinitionTypes.FacetFloat, name => new SingleType(name, loggerFactory, true, true, false)}, - {FieldDefinitionTypes.FacetDouble, name => new DoubleType(name, loggerFactory, true, true, false)}, - {FieldDefinitionTypes.FacetLong, name => new Int64Type(name, loggerFactory, true, true, false)}, - {FieldDefinitionTypes.FacetDateTime, name => new DateTimeType(name, loggerFactory, DateResolution.MILLISECOND, true, true, false)}, - {FieldDefinitionTypes.FacetDateYear, name => new DateTimeType(name, loggerFactory, DateResolution.YEAR, true, true, false)}, - {FieldDefinitionTypes.FacetDateMonth, name => new DateTimeType(name, loggerFactory, DateResolution.MONTH, true, true, false)}, - {FieldDefinitionTypes.FacetDateDay, name => new DateTimeType(name, loggerFactory, DateResolution.DAY, true, true, false)}, - {FieldDefinitionTypes.FacetDateHour, name => new DateTimeType(name, loggerFactory, DateResolution.HOUR, true, true, false)}, - {FieldDefinitionTypes.FacetDateMinute, name => new DateTimeType(name, loggerFactory, DateResolution.MINUTE, true, true, false)}, - {FieldDefinitionTypes.FacetFullText, name => new FullTextType(name, loggerFactory, true, true, defaultAnalyzer)}, - {FieldDefinitionTypes.FacetFullTextSortable, name => new FullTextType(name, loggerFactory, true, true, defaultAnalyzer)}, - {FieldDefinitionTypes.FacetTaxonomyInteger, name => new Int32Type(name, loggerFactory, true,isFacetable: true, taxonomyIndex: true)}, - {FieldDefinitionTypes.FacetTaxonomyFloat, name => new SingleType(name, loggerFactory, true,isFacetable: true, taxonomyIndex: true)}, - {FieldDefinitionTypes.FacetTaxonomyDouble, name => new DoubleType(name, loggerFactory, true,isFacetable: true, taxonomyIndex: true)}, - {FieldDefinitionTypes.FacetTaxonomyLong, name => new Int64Type(name, loggerFactory, true, isFacetable: true, taxonomyIndex: true)}, - {FieldDefinitionTypes.FacetTaxonomyDateTime, name => new DateTimeType(name, loggerFactory, DateResolution.MILLISECOND, true, isFacetable: true, taxonomyIndex: true)}, - {FieldDefinitionTypes.FacetTaxonomyDateYear, name => new DateTimeType(name, loggerFactory, DateResolution.YEAR, true,isFacetable: true, taxonomyIndex: true)}, - {FieldDefinitionTypes.FacetTaxonomyDateMonth, name =>new DateTimeType(name, loggerFactory, DateResolution.MONTH, true,isFacetable: true, taxonomyIndex: true)}, - {FieldDefinitionTypes.FacetTaxonomyDateDay, name =>new DateTimeType(name, loggerFactory, DateResolution.DAY, true,isFacetable: true, taxonomyIndex: true)}, - {FieldDefinitionTypes.FacetTaxonomyDateHour, name => new DateTimeType(name, loggerFactory, DateResolution.HOUR, true,isFacetable: true, taxonomyIndex: true)}, - {FieldDefinitionTypes.FacetTaxonomyDateMinute, name => new DateTimeType(name, loggerFactory, DateResolution.MINUTE, true, isFacetable: true, taxonomyIndex: true)}, - {FieldDefinitionTypes.FacetTaxonomyFullText, name => new FullTextType(name, loggerFactory, false, true, defaultAnalyzer, taxonomyIndex: true)}, - {FieldDefinitionTypes.FacetTaxonomyFullTextSortable, name => new FullTextType(name, loggerFactory, true, true, defaultAnalyzer, taxonomyIndex: true)}, + {FieldDefinitionTypes.FacetInteger, name => new Int32Type(name, true,false,loggerFactory, true)}, + {FieldDefinitionTypes.FacetFloat, name => new SingleType(name, true, false, loggerFactory, true)}, + {FieldDefinitionTypes.FacetDouble, name => new DoubleType(name,true, false, loggerFactory, true)}, + {FieldDefinitionTypes.FacetLong, name => new Int64Type(name, true, false, loggerFactory, true)}, + {FieldDefinitionTypes.FacetDateTime, name => new DateTimeType(name, true, true, false, loggerFactory, DateResolution.MILLISECOND)}, + {FieldDefinitionTypes.FacetDateYear, name => new DateTimeType(name,true, true, false, loggerFactory, DateResolution.YEAR)}, + {FieldDefinitionTypes.FacetDateMonth, name => new DateTimeType(name,true, true, false, loggerFactory, DateResolution.MONTH)}, + {FieldDefinitionTypes.FacetDateDay, name => new DateTimeType(name, true, true, false, loggerFactory, DateResolution.DAY)}, + {FieldDefinitionTypes.FacetDateHour, name => new DateTimeType(name, true, true, false, loggerFactory, DateResolution.HOUR)}, + {FieldDefinitionTypes.FacetDateMinute, name => new DateTimeType(name, true, true, false, loggerFactory, DateResolution.MINUTE)}, + {FieldDefinitionTypes.FacetFullText, name => new FullTextType(name, loggerFactory, true, false, false, defaultAnalyzer ?? new CultureInvariantStandardAnalyzer())}, + {FieldDefinitionTypes.FacetFullTextSortable, name => new FullTextType(name, loggerFactory, true, false,true, defaultAnalyzer ?? new CultureInvariantStandardAnalyzer())}, + {FieldDefinitionTypes.FacetTaxonomyInteger, name => new Int32Type(name,true,true, loggerFactory, true)}, + {FieldDefinitionTypes.FacetTaxonomyFloat, name => new SingleType(name,isFacetable: true, taxonomyIndex: true, loggerFactory, true)}, + {FieldDefinitionTypes.FacetTaxonomyDouble, name => new DoubleType(name, true, true, loggerFactory, true)}, + {FieldDefinitionTypes.FacetTaxonomyLong, name => new Int64Type(name, isFacetable: true, taxonomyIndex: true, loggerFactory, true)}, + {FieldDefinitionTypes.FacetTaxonomyDateTime, name => new DateTimeType(name,true, true, taxonomyIndex : true, loggerFactory, DateResolution.MILLISECOND)}, + {FieldDefinitionTypes.FacetTaxonomyDateYear, name => new DateTimeType(name, true, true, taxonomyIndex : true, loggerFactory, DateResolution.YEAR)}, + {FieldDefinitionTypes.FacetTaxonomyDateMonth, name => new DateTimeType(name, true, true, taxonomyIndex : true, loggerFactory, DateResolution.MONTH)}, + {FieldDefinitionTypes.FacetTaxonomyDateDay, name => new DateTimeType(name, true, true, taxonomyIndex : true, loggerFactory, DateResolution.DAY)}, + {FieldDefinitionTypes.FacetTaxonomyDateHour, name => new DateTimeType(name, true, isFacetable: true, taxonomyIndex: true, loggerFactory, DateResolution.HOUR)}, + {FieldDefinitionTypes.FacetTaxonomyDateMinute, name => new DateTimeType(name, true, true, taxonomyIndex : true, loggerFactory, DateResolution.MINUTE)}, + {FieldDefinitionTypes.FacetTaxonomyFullText, name => new FullTextType(name, loggerFactory, true, true, false, defaultAnalyzer ?? new CultureInvariantStandardAnalyzer())}, + {FieldDefinitionTypes.FacetTaxonomyFullTextSortable, name => new FullTextType(name, loggerFactory, true, true, true, defaultAnalyzer ?? new CultureInvariantStandardAnalyzer())}, }; diff --git a/src/Examine.Test/Examine.Core/Options/ConfigureOptionsTests.cs b/src/Examine.Test/Examine.Core/Options/ConfigureOptionsTests.cs index a4bf18d09..9468cfe9a 100644 --- a/src/Examine.Test/Examine.Core/Options/ConfigureOptionsTests.cs +++ b/src/Examine.Test/Examine.Core/Options/ConfigureOptionsTests.cs @@ -44,7 +44,7 @@ public void Configure(string name, LuceneDirectoryIndexOptions options) } // replace with ram dir - options.DirectoryFactory = new GenericDirectoryFactory(_ => new RandomIdRAMDirectory()); + options.DirectoryFactory = new GenericDirectoryFactory(_ => new RandomIdRAMDirectory(), _ => new RandomIdRAMDirectory()); // customize some fields if (options.FieldDefinitions == null) diff --git a/src/Examine.Test/Examine.Lucene/Search/FluentApiTests.cs b/src/Examine.Test/Examine.Lucene/Search/FluentApiTests.cs index a054531d9..4e4c3cdfa 100644 --- a/src/Examine.Test/Examine.Lucene/Search/FluentApiTests.cs +++ b/src/Examine.Test/Examine.Lucene/Search/FluentApiTests.cs @@ -87,7 +87,7 @@ public void Allow_Leading_Wildcards(FacetTestType withFacets) if (HasFacets(withFacets)) { - var results1 = query1.WithFacets(facets => facets.Facet("nodeName")).Execute(); + var results1 = query1.WithFacets(facets => facets.FacetString("nodeName")).Execute(); var facetResults = results1.GetFacet("nodeName"); @@ -149,7 +149,7 @@ public void NativeQuery_Single_Word(FacetTestType withFacets) if (HasFacets(withFacets)) { - var results = query.WithFacets(facets => facets.Facet("nodeName")).Execute(); + var results = query.WithFacets(facets => facets.FacetString("nodeName")).Execute(); var facetResults = results.GetFacet("nodeName"); @@ -212,7 +212,7 @@ public void Uppercase_Category(FacetTestType withFacets) if (HasFacets(withFacets)) { - var results = query.WithFacets(facets => facets.Facet("nodeName")).Execute(); + var results = query.WithFacets(facets => facets.FacetString("nodeName")).Execute(); var facetResults = results.GetFacet("nodeName"); @@ -258,7 +258,7 @@ public void FacetsConfig_SetIndexName_FullText() Console.WriteLine(query); - var results = query.WithFacets(facets => facets.Facet("nodeName")).Execute(); + var results = query.WithFacets(facets => facets.FacetString("nodeName")).Execute(); var facetResults = results.GetFacet("nodeName"); @@ -299,7 +299,7 @@ public void FacetsConfig_SetIndexName_Long() Console.WriteLine(query); - var results = query.WithFacets(facets => facets.Facet("LongValue", new Int64Range[] + var results = query.WithFacets(facets => facets.FacetLongRange("LongValue", new Int64Range[] { new Int64Range("10", 10, true, 11, true), new Int64Range("20", 20, true, 21, true), @@ -346,7 +346,7 @@ public void FacetsConfig_SetIndexName_Double() Console.WriteLine(query); - var results = query.WithFacets(factes => factes.Facet("DoubleValue", new DoubleRange[] + var results = query.WithFacets(factes => factes.FacetDoubleRange("DoubleValue", new DoubleRange[] { new DoubleRange("10", 10, true, 11, true), new DoubleRange("20", 20, true, 21, true), @@ -395,7 +395,7 @@ public void Taxonomy_FacetsConfig_SetIndexName_FullText() Console.WriteLine(query); - var results = query.WithFacets(facets => facets.Facet("nodeName")).Execute(); + var results = query.WithFacets(facets => facets.FacetString("nodeName")).Execute(); var facetResults = results.GetFacet("nodeName"); @@ -438,7 +438,7 @@ public void Taxonomy_FacetsConfig_SetIndexName_Long() Console.WriteLine(query); - var results = query.WithFacets(facets => facets.Facet("LongValue", new Int64Range[] + var results = query.WithFacets(facets => facets.FacetLongRange("LongValue", new Int64Range[] { new Int64Range("10", 10, true, 11, true), new Int64Range("20", 20, true, 21, true), @@ -487,7 +487,7 @@ public void Taxonomy_FacetsConfig_SetIndexName_Double() Console.WriteLine(query); - var results = query.WithFacets(factes => factes.Facet("DoubleValue", new DoubleRange[] + var results = query.WithFacets(factes => factes.FacetDoubleRange("DoubleValue", new DoubleRange[] { new DoubleRange("10", 10, true, 11, true), new DoubleRange("20", 20, true, 21, true), @@ -547,7 +547,7 @@ public void NativeQuery_Phrase(FacetTestType withFacets) if (HasFacets(withFacets)) { - var results = query.WithFacets(facets => facets.Facet("bodyText")).Execute(); + var results = query.WithFacets(facets => facets.FacetString("bodyText")).Execute(); var facetResults = results.GetFacet("bodyText"); @@ -624,7 +624,7 @@ public void Managed_Range_Date(FacetTestType withFacets) if (HasFacets(withFacets)) { - var numberSortedResult = numberSortedCriteria.WithFacets(facets => facets.Facet("created", new Int64Range[] + var numberSortedResult = numberSortedCriteria.WithFacets(facets => facets.FacetLongRange("created", new Int64Range[] { new Int64Range("First days", new DateTime(2000, 01, 01).Ticks, true, new DateTime(2000, 01, 03).Ticks, true), new Int64Range("Last days", new DateTime(2000, 01, 04).Ticks, true, new DateTime(2000, 01, 06).Ticks, true) @@ -688,7 +688,7 @@ public void Managed_Full_Text(FacetTestType withFacets) { var result = searcher.CreateQuery() .ManagedQuery("darkness") - .WithFacets(facets => facets.Facet("item1")) + .WithFacets(facets => facets.FacetString("item1")) .Execute(); var facetResults = result.GetFacet("item1"); @@ -704,7 +704,7 @@ public void Managed_Full_Text(FacetTestType withFacets) result = searcher.CreateQuery() .ManagedQuery("total darkness") - .WithFacets(facets => facets.Facet("item1")) + .WithFacets(facets => facets.FacetString("item1")) .Execute(); facetResults = result.GetFacet("item1"); @@ -778,7 +778,7 @@ public void Managed_Full_Text_With_Bool(FacetTestType withFacets) if (HasFacets(withFacets)) { - var result = qry.WithFacets(facets => facets.Facet("item1")).Execute(); + var result = qry.WithFacets(facets => facets.FacetString("item1")).Execute(); var facetResults = result.GetFacet("item1"); @@ -793,7 +793,7 @@ public void Managed_Full_Text_With_Bool(FacetTestType withFacets) qry = searcher.CreateQuery().ManagedQuery("darkness") .And(query => query.Field("item1", "value1").Or().Field("item1", "value2"), BooleanOperation.Or); Console.WriteLine(qry); - result = qry.WithFacets(facets => facets.Facet("item1")).Execute(); + result = qry.WithFacets(facets => facets.FacetString("item1")).Execute(); facetResults = result.GetFacet("item1"); @@ -874,7 +874,7 @@ public void Not_Managed_Full_Text(FacetTestType withFacets) if (HasFacets(withFacets)) { - var result = qry.WithFacets(facets => facets.Facet("item1")).Execute(); + var result = qry.WithFacets(facets => facets.FacetString("item1")).Execute(); var facetResults = result.GetFacet("item1"); @@ -967,7 +967,7 @@ public void Managed_Range_Int(FacetTestType withFacets) if (HasFacets(withFacets)) { var numberSortedResult = numberSortedCriteria - .WithFacets(facets => facets.Facet("parentID", new Int64Range[] + .WithFacets(facets => facets.FacetLongRange("parentID", new Int64Range[] { new Int64Range("120-122", 120, true, 122, true), new Int64Range("123-125", 123, true, 125, true) @@ -1053,7 +1053,7 @@ public void Legacy_ParentId(FacetTestType withFacets) if (HasFacets(withFacets)) { - var numberSortedResult = numberSortedCriteria.WithFacets(facets => facets.Facet("parentID")).Execute(); + var numberSortedResult = numberSortedCriteria.WithFacets(facets => facets.FacetString("parentID")).Execute(); var facetResults = numberSortedResult.GetFacet("parentID"); @@ -1136,7 +1136,7 @@ public void Grouped_Or_Examiness(FacetTestType withFacets) if (HasFacets(withFacets)) { - var results = filter.WithFacets(facets => facets.Facet("nodeTypeAlias")).Execute(); + var results = filter.WithFacets(facets => facets.FacetString("nodeTypeAlias")).Execute(); var facetResults = results.GetFacet("nodeTypeAlias"); @@ -1177,35 +1177,35 @@ public void Grouped_Or_Query_Output() Console.WriteLine("GROUPED OR - SINGLE FIELD, MULTI VAL"); var criteria = (LuceneSearchQuery)searcher.CreateQuery(); criteria.Field("__NodeTypeAlias", "myDocumentTypeAlias"); - criteria.GroupedOr(new[] { "id" }.ToList(), new[] { "1", "2", "3" }).WithFacets(facets => facets.Facet("SomeFacet")); + criteria.GroupedOr(new[] { "id" }.ToList(), new[] { "1", "2", "3" }).WithFacets(facets => facets.FacetDoubleRange("SomeFacet")); Console.WriteLine(criteria.Query); Assert.AreEqual("+__NodeTypeAlias:mydocumenttypealias +(id:1 id:2 id:3)", criteria.Query.ToString()); Console.WriteLine("GROUPED OR - MULTI FIELD, MULTI VAL"); criteria = (LuceneSearchQuery)searcher.CreateQuery(); criteria.Field("__NodeTypeAlias", "myDocumentTypeAlias"); - criteria.GroupedOr(new[] { "id", "parentID" }.ToList(), new[] { "1", "2", "3" }).WithFacets(facets => facets.Facet("SomeFacet")); + criteria.GroupedOr(new[] { "id", "parentID" }.ToList(), new[] { "1", "2", "3" }).WithFacets(facets => facets.FacetDoubleRange("SomeFacet")); Console.WriteLine(criteria.Query); Assert.AreEqual("+__NodeTypeAlias:mydocumenttypealias +(id:1 id:2 id:3 parentID:1 parentID:2 parentID:3)", criteria.Query.ToString()); Console.WriteLine("GROUPED OR - MULTI FIELD, EQUAL MULTI VAL"); criteria = (LuceneSearchQuery)searcher.CreateQuery(); criteria.Field("__NodeTypeAlias", "myDocumentTypeAlias"); - criteria.GroupedOr(new[] { "id", "parentID", "blahID" }.ToList(), new[] { "1", "2", "3" }).WithFacets(facets => facets.Facet("SomeFacet")); + criteria.GroupedOr(new[] { "id", "parentID", "blahID" }.ToList(), new[] { "1", "2", "3" }).WithFacets(facets => facets.FacetDoubleRange("SomeFacet")); Console.WriteLine(criteria.Query); Assert.AreEqual("+__NodeTypeAlias:mydocumenttypealias +(id:1 id:2 id:3 parentID:1 parentID:2 parentID:3 blahID:1 blahID:2 blahID:3)", criteria.Query.ToString()); Console.WriteLine("GROUPED OR - MULTI FIELD, SINGLE VAL"); criteria = (LuceneSearchQuery)searcher.CreateQuery(); criteria.Field("__NodeTypeAlias", "myDocumentTypeAlias"); - criteria.GroupedOr(new[] { "id", "parentID" }.ToList(), new[] { "1" }).WithFacets(facets => facets.Facet("SomeFacet")); + criteria.GroupedOr(new[] { "id", "parentID" }.ToList(), new[] { "1" }).WithFacets(facets => facets.FacetDoubleRange("SomeFacet")); Console.WriteLine(criteria.Query); Assert.AreEqual("+__NodeTypeAlias:mydocumenttypealias +(id:1 parentID:1)", criteria.Query.ToString()); Console.WriteLine("GROUPED OR - SINGLE FIELD, SINGLE VAL"); criteria = (LuceneSearchQuery)searcher.CreateQuery(); criteria.Field("__NodeTypeAlias", "myDocumentTypeAlias"); - criteria.GroupedOr(new[] { "id" }.ToList(), new[] { "1" }).WithFacets(facets => facets.Facet("SomeFacet")); + criteria.GroupedOr(new[] { "id" }.ToList(), new[] { "1" }).WithFacets(facets => facets.FacetDoubleRange("SomeFacet")); Console.WriteLine(criteria.Query); Assert.AreEqual("+__NodeTypeAlias:mydocumenttypealias +(id:1)", criteria.Query.ToString()); @@ -1228,7 +1228,7 @@ public void Grouped_And_Query_Output() Console.WriteLine("GROUPED AND - SINGLE FIELD, MULTI VAL"); var criteria = (LuceneSearchQuery)searcher.CreateQuery(); criteria.Field("__NodeTypeAlias", "myDocumentTypeAlias"); - criteria.GroupedAnd(new[] { "id" }.ToList(), new[] { "1", "2", "3" }).WithFacets(facets => facets.Facet("SomeFacet")); + criteria.GroupedAnd(new[] { "id" }.ToList(), new[] { "1", "2", "3" }).WithFacets(facets => facets.FacetDoubleRange("SomeFacet")); Console.WriteLine(criteria.Query); //We used to assert this, but it must be allowed to do an add on the same field multiple times //Assert.AreEqual("+__NodeTypeAlias:mydocumenttypealias +(+id:1)", criteria.Query.ToString()); @@ -1237,7 +1237,7 @@ public void Grouped_And_Query_Output() Console.WriteLine("GROUPED AND - MULTI FIELD, EQUAL MULTI VAL"); criteria = (LuceneSearchQuery)searcher.CreateQuery(); criteria.Field("__NodeTypeAlias", "myDocumentTypeAlias"); - criteria.GroupedAnd(new[] { "id", "parentID", "blahID" }.ToList(), new[] { "1", "2", "3" }).WithFacets(facets => facets.Facet("SomeFacet")); + criteria.GroupedAnd(new[] { "id", "parentID", "blahID" }.ToList(), new[] { "1", "2", "3" }).WithFacets(facets => facets.FacetDoubleRange("SomeFacet")); Console.WriteLine(criteria.Query); //The field/value array lengths are equal so we will match the key/value pairs Assert.AreEqual("+__NodeTypeAlias:mydocumenttypealias +(+id:1 +parentID:2 +blahID:3)", criteria.Query.ToString()); @@ -1245,7 +1245,7 @@ public void Grouped_And_Query_Output() Console.WriteLine("GROUPED AND - MULTI FIELD, MULTI VAL"); criteria = (LuceneSearchQuery)searcher.CreateQuery(); criteria.Field("__NodeTypeAlias", "myDocumentTypeAlias"); - criteria.GroupedAnd(new[] { "id", "parentID" }.ToList(), new[] { "1", "2", "3" }).WithFacets(facets => facets.Facet("SomeFacet")); + criteria.GroupedAnd(new[] { "id", "parentID" }.ToList(), new[] { "1", "2", "3" }).WithFacets(facets => facets.FacetDoubleRange("SomeFacet")); Console.WriteLine(criteria.Query); //There are more than one field and there are more values than fields, in this case we align the key/value pairs Assert.AreEqual("+__NodeTypeAlias:mydocumenttypealias +(+id:1 +parentID:2)", criteria.Query.ToString()); @@ -1253,14 +1253,14 @@ public void Grouped_And_Query_Output() Console.WriteLine("GROUPED AND - MULTI FIELD, SINGLE VAL"); criteria = (LuceneSearchQuery)searcher.CreateQuery(); criteria.Field("__NodeTypeAlias", "myDocumentTypeAlias"); - criteria.GroupedAnd(new[] { "id", "parentID" }.ToList(), new[] { "1" }).WithFacets(facets => facets.Facet("SomeFacet")); + criteria.GroupedAnd(new[] { "id", "parentID" }.ToList(), new[] { "1" }).WithFacets(facets => facets.FacetDoubleRange("SomeFacet")); Console.WriteLine(criteria.Query); Assert.AreEqual("+__NodeTypeAlias:mydocumenttypealias +(+id:1 +parentID:1)", criteria.Query.ToString()); Console.WriteLine("GROUPED AND - SINGLE FIELD, SINGLE VAL"); criteria = (LuceneSearchQuery)searcher.CreateQuery(); criteria.Field("__NodeTypeAlias", "myDocumentTypeAlias"); - criteria.GroupedAnd(new[] { "id" }.ToList(), new[] { "1" }).WithFacets(facets => facets.Facet("SomeFacet")); + criteria.GroupedAnd(new[] { "id" }.ToList(), new[] { "1" }).WithFacets(facets => facets.FacetDoubleRange("SomeFacet")); Console.WriteLine(criteria.Query); Assert.AreEqual("+__NodeTypeAlias:mydocumenttypealias +(+id:1)", criteria.Query.ToString()); } @@ -1282,35 +1282,35 @@ public void Grouped_Not_Query_Output() Console.WriteLine("GROUPED NOT - SINGLE FIELD, MULTI VAL"); var criteria = (LuceneSearchQuery)searcher.CreateQuery(); criteria.Field("__NodeTypeAlias", "myDocumentTypeAlias"); - criteria.GroupedNot(new[] { "id" }.ToList(), new[] { "1", "2", "3" }).WithFacets(facets => facets.Facet("SomeFacet")); + criteria.GroupedNot(new[] { "id" }.ToList(), new[] { "1", "2", "3" }).WithFacets(facets => facets.FacetDoubleRange("SomeFacet")); Console.WriteLine(criteria.Query); Assert.AreEqual("+__NodeTypeAlias:mydocumenttypealias -id:1 -id:2 -id:3", criteria.Query.ToString()); Console.WriteLine("GROUPED NOT - MULTI FIELD, MULTI VAL"); criteria = (LuceneSearchQuery)searcher.CreateQuery(); criteria.Field("__NodeTypeAlias", "myDocumentTypeAlias"); - criteria.GroupedNot(new[] { "id", "parentID" }.ToList(), new[] { "1", "2", "3" }).WithFacets(facets => facets.Facet("SomeFacet")); + criteria.GroupedNot(new[] { "id", "parentID" }.ToList(), new[] { "1", "2", "3" }).WithFacets(facets => facets.FacetDoubleRange("SomeFacet")); Console.WriteLine(criteria.Query); Assert.AreEqual("+__NodeTypeAlias:mydocumenttypealias -id:1 -id:2 -id:3 -parentID:1 -parentID:2 -parentID:3", criteria.Query.ToString()); Console.WriteLine("GROUPED NOT - MULTI FIELD, EQUAL MULTI VAL"); criteria = (LuceneSearchQuery)searcher.CreateQuery(); criteria.Field("__NodeTypeAlias", "myDocumentTypeAlias"); - criteria.GroupedNot(new[] { "id", "parentID", "blahID" }.ToList(), new[] { "1", "2", "3" }).WithFacets(facets => facets.Facet("SomeFacet")); + criteria.GroupedNot(new[] { "id", "parentID", "blahID" }.ToList(), new[] { "1", "2", "3" }).WithFacets(facets => facets.FacetDoubleRange("SomeFacet")); Console.WriteLine(criteria.Query); Assert.AreEqual("+__NodeTypeAlias:mydocumenttypealias -id:1 -id:2 -id:3 -parentID:1 -parentID:2 -parentID:3 -blahID:1 -blahID:2 -blahID:3", criteria.Query.ToString()); Console.WriteLine("GROUPED NOT - MULTI FIELD, SINGLE VAL"); criteria = (LuceneSearchQuery)searcher.CreateQuery(); criteria.Field("__NodeTypeAlias", "myDocumentTypeAlias"); - criteria.GroupedNot(new[] { "id", "parentID" }.ToList(), new[] { "1" }).WithFacets(facets => facets.Facet("SomeFacet")); + criteria.GroupedNot(new[] { "id", "parentID" }.ToList(), new[] { "1" }).WithFacets(facets => facets.FacetDoubleRange("SomeFacet")); Console.WriteLine(criteria.Query); Assert.AreEqual("+__NodeTypeAlias:mydocumenttypealias -id:1 -parentID:1", criteria.Query.ToString()); Console.WriteLine("GROUPED NOT - SINGLE FIELD, SINGLE VAL"); criteria = (LuceneSearchQuery)searcher.CreateQuery(); criteria.Field("__NodeTypeAlias", "myDocumentTypeAlias"); - criteria.GroupedNot(new[] { "id" }.ToList(), new[] { "1" }).WithFacets(facets => facets.Facet("SomeFacet")); + criteria.GroupedNot(new[] { "id" }.ToList(), new[] { "1" }).WithFacets(facets => facets.FacetDoubleRange("SomeFacet")); Console.WriteLine(criteria.Query); Assert.AreEqual("+__NodeTypeAlias:mydocumenttypealias -id:1", criteria.Query.ToString()); } @@ -1357,7 +1357,7 @@ public void Grouped_Not_Single_Field_Single_Value(FacetTestType withFacets) if (HasFacets(withFacets)) { - var results = query.All().WithFacets(facets => facets.Facet("nodeName")).Execute(); + var results = query.All().WithFacets(facets => facets.FacetString("nodeName")).Execute(); var facetResults = results.GetFacet("nodeName"); @@ -1415,7 +1415,7 @@ public void Grouped_Not_Multi_Field_Single_Value(FacetTestType withFacets) if (HasFacets(withFacets)) { - var results = query.WithFacets(facets => facets.Facet("nodeName")).Execute(); + var results = query.WithFacets(facets => facets.FacetString("nodeName")).Execute(); var facetResults = results.GetFacet("nodeName"); @@ -1476,7 +1476,7 @@ public void Grouped_Or_With_Not(FacetTestType withFacets) if (HasFacets(withFacets)) { - var results = filter.WithFacets(facets => facets.Facet("headerText")).Execute(); + var results = filter.WithFacets(facets => facets.FacetString("headerText")).Execute(); var facetResults = results.GetFacet("headerText"); @@ -1534,7 +1534,7 @@ public void And_Grouped_Not_Single_Value(FacetTestType withFacets) if (HasFacets(withFacets)) { - var results = query.WithFacets(facets => facets.Facet("nodeName")).Execute(); + var results = query.WithFacets(facets => facets.FacetString("nodeName")).Execute(); var facetResults = results.GetFacet("nodeName"); @@ -1592,7 +1592,7 @@ public void And_Grouped_Not_Multi_Value(FacetTestType withFacets) if (HasFacets(withFacets)) { - var results = query.WithFacets(facets => facets.Facet("nodeName")).Execute(); + var results = query.WithFacets(facets => facets.FacetString("nodeName")).Execute(); var facetResults = results.GetFacet("nodeName"); Assert.AreEqual(1, results.TotalItemCount); @@ -1649,7 +1649,7 @@ public void And_Not_Single_Field(FacetTestType withFacets) if (HasFacets(withFacets)) { - var results = query.WithFacets(facets => facets.Facet("nodeName")).Execute(); + var results = query.WithFacets(facets => facets.FacetString("nodeName")).Execute(); var facetResults = results.GetFacets(); @@ -1711,7 +1711,7 @@ public void AndNot_Nested(FacetTestType withFacets) if (HasFacets(withFacets)) { - var results = query.WithFacets(facets => facets.Facet("nodeName")).Execute(); + var results = query.WithFacets(facets => facets.FacetString("nodeName")).Execute(); var facetResults = results.GetFacet("nodeName"); Assert.AreEqual(1, results.TotalItemCount); @@ -1771,7 +1771,7 @@ public void And_Not_Added_Later(FacetTestType withFacets) if (HasFacets(withFacets)) { - var results = query.WithFacets(facets => facets.Facet("nodeName")).Execute(); + var results = query.WithFacets(facets => facets.FacetString("nodeName")).Execute(); var facetResults = results.GetFacet("nodeName"); Assert.AreEqual(1, results.TotalItemCount); @@ -1832,7 +1832,7 @@ public void Not_Range(FacetTestType withFacets) { var results = query - .WithFacets(facets => facets.Facet("start", new Int64Range("Label", 100, false, 200, false))) + .WithFacets(facets => facets.FacetLongRange("start", new Int64Range("Label", 100, false, 200, false))) .Execute(); var facetResults = results.GetFacet("start"); @@ -1907,7 +1907,7 @@ public void Match_By_Path(FacetTestType withFacets) if (HasFacets(withFacets)) { - var results1 = filter.WithFacets(facets => facets.Facet("nodeName")).Execute(); + var results1 = filter.WithFacets(facets => facets.FacetString("nodeName")).Execute(); var facetResults1 = results1.GetFacet("nodeName"); Assert.AreEqual(1, results1.TotalItemCount); Assert.AreEqual(1, facetResults1.Count()); @@ -1924,7 +1924,7 @@ public void Match_By_Path(FacetTestType withFacets) if (HasFacets(withFacets)) { - var results2 = exactfilter.WithFacets(facets => facets.Facet("nodeName")).Execute(); + var results2 = exactfilter.WithFacets(facets => facets.FacetString("nodeName")).Execute(); var facetResults2 = results2.GetFacet("nodeName"); Assert.AreEqual(1, results2.TotalItemCount); Assert.AreEqual(1, facetResults2.Count()); @@ -1943,7 +1943,7 @@ public void Match_By_Path(FacetTestType withFacets) if (HasFacets(withFacets)) { - var results5 = nativeFilter.WithFacets(facets => facets.Facet("nodeName")).Execute(); + var results5 = nativeFilter.WithFacets(facets => facets.FacetString("nodeName")).Execute(); var facetResults5 = results5.GetFacet("nodeName"); Assert.AreEqual(1, results5.TotalItemCount); Assert.AreEqual(1, facetResults5.Count()); @@ -1960,7 +1960,7 @@ public void Match_By_Path(FacetTestType withFacets) if (HasFacets(withFacets)) { - var results3 = wildcardfilter.WithFacets(facets => facets.Facet("nodeName")).Execute(); + var results3 = wildcardfilter.WithFacets(facets => facets.FacetString("nodeName")).Execute(); var facetResults3 = results3.GetFacet("nodeName"); Assert.AreEqual(2, results3.TotalItemCount); Assert.AreEqual(2, facetResults3.Count()); @@ -1977,7 +1977,7 @@ public void Match_By_Path(FacetTestType withFacets) if (HasFacets(withFacets)) { - var results3 = wildcardfilter.WithFacets(facets => facets.Facet("nodeName")).Execute(); + var results3 = wildcardfilter.WithFacets(facets => facets.FacetString("nodeName")).Execute(); var facetResults3 = results3.GetFacet("nodeName"); Assert.AreEqual(0, results3.TotalItemCount); Assert.AreEqual(0, facetResults3?.Count() ?? 0); @@ -2036,7 +2036,7 @@ public void Find_By_ParentId(FacetTestType withFacets) if (HasFacets(withFacets)) { - var results = filter.WithFacets(facets => facets.Facet("nodeName")).Execute(); + var results = filter.WithFacets(facets => facets.FacetString("nodeName")).Execute(); var facetResults = results.GetFacet("nodeName"); @@ -2107,7 +2107,7 @@ public void Find_By_ParentId_Native_Query(FacetTestType withFacets) if (HasFacets(withFacets)) { - var results = filter.WithFacets(facets => facets.Facet("parentID")).Execute(); + var results = filter.WithFacets(facets => facets.FacetString("parentID")).Execute(); var facetResults = results.GetFacet("parentID"); @@ -2187,7 +2187,7 @@ public void Find_By_NodeTypeAlias(FacetTestType withFacets) if (HasFacets(withFacets)) { - var results = filter.WithFacets(facets => facets.Facet("nodeName")).Execute(); + var results = filter.WithFacets(facets => facets.FacetString("nodeName")).Execute(); var facetResults = results.GetFacet("nodeName"); @@ -2251,7 +2251,7 @@ public void Search_With_Stop_Words(FacetTestType withFacets) if (HasFacets(withFacets)) { - var results = filter.WithFacets(facets => facets.Facet("nodeName")).Execute(); + var results = filter.WithFacets(facets => facets.FacetDoubleRange("nodeName")).Execute(); var facetResults = results.GetFacet("nodeName"); @@ -2324,7 +2324,7 @@ public void Search_Native_Query(FacetTestType withFacets) if (HasFacets(withFacets)) { - var results = criteria.WithFacets(facets => facets.Facet("nodeTypeAlias")).Execute(); + var results = criteria.WithFacets(facets => facets.FacetString("nodeTypeAlias")).Execute(); var facetResults = results.GetFacet("nodeTypeAlias"); @@ -2386,7 +2386,7 @@ public void Find_Only_Image_Media(FacetTestType withFacets) if (HasFacets(withFacets)) { - var results = filter.WithFacets(facets => facets.Facet("nodeTypeAlias")).Execute(); + var results = filter.WithFacets(facets => facets.FacetString("nodeTypeAlias")).Execute(); var facetResults = results.GetFacet("nodeTypeAlias"); @@ -2448,7 +2448,7 @@ public void Find_Both_Media_And_Content(FacetTestType withFacets) if (HasFacets(withFacets)) { - var results = filter.WithFacets(facets => facets.Facet("nodeName")).Execute(); + var results = filter.WithFacets(facets => facets.FacetString("nodeName")).Execute(); var facetResults = results.GetFacet("nodeName"); @@ -2513,8 +2513,8 @@ public void Sort_Result_By_Number_Field(FacetTestType withFacets) { var results1 = sc1 .WithFacets(facets => facets - .Facet("sortOrder") - .Facet("parentID")) + .FacetString("sortOrder") + .FacetString("parentID")) .Execute(); var facetResults = results1.GetFacet("sortOrder"); @@ -2602,8 +2602,8 @@ public void Sort_Result_By_Date_Field(FacetTestType withFacets) { var results1 = sc1 .WithFacets(facets => facets - .Facet("updateDate") - .Facet("parentID")) + .FacetString("updateDate") + .FacetString("parentID")) .Execute(); var facetResults = results1.GetFacet("updateDate"); @@ -2689,8 +2689,8 @@ public void Sort_Result_By_Single_Field(FacetTestType withFacets) if (HasFacets(withFacets)) { - var results1 = sc1.WithFacets(facets => facets.Facet("nodeName")).Execute(); - var results2 = sc2.WithFacets(facets => facets.Facet("nodeName")).Execute(); + var results1 = sc1.WithFacets(facets => facets.FacetString("nodeName")).Execute(); + var results2 = sc2.WithFacets(facets => facets.FacetString("nodeName")).Execute(); var facetResults1 = results1.GetFacet("nodeName"); var facetResults2 = results2.GetFacet("nodeName"); @@ -2756,8 +2756,8 @@ public void Sort_Result_By_Double_Fields(string fieldType, SortType sortType, bo if (withFacets) { - var results1 = sc1.WithFacets(facets => facets.Facet("field1")).Execute(); - var results2 = sc2.WithFacets(facets => facets.Facet("field1")).Execute(); + var results1 = sc1.WithFacets(facets => facets.FacetString("field1")).Execute(); + var results2 = sc2.WithFacets(facets => facets.FacetString("field1")).Execute(); var facetResults1 = results1.GetFacet("field1"); var facetResults2 = results2.GetFacet("field1"); @@ -2857,7 +2857,7 @@ public void Sort_Result_By_Multiple_Fields(FacetTestType withFacets) if (HasFacets(withFacets)) { - var results1 = sc1.WithFacets(facets => facets.Facet("field1").Facet("field2")).Execute(); + var results1 = sc1.WithFacets(facets => facets.FacetString("field1").FacetString("field2")).Execute(); var facetResults = results1.GetFacet("field1"); var facetResults2 = results1.GetFacet("field2"); @@ -2931,7 +2931,7 @@ public void Standard_Results_Sorted_By_Score(FacetTestType withFacets) if (HasFacets(withFacets)) { - var results = sc1.WithFacets(facets => facets.Facet("bodyText")).Execute(); + var results = sc1.WithFacets(facets => facets.FacetString("bodyText")).Execute(); var facetResults = results.GetFacet("bodyText"); @@ -3013,7 +3013,7 @@ public void Skip_Results_Returns_Different_Results(FacetTestType withFacets) if (HasFacets(withFacets)) { //Act - var results = sc.WithFacets(facets => facets.Facet("nodeName")).Execute(); + var results = sc.WithFacets(facets => facets.FacetString("nodeName")).Execute(); var facetResults = results.GetFacet("nodeName"); @@ -3077,7 +3077,7 @@ public void Escaping_Includes_All_Words(FacetTestType withFacets) if (HasFacets(withFacets)) { //Act - var results = sc.WithFacets(facets => facets.Facet("nodeName")).Execute(); + var results = sc.WithFacets(facets => facets.FacetString("nodeName")).Execute(); var facetResults = results.GetFacet("nodeName"); @@ -3149,7 +3149,7 @@ public void Grouped_And_Examiness(FacetTestType withFacets) if (HasFacets(withFacets)) { //Act - var results = filter.WithFacets(facets => facets.Facet("nodeName")).Execute(); + var results = filter.WithFacets(facets => facets.FacetString("nodeName")).Execute(); var facetResults = results.GetFacet("nodeName"); @@ -3214,7 +3214,7 @@ public void Examiness_Proximity(FacetTestType withFacets) if (HasFacets(withFacets)) { //Act - var results = filter.WithFacets(facets => facets.Facet("nodeName")).Execute(); + var results = filter.WithFacets(facets => facets.FacetString("nodeName")).Execute(); var facetResults = results.GetFacet("nodeName"); @@ -3301,12 +3301,12 @@ public void Float_Range_SimpleIndexSet(FacetTestType withFacets) { //Act - var results1 = filter1.WithFacets(facets => facets.Facet("SomeFloat", new FloatRange[] + var results1 = filter1.WithFacets(facets => facets.FacetFloatRange("SomeFloat", new FloatRange[] { new FloatRange("1", 0, true, 12, true), new FloatRange("2", 13, true, 250, true) })).Execute(); - var results2 = filter2.WithFacets(facets => facets.Facet("SomeFloat", new FloatRange[] + var results2 = filter2.WithFacets(facets => facets.FacetFloatRange("SomeFloat", new FloatRange[] { new FloatRange("1", 0, true, 12, true), new FloatRange("2", 13, true, 250, true) @@ -3394,8 +3394,8 @@ public void Number_Range_SimpleIndexSet(FacetTestType withFacets) if (HasFacets(withFacets)) { //Act - var results1 = filter1.WithFacets(facets => facets.Facet("SomeNumber", config => config.MaxCount(1))).Execute(); - var results2 = filter2.WithFacets(facets => facets.Facet("SomeNumber", config => config.MaxCount(1))).Execute(); + var results1 = filter1.WithFacets(facets => facets.FacetString("SomeNumber", config => config.MaxCount(1))).Execute(); + var results2 = filter2.WithFacets(facets => facets.FacetString("SomeNumber", config => config.MaxCount(1))).Execute(); var facetResults1 = results1.GetFacet("SomeNumber"); var facetResults2 = results2.GetFacet("SomeNumber"); @@ -3476,12 +3476,12 @@ public void Double_Range_SimpleIndexSet(FacetTestType withFacets) if (HasFacets(withFacets)) { //Act - var results1 = filter1.WithFacets(facets => facets.Facet("SomeDouble", new DoubleRange[] + var results1 = filter1.WithFacets(facets => facets.FacetDoubleRange("SomeDouble", new DoubleRange[] { new DoubleRange("1", 0, true, 100, true), new DoubleRange("2", 101, true, 200, true) })).Execute(); - var results2 = filter2.WithFacets(facets => facets.Facet("SomeDouble", new DoubleRange[] + var results2 = filter2.WithFacets(facets => facets.FacetDoubleRange("SomeDouble", new DoubleRange[] { new DoubleRange("1", 0, true, 100, true), new DoubleRange("2", 101, true, 200, true) @@ -3565,12 +3565,12 @@ public void Long_Range_SimpleIndexSet(FacetTestType withFacets) if (HasFacets(withFacets)) { //Act - var results1 = filter1.WithFacets(facets => facets.Facet("SomeLong", new Int64Range[] + var results1 = filter1.WithFacets(facets => facets.FacetLongRange("SomeLong", new Int64Range[] { new Int64Range("1", 0L, true, 100L, true), new Int64Range("2", 101L, true, 200L, true) })).Execute(); - var results2 = filter2.WithFacets(facets => facets.Facet("SomeLong", new Int64Range[] + var results2 = filter2.WithFacets(facets => facets.FacetLongRange("SomeLong", new Int64Range[] { new Int64Range("1", 0L, true, 100L, true), new Int64Range("2", 101L, true, 200L, true) @@ -3657,12 +3657,12 @@ public void Date_Range_SimpleIndexSet(FacetTestType withFacets) if (HasFacets(withFacets)) { ////Act - var results = filter.WithFacets(facets => facets.Facet("DateCreated", new Int64Range[] + var results = filter.WithFacets(facets => facets.FacetLongRange("DateCreated", new Int64Range[] { new Int64Range("1", reIndexDateTime.AddYears(-1).Ticks, true, reIndexDateTime.Ticks, true), new Int64Range("2", reIndexDateTime.AddMinutes(1).Ticks, true, reIndexDateTime.AddDays(1).Ticks, true) })).Execute(); - var results2 = filter2.WithFacets(facets => facets.Facet("DateCreated", new Int64Range[] + var results2 = filter2.WithFacets(facets => facets.FacetLongRange("DateCreated", new Int64Range[] { new Int64Range("1", reIndexDateTime.AddYears(-1).Ticks, true, reIndexDateTime.Ticks, true), new Int64Range("2", reIndexDateTime.AddMinutes(1).Ticks, true, reIndexDateTime.AddDays(1).Ticks, true) @@ -3744,8 +3744,8 @@ public void Fuzzy_Search(FacetTestType withFacets) if (HasFacets(withFacets)) { ////Act - var results = filter.WithFacets(facets => facets.Facet("Content")).Execute(); - var results2 = filter2.WithFacets(facets => facets.Facet("Content")).Execute(); + var results = filter.WithFacets(facets => facets.FacetString("Content")).Execute(); + var results2 = filter2.WithFacets(facets => facets.FacetString("Content")).Execute(); var facetResults1 = results.GetFacet("Content"); var facetResults2 = results2.GetFacet("Content"); @@ -3904,7 +3904,7 @@ public void Inner_Or_Query(FacetTestType withFacets) if (HasFacets(withFacets)) { //Act - var results = filter.WithFacets(facets => facets.Facet("Type")).Execute(); + var results = filter.WithFacets(facets => facets.FacetString("Type")).Execute(); var facetResults = results.GetFacet("Type"); @@ -3976,7 +3976,7 @@ public void Inner_And_Query(FacetTestType withFacets) if (HasFacets(withFacets)) { //Act - var results = filter.WithFacets(facets => facets.Facet("Type")).Execute(); + var results = filter.WithFacets(facets => facets.FacetString("Type")).Execute(); var facetResults = results.GetFacet("Type"); @@ -4048,7 +4048,7 @@ public void Inner_Not_Query(FacetTestType withFacets) if (HasFacets(withFacets)) { //Act - var results = filter.WithFacets(facets => facets.Facet("Type")).Execute(); + var results = filter.WithFacets(facets => facets.FacetString("Type")).Execute(); var facetResults = results.GetFacet("Type"); @@ -4129,7 +4129,7 @@ public void Complex_Or_Group_Nested_Query(FacetTestType withFacets) { //Act - var results = filter.WithFacets(facets => facets.Facet("Type")).Execute(); + var results = filter.WithFacets(facets => facets.FacetString("Type")).Execute(); var facetResults = results.GetFacet("Type"); @@ -4179,7 +4179,7 @@ public void Custom_Lucene_Query_With_Native(FacetTestType withFacets) if (HasFacets(withFacets)) { - criteria.LuceneQuery(NumericRangeQuery.NewInt64Range("numTest", 4, 5, true, true)).WithFacets(facets => facets.Facet("SomeFacet")); + criteria.LuceneQuery(NumericRangeQuery.NewInt64Range("numTest", 4, 5, true, true)).WithFacets(facets => facets.FacetDoubleRange("SomeFacet")); } else { @@ -4338,7 +4338,7 @@ public void Select_Field(FacetTestType withFacets) if (HasFacets(withFacets)) { - var results = sc1.WithFacets(facets => facets.Facet("nodeName")).Execute(); + var results = sc1.WithFacets(facets => facets.FacetString("nodeName")).Execute(); var facetResults = results.GetFacet("nodeName"); var expectedLoadedFields = new string[] { "__Path" }; @@ -4408,7 +4408,7 @@ public void Select_Fields(FacetTestType withFacets) if (HasFacets(withFacets)) { - var results = sc1.WithFacets(facets => facets.Facet("nodeName")).Execute(); + var results = sc1.WithFacets(facets => facets.FacetString("nodeName")).Execute(); var facetResults = results.GetFacet("nodeName"); var expectedLoadedFields = new string[] { "nodeName", "bodyText", "id", "__NodeId" }; @@ -4479,7 +4479,7 @@ public void Select_Fields_HashSet(FacetTestType withFacets) if (HasFacets(withFacets)) { - var results = sc1.WithFacets(facets => facets.Facet("nodeName")).Execute(); + var results = sc1.WithFacets(facets => facets.FacetString("nodeName")).Execute(); var facetResults = results.GetFacet("nodeName"); var expectedLoadedFields = new string[] { "nodeName", "bodyText" }; @@ -4626,7 +4626,7 @@ public void Paging_With_Skip_Take(FacetTestType withFacets) if (HasFacets(withFacets)) { - var results = sc.WithFacets(facets => facets.Facet("writerName")) + var results = sc.WithFacets(facets => facets.FacetString("writerName")) .Execute(QueryOptions.SkipTake(pageIndex * pageSize, pageSize)); Assert.AreEqual(2, results.Count()); var facetResults = results.GetFacet("writerName"); @@ -4747,7 +4747,7 @@ public void Given_SkipTake_Returns_ExpectedTotals(int skip, int take, int expect if (withFacets) { - var results = sc.WithFacets(facets => facets.Facet("nodeName")).Execute(QueryOptions.SkipTake(skip, take)); + var results = sc.WithFacets(facets => facets.FacetString("nodeName")).Execute(QueryOptions.SkipTake(skip, take)); var facetResults = results.GetFacet("nodeName"); @@ -4957,7 +4957,7 @@ public void Range_DateOnly(FacetTestType withFacets) if (HasFacets(withFacets)) { - var numberSortedResult = numberSortedCriteria.WithFacets(facets => facets.Facet("created")).Execute(); + var numberSortedResult = numberSortedCriteria.WithFacets(facets => facets.FacetString("created")).Execute(); var facetResult = numberSortedResult.GetFacet("created"); Assert.AreEqual(2, numberSortedResult.TotalItemCount); @@ -5091,7 +5091,7 @@ public void GivenSearchAfterTake_Returns_ExpectedTotals_Facet(int firstTake, int var sc = searcher.CreateQuery("content") .Field("writerName", "administrator") - .WithFacets(facets => facets.Facet("nodeName")); + .WithFacets(facets => facets.FacetString("nodeName")); //Act @@ -5148,11 +5148,11 @@ public void GivenTaxonomyIndexSearchAfterTake_Returns_ExpectedTotals_Facet(int f var sc = taxonomySearcher.CreateQuery("content") .Field("writerName", "administrator") - .WithFacets(facets => + .WithFacets((Action)(facets => { - facets.Facet("nodeName"); - facets.Facet("taxonomynodeName"); - }); + facets.FacetString("nodeName"); + facets.FacetString("taxonomynodeName"); + })); //Act diff --git a/src/Examine.Web.Demo/Pages/FacetSearch.razor b/src/Examine.Web.Demo/Pages/FacetSearch.razor index bba0eb171..a5d8e61d1 100644 --- a/src/Examine.Web.Demo/Pages/FacetSearch.razor +++ b/src/Examine.Web.Demo/Pages/FacetSearch.razor @@ -92,7 +92,7 @@ stopwatch.Start(); var luceneSearchResults = IndexService.SearchLucene( _selectedIndex, - (query) => query.NativeQuery(_query.Trim()).WithFacets(facets => { facets.Facet("AddressState"); facets.Facet("AddressStateCity"); facets.Facet("Tags"); }), + (Func)((query) => query.NativeQuery(_query.Trim()).WithFacets((Action)(facets => { facets.FacetDoubleRange("AddressState"); facets.FacetDoubleRange("AddressStateCity"); facets.FacetDoubleRange("Tags"); }))), new LuceneQueryOptions(0, 100) ); _searchResults = luceneSearchResults; @@ -106,7 +106,7 @@ stopwatch.Start(); var luceneSearchResults = IndexService.SearchLucene( _selectedIndex, - (query) => query.All().WithFacets(facets => { facets.Facet("AddressState"); facets.Facet("AddressStateCity"); facets.Facet("Tags"); }), + (Func)((query) => query.All().WithFacets((Action)(facets => { facets.FacetDoubleRange("AddressState"); facets.FacetDoubleRange("AddressStateCity"); facets.FacetDoubleRange("Tags"); }))), new LuceneQueryOptions(0, 100) ); _searchResults = luceneSearchResults; From de0f618d57f74c6933d0b7f2951d322e75ecd074 Mon Sep 17 00:00:00 2001 From: Chad Currie Date: Sun, 30 Jul 2023 00:15:32 +1200 Subject: [PATCH 10/12] Obsolete method. --- src/Examine.Host/ServicesCollectionExtensions.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Examine.Host/ServicesCollectionExtensions.cs b/src/Examine.Host/ServicesCollectionExtensions.cs index 0f0ad87ad..839f65f96 100644 --- a/src/Examine.Host/ServicesCollectionExtensions.cs +++ b/src/Examine.Host/ServicesCollectionExtensions.cs @@ -206,6 +206,7 @@ public static IServiceCollection AddExamineSearcher( /// /// Registers a lucene multi index searcher /// + [Obsolete("Will be removed in Examine V5")] public static IServiceCollection AddExamineLuceneMultiSearcher( this IServiceCollection serviceCollection, string name, From 61a7f2bfbf596c818d57c05481312c02a54d4a00 Mon Sep 17 00:00:00 2001 From: Chad Currie Date: Sun, 30 Jul 2023 00:55:00 +1200 Subject: [PATCH 11/12] Simplify extension methods --- .../ExamineLuceneIndexConfiguration.cs | 63 ++++++ ...ExamineLuceneMultiSearcherConfiguration.cs | 43 ++++ .../ServicesCollectionExtensions.cs | 183 ++++++++---------- .../IndexFactoryExtensions.cs | 6 +- 4 files changed, 191 insertions(+), 104 deletions(-) create mode 100644 src/Examine.Host/ExamineLuceneIndexConfiguration.cs create mode 100644 src/Examine.Host/ExamineLuceneMultiSearcherConfiguration.cs diff --git a/src/Examine.Host/ExamineLuceneIndexConfiguration.cs b/src/Examine.Host/ExamineLuceneIndexConfiguration.cs new file mode 100644 index 000000000..cdab44c74 --- /dev/null +++ b/src/Examine.Host/ExamineLuceneIndexConfiguration.cs @@ -0,0 +1,63 @@ +using System.Collections.Generic; +using Examine.Lucene; +using Examine.Lucene.Directories; +using Examine.Lucene.Providers; +using Lucene.Net.Analysis; +using Lucene.Net.Facet; + +namespace Examine +{ + /// + /// Examine Lucene Index Configuration + /// + /// + /// + public class ExamineLuceneIndexConfiguration + where TIndex : LuceneIndex + where TDirectoryFactory : class, IDirectoryFactory + { + /// + /// Constructor + /// + /// Index Name + public ExamineLuceneIndexConfiguration(string name) + { + Name = name; + } + + /// + /// Index Name + /// + public string Name { get; } + + /// + /// Index Field Definitions + /// + public FieldDefinitionCollection? FieldDefinitions { get; set; } + + /// + /// Index Default Analyzer + /// + public Analyzer? Analyzer { get; set; } + + /// + /// Index Value Set Validator + /// + public IValueSetValidator? Validator { get; set; } + + /// + /// Index Value Type Factory + /// + public IReadOnlyDictionary? IndexValueTypesFactory { get; set; } + + /// + /// Index Facet Config + /// + public FacetsConfig? FacetsConfig { get; set; } + + /// + /// Whether to use Taxonomy Index + /// + public bool UseTaxonomyIndex { get; set; } + } +} diff --git a/src/Examine.Host/ExamineLuceneMultiSearcherConfiguration.cs b/src/Examine.Host/ExamineLuceneMultiSearcherConfiguration.cs new file mode 100644 index 000000000..13e759106 --- /dev/null +++ b/src/Examine.Host/ExamineLuceneMultiSearcherConfiguration.cs @@ -0,0 +1,43 @@ + +using Lucene.Net.Analysis; +using Lucene.Net.Facet; + +namespace Examine +{ + /// + /// Examine Lucene MultiSearcher Configuration + /// + public class ExamineLuceneMultiSearcherConfiguration + { + /// + /// Constructor + /// + /// Searcher Name + /// Index Names to search + public ExamineLuceneMultiSearcherConfiguration(string name, string[] indexNames) + { + Name = name; + IndexNames = indexNames; + } + + /// + /// Searcher Name + /// + public string Name { get; } + + /// + /// Index Names to search + /// + public string[] IndexNames { get; } + + /// + /// Facet Configuration + /// + public FacetsConfig? FacetConfiguration { get; set; } + + /// + /// Search Analyzer + /// + public Analyzer? Analyzer { get; set; } + } +} diff --git a/src/Examine.Host/ServicesCollectionExtensions.cs b/src/Examine.Host/ServicesCollectionExtensions.cs index 839f65f96..8696253ea 100644 --- a/src/Examine.Host/ServicesCollectionExtensions.cs +++ b/src/Examine.Host/ServicesCollectionExtensions.cs @@ -9,7 +9,6 @@ using Lucene.Net.Facet; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; -using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; namespace Examine @@ -44,12 +43,23 @@ public static IServiceCollection AddExamineLuceneIndex( IValueSetValidator validator = null, IReadOnlyDictionary indexValueTypesFactory = null) where TIndex : LuceneIndex - => serviceCollection.AddExamineLuceneIndex(name, fieldDefinitions, analyzer, validator, indexValueTypesFactory, null); + { + Action> config = opt => + { + opt.FieldDefinitions = fieldDefinitions; + opt.Analyzer = analyzer; + opt.UseTaxonomyIndex = false; + opt.FacetsConfig = null; + opt.IndexValueTypesFactory = indexValueTypesFactory; + opt.Validator = validator; + }; + return serviceCollection.AddExamineLuceneIndex(name, config); + } /// /// Registers an Examine index /// - [Obsolete("To remove in Examien V5")] + [Obsolete("To remove in Examine V5")] public static IServiceCollection AddExamineLuceneIndex( this IServiceCollection serviceCollection, string name, @@ -60,50 +70,31 @@ public static IServiceCollection AddExamineLuceneIndex(name, fieldDefinitions, analyzer, validator, indexValueTypesFactory, null); + Action> config = opt => + { + opt.FieldDefinitions = fieldDefinitions; + opt.Analyzer = analyzer; + opt.UseTaxonomyIndex = false; + opt.FacetsConfig = null; + opt.IndexValueTypesFactory = indexValueTypesFactory; + opt.Validator = validator; + }; + return serviceCollection.AddExamineLuceneIndex(name, config); } - /// - /// Registers a file system based Lucene Examine index - /// - public static IServiceCollection AddExamineLuceneIndex( - this IServiceCollection serviceCollection, - string name, - FacetsConfig? facetsConfig, - FieldDefinitionCollection? fieldDefinitions = null, - Analyzer? analyzer = null, - IValueSetValidator? validator = null, - IReadOnlyDictionary? indexValueTypesFactory = null) - => serviceCollection.AddExamineLuceneIndex(name, facetsConfig, fieldDefinitions, analyzer, validator, indexValueTypesFactory); - - /// - /// Registers a file system based Lucene Examine index - /// - public static IServiceCollection AddExamineLuceneIndex( - this IServiceCollection serviceCollection, - string name, - FacetsConfig? facetsConfig, - FieldDefinitionCollection? fieldDefinitions = null, - Analyzer? analyzer = null, - IValueSetValidator? validator = null, - IReadOnlyDictionary? indexValueTypesFactory = null) - where TIndex : LuceneIndex - => serviceCollection.AddExamineLuceneIndex(name, fieldDefinitions, analyzer, validator, indexValueTypesFactory, facetsConfig); - /// /// Registers an Examine index /// public static IServiceCollection AddExamineLuceneIndex( - this IServiceCollection serviceCollection, - string name, - FieldDefinitionCollection? fieldDefinitions = null, - Analyzer? analyzer = null, - IValueSetValidator? validator = null, - IReadOnlyDictionary? indexValueTypesFactory = null, - FacetsConfig? facetsConfig = null) - where TIndex : LuceneIndex - where TDirectoryFactory : class, IDirectoryFactory + this IServiceCollection serviceCollection, + string name, + Action> configuration) + where TIndex : LuceneIndex + where TDirectoryFactory : class, IDirectoryFactory { + var config = new ExamineLuceneIndexConfiguration(name); + configuration.Invoke(config); + // This is the long way to add IOptions but gives us access to the // services collection which we need to get the dir factory serviceCollection.AddSingleton>( @@ -111,12 +102,13 @@ public static IServiceCollection AddExamineLuceneIndex { - options.Analyzer = analyzer; - options.Validator = validator; - options.IndexValueTypesFactory = indexValueTypesFactory; - options.FieldDefinitions = fieldDefinitions ?? options.FieldDefinitions; + options.Analyzer = config.Analyzer; + options.Validator = config.Validator; + options.IndexValueTypesFactory = config.IndexValueTypesFactory; + options.FieldDefinitions = config.FieldDefinitions ?? options.FieldDefinitions; options.DirectoryFactory = services.GetRequiredService(); - options.FacetsConfig = facetsConfig ?? new FacetsConfig(); + options.FacetsConfig = config.FacetsConfig ?? new FacetsConfig(); + options.UseTaxonomyIndex = config.UseTaxonomyIndex; })); return serviceCollection.AddSingleton(services => @@ -133,47 +125,26 @@ IOptionsMonitor options } /// - /// Registers an Examine index + /// Registers a file system based Lucene Examine index /// - public static IServiceCollection AddExamineLuceneIndex( + public static IServiceCollection AddExamineLuceneIndex( this IServiceCollection serviceCollection, string name, - FieldDefinitionCollection? fieldDefinitions = null, - Analyzer? analyzer = null, - IValueSetValidator? validator = null, - IReadOnlyDictionary? indexValueTypesFactory = null, - FacetsConfig? facetsConfig = null, - bool useTaxonomyIndex = false) - where TIndex : LuceneIndex - where TDirectoryFactory : class, IDirectoryFactory + Action> configuration) { - // This is the long way to add IOptions but gives us access to the - // services collection which we need to get the dir factory - serviceCollection.AddSingleton>( - services => new ConfigureNamedOptions( - name, - (options) => - { - options.Analyzer = analyzer; - options.Validator = validator; - options.IndexValueTypesFactory = indexValueTypesFactory; - options.FieldDefinitions = fieldDefinitions ?? options.FieldDefinitions; - options.DirectoryFactory = services.GetRequiredService(); - options.FacetsConfig = facetsConfig ?? new FacetsConfig(); - options.UseTaxonomyIndex = useTaxonomyIndex; - })); - - return serviceCollection.AddSingleton(services => - { - IOptionsMonitor options - = services.GetRequiredService>(); - - TIndex index = ActivatorUtilities.CreateInstance( - services, - new object[] { name, options }); + return serviceCollection.AddExamineLuceneIndex(name, configuration); + } - return index; - }); + /// + /// Registers a file system based Lucene Examine index + /// + public static IServiceCollection AddExamineLuceneIndex( + this IServiceCollection serviceCollection, + string name, + Action> configuration) + where TIndex : LuceneIndex + { + return serviceCollection.AddExamineLuceneIndex(name, configuration); } /// @@ -212,7 +183,14 @@ public static IServiceCollection AddExamineLuceneMultiSearcher( string name, string[] indexNames, Analyzer analyzer = null) - => AddExamineLuceneMultiSearcher(serviceCollection, name, indexNames, default, analyzer); + { + var cfg = new Action(opt => + { + opt.Analyzer = analyzer; + opt.FacetConfiguration = default; + }); + return AddExamineLuceneMultiSearcher(serviceCollection, name, indexNames, cfg); + } /// @@ -222,30 +200,33 @@ public static IServiceCollection AddExamineLuceneMultiSearcher( this IServiceCollection serviceCollection, string name, string[] indexNames, - FacetsConfig facetsConfig, - Analyzer analyzer = null) - => serviceCollection.AddExamineSearcher(name, s => - { - IEnumerable matchedIndexes = s.GetServices() - .Where(x => indexNames.Contains(x.Name)); + Action configuration = null) + { + var cfg = new ExamineLuceneMultiSearcherConfiguration(name, indexNames); + configuration?.Invoke(cfg); + return serviceCollection.AddExamineSearcher(name, s => + { + IEnumerable matchedIndexes = s.GetServices() + .Where(x => indexNames.Contains(x.Name)); - var parameters = new List - { + var parameters = new List + { matchedIndexes, - }; + }; - if (facetsConfig != null) - { - parameters.Add(facetsConfig); - } + if (cfg.FacetConfiguration != null) + { + parameters.Add(cfg.FacetConfiguration); + } - if (analyzer != null) - { - parameters.Add(analyzer); - } + if (cfg.Analyzer != null) + { + parameters.Add(cfg.Analyzer); + } - return parameters; - }); + return parameters; + }); + } /// /// Adds the Examine core services diff --git a/src/Examine.Web.Demo/IndexFactoryExtensions.cs b/src/Examine.Web.Demo/IndexFactoryExtensions.cs index 36688fc33..91729169a 100644 --- a/src/Examine.Web.Demo/IndexFactoryExtensions.cs +++ b/src/Examine.Web.Demo/IndexFactoryExtensions.cs @@ -26,19 +26,19 @@ public static IServiceCollection CreateIndexes(this IServiceCollection services) services.AddExamineLuceneIndex( "TaxonomyFacetIndex", - facetsConfig: taxonomyFacetIndexFacetsConfig); + cfg => cfg.FacetsConfig = taxonomyFacetIndexFacetsConfig); var facetIndexFacetsConfig = new FacetsConfig(); services.AddExamineLuceneIndex( "FacetIndex", - facetsConfig: facetIndexFacetsConfig); + cfg => cfg.FacetsConfig = taxonomyFacetIndexFacetsConfig); services.AddExamineLuceneMultiSearcher( "MultiIndexSearcher", new[] { "MyIndex", "SyncedIndex", "FacetIndex" }, - facetsConfig: new FacetsConfig()); + opt=> opt.FacetConfiguration = new FacetsConfig()); services.ConfigureOptions(); From 6be1a6f89c8651f1b1eb9fa23ef51deade2aded2 Mon Sep 17 00:00:00 2001 From: Chad Currie Date: Sun, 13 Aug 2023 21:46:35 +1200 Subject: [PATCH 12/12] virtual compat --- src/Examine.Lucene/Directories/DirectoryFactoryBase.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Examine.Lucene/Directories/DirectoryFactoryBase.cs b/src/Examine.Lucene/Directories/DirectoryFactoryBase.cs index 3658d0b2b..d37d5762e 100644 --- a/src/Examine.Lucene/Directories/DirectoryFactoryBase.cs +++ b/src/Examine.Lucene/Directories/DirectoryFactoryBase.cs @@ -1,3 +1,4 @@ +using System; using System.Collections.Concurrent; using Examine.Lucene.Providers; using Directory = Lucene.Net.Store.Directory; @@ -24,7 +25,7 @@ Directory IDirectoryFactory.CreateTaxonomyDirectory(LuceneIndex luceneIndex, boo protected abstract Directory CreateDirectory(LuceneIndex luceneIndex, bool forceUnlock); /// - protected abstract Directory CreateTaxonomyDirectory(LuceneIndex luceneIndex, bool forceUnlock); + protected virtual Directory CreateTaxonomyDirectory(LuceneIndex luceneIndex, bool forceUnlock) => throw new NotSupportedException("Directory Factory does not implement CreateTaxonomyDirectory "); /// protected virtual void Dispose(bool disposing)