Copied to clipboard

Flag this post as spam?

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


  • Henrik 11 posts 61 karma points
    Dec 08, 2020 @ 09:43
    Henrik
    0

    Examine Quick Start - Error in documentation?

    I'm using the quickstart to get search up and running: https://our.umbraco.com/documentation/Reference/Searching/Examine/quick-start/

    var results = searcher.CreateQuery("content").NodeTypeAlias("textPage").And().GroupedOr(textFields, searchTerm).Execute();
    

    But when i try to restrict to a specific nodetypealias using the example code i get get an errormessage saying

    IQuery' does not contain a definition for 'NodeTypeAlias' and no accessible extension method 'NodeTypeAlias' accepting

  • Steve Morgan 1278 posts 4216 karma points c-trib
    Dec 09, 2020 @ 17:57
    Steve Morgan
    100

    Hi Henrik,

    You need to add

    @using Umbraco.Examine;
    

    At the top of your partial view (third line is good). Then it will work.

    I'll see about adding this to the documentation as that's not obvious!

    HTH

    Steve

  • Henrik 11 posts 61 karma points
    Dec 09, 2020 @ 18:20
    Henrik
    0

    Cheers

  • 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