An open API service indexing awesome lists of open source software.

https://github.com/kentico/xperience-by-kentico-lucene

Xperience by Kentico search integration with the latest 4.8 beta version of Lucene.NET
https://github.com/kentico/xperience-by-kentico-lucene

aspnetcore dotnet lucene-net xperience-by-kentico xperience-by-kentico-integrations

Last synced: 3 months ago
JSON representation

Xperience by Kentico search integration with the latest 4.8 beta version of Lucene.NET

Awesome Lists containing this project

README

          

# Xperience by Kentico Lucene

[![7-day bug-fix policy](https://img.shields.io/badge/-7--days_bug--fixing_policy-grey?labelColor=orange&logo=data:image/svg+xml;base64,PHN2ZyBjbGFzcz0ic3ZnLWljb24iIHN0eWxlPSJ3aWR0aDogMWVtOyBoZWlnaHQ6IDFlbTt2ZXJ0aWNhbC1hbGlnbjogbWlkZGxlO2ZpbGw6IGN1cnJlbnRDb2xvcjtvdmVyZmxvdzogaGlkZGVuOyIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik04ODguNDkgMjIyLjY4NnYtMzEuNTRsLTY1LjY3Mi0wLjk1NWgtMC4yMDVhNDY1LjcxNSA0NjUuNzE1IDAgMCAxLTE0NC4zMTUtMzEuMzM0Yy03Ny4wMDUtMzEuMTk4LTEyNi4yOTQtNjYuNzY1LTEyNi43MDMtNjcuMTA3bC0zOS44LTI4LjY3Mi0zOS4xODUgMjguNDY4Yy0yLjA0OCAxLjUwMS00OS45MDMgMzYuMDQ0LTEyNi45MDggNjcuMzFhNDQ3LjQyIDQ0Ny40MiAwIDAgMS0xNDQuNTIgMzEuMzM1bC02NS44NzcgMC45NTZ2Mzc4Ljg4YzAgODcuMDQgNDkuODM0IDE4NC42NjEgMTM3LjAxIDI2Ny44MSAzNy41NDcgMzUuODQgNzkuMjU4IDY2LjM1NSAxMjAuODMzIDg4LjIgNDMuMjggMjIuNzMzIDg0LjI0IDM0LjYxMiAxMTguODUyIDM0LjYxMiAzN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IDAgMCA0NS4zMjggMEw3MTMuMzIgNDEzLjlhMzIuMjIyIDMyLjIyMiAwIDAgMCAwLTQ1LjMzeiIgIC8+PC9zdmc+)](https://github.com/Kentico/.github/blob/main/SUPPORT.md#full-support) [![CI: Build and Test](https://github.com/Kentico/xperience-by-kentico-lucene/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/Kentico/xperience-by-kentico-lucene/actions/workflows/ci.yml)

| | Package |
| -------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------: |
| Lucene | [![NuGet Package](https://img.shields.io/nuget/v/Kentico.Xperience.Lucene.svg)](https://www.nuget.org/packages/Kentico.Xperience.Lucene) |
| Lucene Administration only | [![NuGet Package](https://img.shields.io/nuget/v/Kentico.Xperience.Lucene.svg)](https://www.nuget.org/packages/Kentico.Xperience.Lucene.Admin) |
| Lucene Live site only | [![NuGet Package](https://img.shields.io/nuget/v/Kentico.Xperience.Lucene.svg)](https://www.nuget.org/packages/Kentico.Xperience.Lucene.Core) |

## Description

Xperience by Kentico search integration with the latest 4.8 beta version of [Lucene.NET](https://github.com/apache/lucenenet),
enabling auto-indexing of content in Xperience based on application-local, code-defined search indexes and search results retrieval.

This repository contains projects for 3 NuGet packages, that is `Kentico.Xperience.Lucene.Admin`, `Kentico.Xperience.Lucene.Core` and `Kentico.Xperience.Lucene`.

Use `Kentico.Xperience.Lucene`. This is the recommended version for usage of Xperience by Kentico support for Lucene .NET NuGet package and unlike the other two contains
full support for both admin ui and live site.

Use `Kentico.Xperience.Lucene.Core` in your Xperience by Kentico project for Lucene Search in your live website.
Use `Kentico.Xperience.Lucene.Admin` in your Xperience by Kentico Administration project for Lucene Search Administration UI managment.

**Important Compatibility Notice**
This Lucene integration **requires persistent file system access** to store and manage indexes.
It is **not compatible with Kentico Xperience SaaS**, which restricts file system access.
If you plan to run this in the cloud, ensure your environment supports persistent disk writes — such as a self-hosted VM, container with mounted volume, or a traditional server.

## Screenshots

![Search results](https://raw.githubusercontent.com/Kentico/xperience-by-kentico-lucene/main/images/dancing-goat-search-results-page.png)

![Index listing](https://raw.githubusercontent.com/Kentico/xperience-by-kentico-lucene/main/images/xperience-administration-search-index-list.jpg)

![Index edit](https://raw.githubusercontent.com/Kentico/xperience-by-kentico-lucene/main/images/xperience-administration-search-index-edit-form.jpg)

## Library Version Matrix

| Xperience Version | Library Version |
| ------------------- | --------------- |
| >= 30.6.0 | >= 12.4.0 |
| >= 30.5.1 | >= 12.3.0 |
| >= 30.0.1 | >= 11.0.1 |
| >= 30.0.0 | >= 11.0.0 |
| >= 29.3.3 | >= 8.1.0 |
| >= 29.0.0 | >= 6.1.x |
| >= 28.4.3, < 29.0.0 | >= 5.x.x |
| >= 28.0.0 | >= 3.x.x |
| >= 26.2.0, < 27.0.0 | >= 2.x, < 3.x.x |

## Dependencies

- [ASP.NET Core 6.0](https://dotnet.microsoft.com/en-us/download)
- [Xperience by Kentico](https://docs.xperience.io/xp/changelog)

## Package Installation

Add the package to your application using the .NET CLI

```powershell
dotnet add package Kentico.Xperience.Lucene
```

## Quick Start

This section is relevant for each Lucene NuGet. Steps number 3 and 4 are only relevant if you use NuGet package `Kentico.Xperience.Lucene` or `Kentico.Xperience.Lucene.Admin`.

1. Define a custom `DefaultLuceneIndexingStrategy` implementation to customize how content pages/content items are processed for the index.
2. Add this library to the application services, registering your custom `DefaultLuceneIndexingStrategy` and Lucene

```csharp
// Program.cs

// Registers all services and uses default indexing behavior (no data is indexed)
services.AddKenticoLucene();

// or

// Registers all services and enables custom indexing behavior
services.AddKenticoLucene(builder =>
builder
.RegisterStrategy("DefaultStrategy")
.RegisterStrategy("ArticlesStrategy"));
```

3. Create an index in Xperience's Administration within the Search application added by this library.
4. Rebuild the index in Xperience's Administration within the Search application added by this library.
5. Use the `ILuceneSearchService` (via DI) to retrieve the index populated by your custom `ILuceneIndexingStrategy`.
6. Execute a search with a customized Lucene `Query` (like the `MatchAllDocsQuery`) using the `ILuceneSearchService`.
7. Display the results on your site with a Razor View 👍.

## Full Instructions

View the [Usage Guide](./docs/Usage-Guide.md) for more detailed instructions.

You can view and start the DancingGoat example project.
For advanced [Strategy usage](./docs/Custom-index-strategy.md) add your website url base to the `WebCrawlerBaseUrl` `appsettings.json`

```json
{
// Other settings ...
// Our example runs on localhost with port: 58093
"WebCrawlerBaseUrl": "http://localhost:58093/"
}
```

This is required for our [Scraping example](./docs/Scraping-web-page-content.md).

## Projects

| Project | Description |
| ---------------------------------- | -------------------------------------------------------------- |
| src/Kentico.Xperience.Lucene | Xperience by Kentico Lucene integration library |
| src/Kentico.Xperience.Lucene.Core | Xperience by Kentico Lucene integration Live site only library |
| src/Kentico.Xperience.Lucene.Admin | Xperience by Kentico Lucene integration Admin only library |
| examples/DancingGoat | Example project to showcase basic search functionality |

## Contributing

To see the guidelines for Contributing to Kentico open source software, please see [Kentico's `CONTRIBUTING.md`](https://github.com/Kentico/.github/blob/main/CONTRIBUTING.md) for more information and follow the [Kentico's `CODE_OF_CONDUCT`](https://github.com/Kentico/.github/blob/main/CODE_OF_CONDUCT.md).

Instructions and technical details for contributing to **this** project can be found in [Contributing Setup](./docs/Contributing-Setup.md).

## License

Distributed under the MIT License. See [`LICENSE.md`](./LICENSE.md) for more information.

## Support

[![7-day bug-fix policy](https://img.shields.io/badge/-7--days_bug--fixing_policy-grey?labelColor=orange&logo=data:image/svg+xml;base64,PHN2ZyBjbGFzcz0ic3ZnLWljb24iIHN0eWxlPSJ3aWR0aDogMWVtOyBoZWlnaHQ6IDFlbTt2ZXJ0aWNhbC1hbGlnbjogbWlkZGxlO2ZpbGw6IGN1cnJlbnRDb2xvcjtvdmVyZmxvdzogaGlkZGVuOyIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik04ODguNDkgMjIyLjY4NnYtMzEuNTRsLTY1LjY3Mi0wLjk1NWgtMC4yMDVhNDY1LjcxNSA0NjUuN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MSA3MjAuMjEzIDE5OS40NzUgNjM5LjUyMiAxOTkuNDc1IDU2OS44OVYyNTQuMjI1bDIuNzMtMC4xMzZjMy4yNzggMCA4Mi42MDQtMS41MDIgMTY3LjY2NC0zNS45NzdhNzM5Ljk0MiA3MzkuOTQyIDAgMCAwIDE0MC4yMi03NC42MTV2LTAuMDY5eiIgIC8+PHBhdGggZD0iTTcxMy4zMTggMzY4LjY0YTMyLjIyMiAzMi4yMjIgMCAwIDAtNDUuMzI5IDBMNDQ5LjE5NSA1ODcuNDM1bC05My4xODQtOTMuMTE2YTMyLjIyMiAzMi4yMjIgMCAwIDAtNDUuMzMgMCAzMi4yMjIgMzIuMjIyIDAgMCAwIDAgNDUuMjZsMTE1Ljg1IDExNS44NWEzMi4yOSAzMi4yOSAwIDAgMCA0NS4zMjggMEw3MTMuMzIgNDEzLjlhMzIuMjIyIDMyLjIyMiAwIDAgMCAwLTQ1LjMzeiIgIC8+PC9zdmc+)](https://github.com/Kentico/.github/blob/main/SUPPORT.md#full-support)

This project has **Full support by 7-day bug-fix policy**.

See [`SUPPORT.md`](https://github.com/Kentico/.github/blob/main/SUPPORT.md#full-support) for more information.

## Security

For any security issues see [Kentico's `SECURITY.md`](https://github.com/Kentico/.github/blob/main/SECURITY.md).