Copied to clipboard

Flag this post as spam?

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


  • Remko 60 posts 158 karma points
    Mar 12, 2019 @ 16:06
    Remko
    0

    v8 - How does umbracoHelper.Search work in v8 (with IQueryExecutor?) ?

    The old way:

    var query = ExamineManager.Instance.CreateSearchCriteria();
    query.Field("testProperty", "IsEqualToThisValue");
    
    var results = umbracoHelper.Search(query).ToList();
    

    Now there is:

     umbracoHelper.ContentQuery.Search(IQueryExecutor ??)
    

    How should I create the query object, is it IQuery I should use? And how can I get the instance for this in the first place?

  • Sebastiaan Janssen 4815 posts 14087 karma points MVP admin hq
    Mar 13, 2019 @ 09:20
    Sebastiaan Janssen
    0

    Haven't tried it but this seems like you'd want to use this method instead: IEnumerable<PublishedSearchResult> Search(string term, int skip, int take, out long totalRecords, string culture = null, string indexName = null);

  • Remko 60 posts 158 karma points
    Mar 13, 2019 @ 09:22
    Remko
    0

    Hi Sebastiaan,

    No I know that one.. But I'd like to use IQuery instead of query in a string...

  • Sebastiaan Janssen 4815 posts 14087 karma points MVP admin hq
    Mar 13, 2019 @ 09:29
    Sebastiaan Janssen
    0

    IQueryExectutor is not doing anything else magic, it uses the paged method above directly:

    enter image description here

Please Sign in or register to post replies

Write your reply to:

Draft