{"id":19700429,"url":"https://github.com/foundatiofx/foundatio.parsers","last_synced_at":"2026-01-17T15:04:37.927Z","repository":{"id":47460370,"uuid":"28691669","full_name":"FoundatioFx/Foundatio.Parsers","owner":"FoundatioFx","description":"A lucene style query parser that is extensible and allows modifying the query.","archived":false,"fork":false,"pushed_at":"2025-03-31T14:21:41.000Z","size":1410,"stargazers_count":66,"open_issues_count":7,"forks_count":20,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-04-09T11:08:28.487Z","etag":null,"topics":["aggregation","aliases","c-sharp","elasticsearch","foundatio","lucene","macros","parse","parsers","peg","pegasus","query"],"latest_commit_sha":null,"homepage":"https://www.nuget.org/packages/Foundatio.Parsers.LuceneQueries/","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FoundatioFx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"exceptionless"}},"created_at":"2015-01-01T17:42:21.000Z","updated_at":"2025-01-31T18:29:50.000Z","dependencies_parsed_at":"2023-11-13T01:38:52.520Z","dependency_job_id":"0decb74e-a941-4c32-9346-5b49d25d8d88","html_url":"https://github.com/FoundatioFx/Foundatio.Parsers","commit_stats":{"total_commits":659,"total_committers":14,"mean_commits":47.07142857142857,"dds":0.3429438543247344,"last_synced_commit":"5e6b3227224fa558e09a8298137b91d3461c478d"},"previous_names":["exceptionless/exceptionless.lucenequeryparser"],"tags_count":60,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FoundatioFx%2FFoundatio.Parsers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FoundatioFx%2FFoundatio.Parsers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FoundatioFx%2FFoundatio.Parsers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FoundatioFx%2FFoundatio.Parsers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FoundatioFx","download_url":"https://codeload.github.com/FoundatioFx/Foundatio.Parsers/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248027407,"owners_count":21035594,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aggregation","aliases","c-sharp","elasticsearch","foundatio","lucene","macros","parse","parsers","peg","pegasus","query"],"created_at":"2024-11-11T21:06:01.044Z","updated_at":"2026-01-17T15:04:37.913Z","avatar_url":"https://github.com/FoundatioFx.png","language":"C#","funding_links":["https://github.com/sponsors/exceptionless"],"categories":[],"sub_categories":[],"readme":"![Foundatio](https://raw.githubusercontent.com/FoundatioFx/Foundatio/master/media/foundatio-dark-bg.svg#gh-dark-mode-only \"Foundatio\")![Foundatio](https://raw.githubusercontent.com/FoundatioFx/Foundatio/master/media/foundatio.svg#gh-light-mode-only \"Foundatio\")\n\n[![Build status](https://github.com/FoundatioFx/Foundatio.Parsers/workflows/Build/badge.svg)](https://github.com/FoundatioFx/Foundatio.Parsers/actions)\n[![NuGet Version](http://img.shields.io/nuget/v/Foundatio.Parsers.LuceneQueries.svg?style=flat)](https://www.nuget.org/packages/Foundatio.Parsers.LuceneQueries/)\n[![feedz.io](https://img.shields.io/badge/endpoint.svg?url=https%3A%2F%2Ff.feedz.io%2Ffoundatio%2Ffoundatio%2Fshield%2FFoundatio.Parsers.LuceneQueries%2Flatest)](https://f.feedz.io/foundatio/foundatio/packages/Foundatio.Parsers.LuceneQueries/latest/download)\n[![Discord](https://img.shields.io/discord/715744504891703319)](https://discord.gg/6HxgFCx)\n\nA lucene style query parser that is extensible and allows additional syntax features. Also includes an Elasticsearch query_string query replacement that greatly enhances its capabilities for dynamic queries.\n\n## Getting Started (Development)\n\n[This package](https://www.nuget.org/packages/Foundatio.Parsers.LuceneQueries/) can be installed via the [NuGet package manager](https://docs.nuget.org/consume/Package-Manager-Dialog). If you need help, please contact us via in-app support or [open an issue](https://github.com/exceptionless/Foundatio.Parsers/issues/new). We’re always here to help if you have any questions!\n\n1. You will need to have [Visual Studio Code](https://code.visualstudio.com) installed.\n2. Open the `Foundatio.Parsers.slnx` Visual Studio solution file.\n\n## Using LuceneQueryParser\n\nBelow is a small sampling of the things you can accomplish with LuceneQueryParser, so check it out! We use this library extensively in [Exceptionless](https://github.com/exceptionless/Exceptionless)!\n\nIn the sample below we will parse a query and output it's structure using the `DebugQueryVisitor` and then generate the same exact query using the parse result.\n\n```csharp\nusing Foundatio.Parsers.LuceneQueries;\nusing Foundatio.Parsers.LuceneQueries.Visitors;\n\nvar parser = new LuceneQueryParser();\nvar result = parser.Parse(\"field:[1 TO 2]\");\nDebug.WriteLine(DebugQueryVisitor.Run(result));\n```\n\nHere is the parse result as shown from the `DebugQueryVisitor`\n\n```txt\nGroup:\n  Left - Term:\n      TermMax: 2\n      TermMin: 1\n      MinInclusive: True\n      MaxInclusive: True\n      Field:\n          Name: field\n```\n\nFinally, lets translate the parse result back into the original query.\n\n```csharp\nvar generatedQuery = GenerateQueryVisitor.Run(result);\nSystem.Diagnostics.Debug.Assert(query == generatedQuery);\n```\n\n## [Query Syntax](docs/query.md)\n\n## [Aggregation Syntax](docs/aggregations.md)\n\n## Features\n\n- Lucene Query Syntax Parser\n  - Parsers fairly standardized syntax from [Lucene](https://lucene.apache.org/core/2_9_4/queryparsersyntax.html) and [Elasticsearch](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html).\n  - Visitors for extensibility\n- Field Aliases (static and dynamic)\n- Query Includes\n  - Define stored queries that can be included inside other queries as macros that will be expanded\n- Validation\n  - Validate query syntax\n  - Restrict access to specific fields\n  - Restrict the number of operations allowed\n  - Restrict nesting depth\n- Elasticsearch\n  - Elastic query string query replacement on steriods\n  - Dynamic search and filter expressions\n  - Dynamic aggregation expressions\n    - Supported bucket aggregations: terms, geo grid, date histogram, numeric histogram\n      - Bucket aggregations allow nesting other dynamic aggregations inside\n    - Supported metric aggregations: min, max, avg, sum, stats, extended stats, cardinality, missing, percentiles\n  - Dynamic sort expressions\n  - Dynamic expressions can be exposed to end users to allow for custom searches, filters, sorting and aggregations\n    - Enables allowing users to build custom views, charts and dashboards\n    - Enables powerful APIs that allow users to do things you never thought of\n  - Supports geo queries (proximity and radius)\n    - mygeo:75044~75mi\n      - Returns all documents that have a value in the mygeo field that is within a 75 mile radius of the 75044 zip code\n  - Supports nested document mappings\n  - Automatically resolves non-analyzed keyword sub-fields for sorting and aggregations\n  - Aliases can be defined right on your NEST mappings\n    - Supports both root and inner field name aliases\n\n## Thanks to all the people who have contributed\n\n[![contributors](https://contributors-img.web.app/image?repo=FoundatioFx/Foundatio.Parsers)](https://github.com/FoundatioFx/Foundatio.Parsers/graphs/contributors)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoundatiofx%2Ffoundatio.parsers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffoundatiofx%2Ffoundatio.parsers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoundatiofx%2Ffoundatio.parsers/lists"}