Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to build a lucene filter with special characters: f=mydate:[now/d TO now/d+30d/d] #101

Open
niemyjski opened this issue Nov 22, 2024 · 2 comments
Labels

Comments

@niemyjski
Copy link
Member

niemyjski commented Nov 22, 2024

Reported by @ttugrad01

GET /count?f=mydate:[now/d TO now/d+30d/d]

  "message": "Invalid query: Unexpected character 'e'.",
  "is_error": true,
  "detail": "   at Foundatio.Parsers.LuceneQueries.Extensions.QueryVisitorContextExtensions.ThrowIfInvalid(IQueryVisitorContext context) in /_/src/Foundatio.Parsers.LuceneQueries/Extensions/QueryVisitorContextExtensions.cs:line 132\n   at Foundatio.Parsers.ElasticQueries.ElasticQueryParser.BuildQueryAsync(String query, IElasticQueryVisitorContext context) in /_/src/Foundatio.Parsers.ElasticQueries/ElasticQueryParser.cs:line 173\n   at Foundatio.Repositories.Elasticsearch.Queries.Builders.ParsedExpressionQueryBuilder.BuildAsync[T](QueryBuilderContext`1 ctx) in /_/src/Foundatio.Repositories.Elasticsearch/Queries/Builders/ExpressionQueryBuilder.cs:line 212\n   at Foundatio.Repositories.Elasticsearch.Queries.Builders.ElasticQueryBuilder.BuildAsync[T](QueryBuilderContext`1 ctx) in /_/src/Foundatio.Repositories.Elasticsearch/Queries/Builders/ElasticQueryBuilder.cs:line 178\n   at Foundatio.Repositories.Elasticsearch.Queries.Builders.ElasticQueryBuilderExtensions.BuildQueryAsync[T](IElasticQueryBuilder builder, IRepositoryQuery query, ICommandOptions options, SearchDescriptor`1 search) in /_/src/Foundatio.Repositories.Elasticsearch/Queries/Builders/IElasticQueryBuilder.cs:line 119\n   at Foundatio.Repositories.Elasticsearch.Queries.Builders.ElasticQueryBuilderExtensions.ConfigureSearchAsync[T](IElasticQueryBuilder builder, IRepositoryQuery query, ICommandOptions options, SearchDescriptor`1 search) in /_/src/Foundatio.Repositories.Elasticsearch/Queries/Builders/IElasticQueryBuilder.cs:line 133\n   at Foundatio.Repositories.Elasticsearch.ElasticReadOnlyRepositoryBase`1.ConfigureSearchDescriptorAsync(SearchDescriptor`1 search, IRepositoryQuery query, ICommandOptions options) in /_/src/Foundatio.Repositories.Elasticsearch/Repositories/ElasticReadOnlyRepositoryBase.cs:line 697\n   at Foundatio.Repositories.Elasticsearch.ElasticReadOnlyRepositoryBase`1.CountAsync(IRepositoryQuery query, ICommandOptions options) in /_/src/Foundatio.Repositories.Elasticsearch/Repositories/ElasticReadOnlyRepositoryBase.cs:line 510\n   at 
@niemyjski niemyjski added the bug label Nov 22, 2024
@ejsmith
Copy link
Contributor

ejsmith commented Dec 21, 2024

This is parsed just fine by the parser.

Group:
    Left - Term Range: 
        Field: mydate
        Original Field: mydate
        IsNegated: False
        Max: now/d+30d/d
        Min: now/d
        MinInclusive: True
        MaxInclusive: True

@niemyjski
Copy link
Member Author

Any ideas why that extension would throw? @ttugrad01 can you please provide any more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants