Copied to clipboard

Flag this post as spam?

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


  • Jonas Korsgaard 1 post 71 karma points
    Jan 03, 2023 @ 09:02
    Jonas Korsgaard
    0

    Examine ISearchResults returns unexpected results.

    I have a technical question about ISearchResults. The following query:

    ISearchResults searchResults = index.Searcher
    .CreateQuery(IndexTypes.Media)
    .GroupedOr(new[] { UmbracoExamineFieldNames.ItemTypeFieldName, "type" }, new[] { ProtectedImage.ModelTypeAlias, ProtectedFile.ModelTypeAlias, ProtectedExternalVideo.ModelTypeAlias })
    .And()
    .GroupedOr(new[] { UmbracoExamineFieldNames.NodeKeyFieldName }, keys)
    .Execute();
    

    where keys are an array with the following values:

    ["1b8527f3-74d0-465a-a5ca-336973eb7e2c", "45d1fcc4-3c44-4a99-8ead-401f6d2174f2", "fe629cbe-f4cb-4310-97a4-8e48c3e28df8"]
    

    The query result returns back the following content keys:

    ["1b8527f3-74d0-465a-a5ca-336973eb7e2c", "45d1fcc4-3c44-4a99-8ead-401f6d2174f2", "fe629cbe-f4cb-4310-97a4-8e48c3e28df8", "e99924e1-ae3b-4a99-966a-06e20469563f"]
    

    The problem is we give the query 3 keys, yet it find 4 elements? The query should at most give me the same amount of individual content as the amount of keys, yet this is not the case.

    Can anyone explain why this is happening?

Please Sign in or register to post replies

Write your reply to:

Draft