umbraco / Umbraco-CMS

Umbraco is a free and open source .NET content management system helping you deliver delightful digital experiences.
https://umbraco.com
MIT License
4.42k stars 2.67k forks source link

Lucene Error when publishing a node: Lucene.Net.QueryParsers.Classic.ParseException: Encountered " <OR> "OR "" at line 1, column 5. #16223

Closed biapar closed 1 month ago

biapar commented 4 months ago

Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)

Umbraco version 13.1.1

Bug summary

When I publish a node, I've this Lucene error:

Lucene.Net.QueryParsers.Classic.ParseException: Encountered " "OR "" at line 1, column 5. Was expecting one of:

... "(" ... "*" ... ... ... ... ... ... "[" ... "{" ... ... at Lucene.Net.QueryParsers.Classic.QueryParser.Jj_consume_token(Int32 kind) at Lucene.Net.QueryParsers.Classic.QueryParser.Clause(String field) at Lucene.Net.QueryParsers.Classic.QueryParser.Query(String field) at Lucene.Net.QueryParsers.Classic.QueryParser.Clause(String field) at Lucene.Net.QueryParsers.Classic.QueryParser.Query(String field) at Lucene.Net.QueryParsers.Classic.QueryParser.TopLevelQuery(String field) at Lucene.Net.QueryParsers.Classic.QueryParserBase.Parse(String query) --- End of inner exception stack trace --- at Lucene.Net.QueryParsers.Classic.QueryParserBase.Parse(String query) at Examine.Lucene.Search.LuceneSearchQueryBase.NativeQuery(String query) at Umbraco.Cms.Infrastructure.Examine.DeliveryApiContentIndex.PerformDeleteFromIndex(IEnumerable`1 itemIds, Action`1 onComplete) at Examine.BaseIndexProvider.DeleteFromIndex(IEnumerable`1 itemIds) at Umbraco.Cms.Infrastructure.Examine.Deferred.DeliveryApiContentIndexDeferredBase.RemoveFromIndex(IReadOnlyCollection`1 ids, IIndex index) at Umbraco.Cms.Infrastructure.Examine.Deferred.DeliveryApiContentIndexDeferredBase.RemoveFromIndex(IReadOnlyCollection`1 ids, IIndex index) at Umbraco.Cms.Infrastructure.Examine.Deferred.DeliveryApiContentIndexDeferredBase.RemoveFromIndex(Int32 id, IIndex index) at Umbraco.Cms.Infrastructure.Examine.Deferred.DeliveryApiContentIndexHandleContentChanges.Reindex(IContent content, IIndex index) at Umbraco.Cms.Infrastructure.Examine.Deferred.DeliveryApiContentIndexHandleContentChanges.b__7_0(CancellationToken _) at Umbraco.Cms.Infrastructure.HostedServices.QueuedHostedService.BackgroundProcessing(CancellationToken stoppingToken) This error slow the publishing action, too. ### Specifics _No response_ ### Steps to reproduce When Save or Publish a node. I've a lots members and nodes. ### Expected result / actual result _No response_
github-actions[bot] commented 4 months ago

Hi there @biapar!

Firstly, a big thank you for raising this issue. Every piece of feedback we receive helps us to make Umbraco better.

We really appreciate your patience while we wait for our team to have a look at this but we wanted to let you know that we see this and share with you the plan for what comes next.

We wish we could work with everyone directly and assess your issue immediately but we're in the fortunate position of having lots of contributions to work with and only a few humans who are able to do it. We are making progress though and in the meantime, we will keep you in the loop and let you know when we have any questions.

Thanks, from your friendly Umbraco GitHub bot :robot: :slightly_smiling_face:

Shazwazza commented 1 month ago

This will be caused by passing in empty fields/strings or something similar to that with however Umbraco is creating its manual Lucene query with the call to "Examine.Lucene.Search.LuceneSearchQueryBase.NativeQuery". Perhaps this is already fixed in later Umbraco versions?

Shazwazza commented 1 month ago

I believe this is fixed here https://github.com/umbraco/Umbraco-CMS/pull/15848

biapar commented 1 month ago

I’ll check. I don’t understand which query cause the problem. I cannot use a query direct on the index.

Shazwazza commented 1 month ago

Its part of Umbraco's logic that creates the native query to pass to examine. Please try the latest Umbraco 13 version, it should be resolved.

kjac commented 1 month ago

This does indeed look like the issue fixed in #15848

image

I'll close this as a duplicate.

@biapar please try upgrading to 13.3. If that does not resolve your problem, feel free to reopen this issue with steps to reproduce 👍

biapar commented 1 month ago

Solved with the fix into latest version Umbraco 13