Copied to clipboard

Flag this post as spam?

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

  • André Lange 108 posts 410 karma points
    Apr 23, 2020 @ 12:58
    André Lange

    Examine search return no results

    In Umbraco 8 i am trying to get search to work. I have followed the documentation, but i am givin no result. If i test searching in the backoffice, it works fine.

    My search code:

    if (ExamineManager.Instance.TryGetIndex("ExternalIndex", out var index))
                    var searcher = index.GetSearcher();
                    var results = searcher.CreateQuery("content", BooleanOperation.Or)
                                            .Field("pageTitle", searchTerm)
                                            .Or().Field("subPagetitle", searchTerm)
                                            .Or().Field("grid", searchTerm)
                    var r = results;

    Can anyone see what i am doing wrong ?

  • mmaty 104 posts 256 karma points
    Dec 17, 2020 @ 11:32

    Did you find a solution for this problem?

    I tried the simplest possible solution:

    var examineManager = Current.Factory.GetInstance<IExamineManager>();
    IIndex index;
    if (!examineManager.TryGetIndex( "ExternalIndex", out index ))
        return null;
    return index.GetSearcher().Search( searchString );

    This is exactly the code used by the Umbraco ExamineManagementController. But it doesn't give me any results. In the backoffice the queries work, but my code doesn't. If I use the same code with the InternalIndex, it works.

  • Pedro Mendes 45 posts 219 karma points
    May 25, 2023 @ 15:04
    Pedro Mendes

    Hey there, future here!

    Did any of you find any solution for this?

  • mmaty 104 posts 256 karma points
    May 25, 2023 @ 15:47

    With Umbraco 9 / 10 this behavior seems to be gone.

Please Sign in or register to post replies

Write your reply to: