Copied to clipboard

Flag this post as spam?

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


  • Mus'ab 157 posts 384 karma points notactivated
    Dec 07, 2019 @ 13:09
    Mus'ab
    0

    limit the examine search results

    Hi

    is there anyway to limit the number of results that returned by examine search and i noticed that the maximum number of results returned by examine search is 500 nodes is there some thing i can add to my code to control its limit or make it return all results without limitation ?

    if (ExamineManager.Instance.TryGetIndex("InternalIndex", out var index))
            {
                var mainSettings = Umbraco.Content(152407);
                var searcher = index.GetSearcher();
                ISearchResults ExamineResults = null;
                var query = searcher.CreateQuery("content");
                IBooleanOperation queryOperations = query.Field("__NodeTypeAlias", "newsItem");
        ExamineResults = queryOperations.OrderByDescending(new SortableField[] { new SortableField("publish_time") }).Execute();
    

    }

    and if body can give an advice about sortable filed how can i make it work i will be thxfull.

  • Yakov Lebski 473 posts 1878 karma points
    Dec 07, 2019 @ 18:24
    Yakov Lebski
    0

    I don't know about any number limitation by default in Umbraco - it's should return all nodes by your query.

    Sort field works by lucene type, you should define it examine config and set value in right format

  • Mus'ab 157 posts 384 karma points notactivated
    Dec 07, 2019 @ 18:57
    Mus'ab
    0

    do you have an example for that please ?

  • Mus'ab 157 posts 384 karma points notactivated
    Dec 10, 2019 @ 08:09
    Mus'ab
    0

    i found The solution for examine max result you can type .Execute(max number of results); and its 500 by default

    but still note sure about sortable field because umbraco 8 dont have config for examine like 7

Please Sign in or register to post replies

Write your reply to:

Draft