Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • ewuski 99 posts 288 karma points
    Jun 20, 2022 @ 18:14
    ewuski
    0

    Weird error - "cannot parse" - returned by examine search

    I am getting a strange error from a basic examine query, it looks like:

    {"Cannot parse '__IndexType:content': Encountered \"<EOF>\" at line 1, column 19.\r\nWas expecting one of:\r\n    <BAREOPER> ...\r\n    \"(\" ...\r\n    \"*\" ...\r\n    <QUOTED> ...\r\n    <TERM> ...\r\n    <PREFIXTERM> ...\r\n    <WILDTERM> ...\r\n    <REGEXPTERM> ...\r\n    \"[\" ...\r\n    \"{\" ...\r\n    <NUMBER> ...\r\n    "}
    

    or like:

    {"Cannot parse '__IndexType:content': Encountered \"<EOF>\" at line 1,
    column 0.\r\nWas expecting one of:\r\n    <NOT> ...\r\n    \"+\"
    ...\r\n    \"+\" ...\r\n    \"-\" ...\r\n    \"-\" ...\r\n   
    <BAREOPER> ...\r\n    <BAREOPER> ...\r\n    \"(\" ...\r\n    \"(\"
    ...\r\n    \"*\" ...\r\n    <QUOTED> ...\r\n    \"*\" ...\r\n   
    <TERM> ...\r\n    <PREFIXTERM> ...\r\n    <QUOTED> ...\r\n   
    <WILDTERM> ...\r\n    <REGEXPTERM> ...\r\n    \"[\" ...\r\n   
    <WILDTERM> ...\r\n    <REGEXPTERM> ...\r\n    \"[\" ...\r\n    \"{\"
    ...\r\n    <NUMBER> ...\r\n    <TERM> ...\r\n    \"*\" ...\r\n   
    \"*\" ...\r\n    "}
    

    The query is simple:

    Category: "content", LuceneQuery: {+__NodeTypeAlias:product
    +countryCode:ge -umbracoNaviHide:1}
    

    The error happens on execution:

    searchResults = searchQuery.Execute();
    

    Anyone knows what's going on and what this error means?

    I had the same data in Umbraco 7 site and all worked well. I had never such or similar error returned by the searched content.

  • ewuski 99 posts 288 karma points
    Jun 30, 2022 @ 13:21
    ewuski
    0

    It usually happens on the first result search. I I reload the page the results are fetched with no issues.

  • Niels Lynggaard 193 posts 551 karma points
    Jul 06, 2022 @ 08:57
    Niels Lynggaard
    0

    I'm seeing the exact same issue... It almost always happens the first time this runs, and then pops up again randomly...

    I've been going nuts over this for a few weeks now.

    My Query is even simpler;

        var query = searcher.CreateQuery("content").NodeTypeAlias("lmeWarehouse");
    ISearchResults searchresults = query.Execute();
    

    I've tried splitting this up as well, so that the IQuery is created first (CreateQuery("content")) and then added the boolean-operations afterwards, but the error is still persisting (Umbraco 9.5.0).

    I'm going to try to use nativequery instead of the examine API next to see if I can get around this..

    Sorry, this is not really an answer, but good to know that I'm not the only one going nuts about this...

    Cheers, Niels

  • Niels Lynggaard 193 posts 551 karma points
    Jul 06, 2022 @ 09:07
    Niels Lynggaard
    100

    Someone found a workaround here; https://our.umbraco.com/forum/using-umbraco-and-getting-started/108739-umbraco-9-search-eof

    searcher.CreateQuery().NativeQuery($"+__IndexType:{IndexTypes.Content}").And()
    
  • ewuski 99 posts 288 karma points
    Jul 06, 2022 @ 13:29
    ewuski
    0

    Niels, I am glad too that it is not something I messed up!

    Thanks a lot for sharing the workaround, I'll try to see if it fix my issue and report.

  • ewuski 99 posts 288 karma points
    Sep 04, 2022 @ 08:27
    ewuski
    0

    I can confirm I have not the problem since I added NativeQuery so your solution works.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies