Kentico.Xperience.Lucene
2.0.1
Prefix Reserved
See the version list below for details.
dotnet add package Kentico.Xperience.Lucene --version 2.0.1
NuGet\Install-Package Kentico.Xperience.Lucene -Version 2.0.1
<PackageReference Include="Kentico.Xperience.Lucene" Version="2.0.1" />
paket add Kentico.Xperience.Lucene --version 2.0.1
#r "nuget: Kentico.Xperience.Lucene, 2.0.1"
// Install Kentico.Xperience.Lucene as a Cake Addin #addin nuget:?package=Kentico.Xperience.Lucene&version=2.0.1 // Install Kentico.Xperience.Lucene as a Cake Tool #tool nuget:?package=Kentico.Xperience.Lucene&version=2.0.1
Xperience by Kentico Lucene
About The Project
Xperience by Kentico search integration with the latest 4.8 beta version of Lucene.NET, enabling auto-indexing of content in Xperience based on application-local, code-defined search indexes and search results retrieval.
Getting Started
Prerequisites
- Xperience by Kentico >= 26.2.0
Installation
Add the package to your application using the .NET CLI
dotnet add package Kentico.Xperience.Lucene
Setup
Define a custom (or multiple)
LuceneSearchModel
implementation to represent the content you want index.Define a custom
DefaultLuceneIndexingStrategy
implementation to customize how page content/fields are processed for the index.Add this library to the application services, registering your custom
LuceneSearchModel
.builder.Services.AddKentico(); // ... other registrations builder.Services.AddLucene(new[] { new LuceneIndex( typeof(MySearchModel), new StandardAnalyzer(Lucene.Net.Util.LuceneVersion.LUCENE_48), MySearchModel.IndexName, indexPath: null, new MyCustomIndexingStrategy()), });
Rebuild the index in Xperience's Administration within the Lucene application added by this library.
Use the
ILuceneIndexService
(via DI) to retrieve the index populated by your customLuceneSearchModel
.Execute a search with a customized Lucene
Query
(like theMatchAllDocsQuery
) using the ILuceneIndexService.Return or display the results on your site 👍.
Usage
- Review the "Search" functionality in the
src\Kentico.Xperience.Lucene.Sample
Dancing Goat project to see how to implement search. - Read the Lucene.NET introduction or full documentation to explore the core library's APIs and functionality.
- Explore the Lucene.NET source on GitHub
Implementing document decay feature (scoring by "freshness", "recency")
- boosting relevant fields by setting field boost (preferable method, but requires more work)
- boosting one field with constant value, that is always present in search query (shown in sample, less desirable method. Downside of this method is that all documents get matched, usable only for scenarios where total number of result is not required)
- using sort expression, implementation details can be found in Lucene.NET unit tests, Lucene.NET implementations
Methods 1 and 2 require implementing DefaultLuceneIndexingStrategy
and overriding OnDocumentAddField
method.
In OnDocumentAddField
match required fields and calculate boost, then apply to desired files as shown in example DancingGoatLuceneIndexingStrategy.OnDocumentAddField
differences too small in boosts will be ignored by Lucene
Sample features
Trigger rebuild of index via webhook
Rebuild of index could be triggered by calling POST
on webhook /search/rebuild
with body
{
"indexName": "...",
"secret": "..."
}
This could be used to trigger regular reindexing of content via CRON, Windows Task Scheduler or any other external scheduler.
Contributing
For Contributing please see CONTRIBUTING.md
for more information and follow the CODE_OF_CONDUCT
.
Requirements
.NET SDK >= 7.0.109
Node.js >= 18.12
Sample Project
To run the Sample app Admin customization in development mode, add the following to your User Secrets for the application.
"CMSAdminClientModuleSettings": {
"kentico-xperience-integrations-lucene": {
"Mode": "Proxy",
"Port": 3009
}
}
License
Distributed under the MIT License. See LICENSE.md
for more information.
Support
This contribution has Full support by 7-day bug-fix policy.
See SUPPORT.md
for more information.
For any security issues see SECURITY.md
.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- Kentico.Xperience.Admin (>= 26.4.0)
- Kentico.Xperience.WebApp (>= 26.4.0)
- Lucene.Net (>= 4.8.0-beta00016)
- Lucene.Net.Analysis.Common (>= 4.8.0-beta00016)
- Lucene.Net.Facet (>= 4.8.0-beta00016)
- Microsoft.AspNetCore.Html.Abstractions (>= 2.2.0)
- Microsoft.AspNetCore.Http.Abstractions (>= 2.2.0)
- Microsoft.AspNetCore.Mvc.ViewFeatures (>= 2.2.0)
- System.Configuration.ConfigurationManager (>= 6.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
10.0.0 | 742 | 10/29/2024 |
9.0.1 | 809 | 10/9/2024 |
9.0.0 | 1,008 | 9/4/2024 |
8.1.0 | 453 | 8/20/2024 |
8.0.0 | 312 | 8/14/2024 |
7.0.2 | 541 | 7/12/2024 |
7.0.1 | 814 | 6/4/2024 |
7.0.0 | 605 | 5/6/2024 |
6.1.0 | 1,297 | 4/22/2024 |
6.0.0 | 139 | 4/19/2024 |
6.0.0-prerelease-1 | 87 | 4/18/2024 |
5.0.0 | 350 | 4/10/2024 |
5.0.0-prerelease-1 | 85 | 4/10/2024 |
4.2.0 | 280 | 3/25/2024 |
4.1.0 | 870 | 2/1/2024 |
4.1.0-prerelease-4 | 99 | 1/31/2024 |
4.1.0-prerelease-3 | 87 | 1/31/2024 |
4.1.0-prerelease-2 | 79 | 1/31/2024 |
4.1.0-prerelease-1 | 85 | 1/31/2024 |
4.0.0 | 186 | 1/17/2024 |
3.0.0 | 148 | 1/12/2024 |
3.0.0-v28preview-3 | 87 | 1/12/2024 |
3.0.0-v28preview-2 | 92 | 1/12/2024 |
3.0.0-v28preview | 110 | 12/21/2023 |
2.0.1 | 238 | 9/22/2023 |
2.0.0 | 195 | 9/12/2023 |
1.0.0 | 177 | 8/15/2023 |
1.0.0-prerelease-1 | 166 | 8/2/2023 |