Foundatio.Lucene 0.1.0

Prefix Reserved
dotnet add package Foundatio.Lucene --version 0.1.0
                    
NuGet\Install-Package Foundatio.Lucene -Version 0.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Foundatio.Lucene" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Foundatio.Lucene" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Foundatio.Lucene" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Foundatio.Lucene --version 0.1.0
                    
#r "nuget: Foundatio.Lucene, 0.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Foundatio.Lucene@0.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Foundatio.Lucene&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Foundatio.Lucene&version=0.1.0
                    
Install as a Cake Tool

Build status NuGet Version feedz.io Discord

Foundatio Lucene

A library for adding dynamic Lucene-style query capabilities to your .NET applications. Enable your users to write powerful search queries using familiar Lucene syntax, with support for Entity Framework and Elasticsearch.

This project is a modern replacement for Foundatio.Parsers.

✨ Why Choose Foundatio Lucene?

  • πŸ” Full Lucene Syntax - Terms, phrases, fields, ranges, boolean operators, wildcards, regex
  • ⚑ Entity Framework Integration - Convert Lucene queries directly to LINQ expressions
  • πŸ”Ž Elasticsearch Support - Generate Elasticsearch Query DSL using the official .NET 9.x client
  • 🧩 Visitor Pattern - Transform, validate, or analyze queries with composable visitors
  • πŸ—ΊοΈ Field Aliasing - Map user-friendly field names to your actual data model
  • βœ… Query Validation - Restrict allowed fields, operators, and patterns
  • πŸ”„ Round-Trip Capable - Parse queries to AST and convert back to query strings
  • πŸ›‘οΈ Error Recovery - Resilient parser returns partial AST with detailed error information

πŸš€ Quick Example

using Foundatio.Lucene;
using Foundatio.Lucene.EntityFramework;

// Parse a Lucene query
var result = LuceneQuery.Parse("title:hello AND status:active");

// Or build LINQ expressions for Entity Framework
var parser = new EntityFrameworkQueryParser();
Expression<Func<Employee, bool>> filter = parser.BuildFilter<Employee>(
    "name:john AND salary:[50000 TO *]"
);

var employees = await context.Employees.Where(filter).ToListAsync();

πŸ“š Learn More

πŸ‘‰ Complete Documentation

Key topics:

πŸ“¦ CI Packages (Feedz)

Want the latest CI build before it hits NuGet? Add the Feedz source (read-only public) and install the pre-release version:

dotnet nuget add source https://f.feedz.io/foundatio/foundatio/nuget -n foundatio-feedz
dotnet add package Foundatio.Lucene --prerelease

Or add to your NuGet.config:

<configuration>
    <packageSources>
        <add key="foundatio-feedz" value="https://f.feedz.io/foundatio/foundatio/nuget" />
    </packageSources>
    <packageSourceMapping>
        <packageSource key="foundatio-feedz">
            <package pattern="Foundatio.*" />
        </packageSource>
    </packageSourceMapping>
</configuration>

CI builds are published with pre-release version tags (e.g. 1.0.0-preview.12345+sha.abcdef). Use them to try new features earlyβ€”avoid in production unless you understand the changes.

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request. See our documentation for development guidelines.

πŸ“„ License

Apache 2.0

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.
  • net8.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Foundatio.Lucene:

Package Downloads
Foundatio.Lucene.Elasticsearch

Elasticsearch Query DSL generator for Lucene Query syntax using Elastic.Clients.Elasticsearch 9.x

Foundatio.Lucene.EntityFramework

Dynamic Lucene-style query support for Entity Framework and Elasticsearch. Enable powerful user-driven search queries in your .NET applications.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0 137 1/12/2026