Copied to clipboard

Flag this post as spam?

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

  • steschu 75 posts 412 karma points
    May 10, 2019 @ 13:08

    Examine Search Media Files Problem


    I am struggling with Examine. As I understand, by default all nodesTypes and all properties are indexed and searched with the ExternalSearcher. Thus also Media files are searched and indexed.

    Indeed, when I set up a very simple query like

    var searcher = ExamineManager.Instance.SearchProviderCollection["ExternalSearcher"];
    var searchCriteria = searcher.CreateSearchCriteria();
    searcher.Search("Vorlage", true);

    it queries all nodeTypes and properties for strings starting with "vorlage". I do have some files in the media section that start with "vorlage" in the filename (umbracoFile property), they should be found.

    When I debug the resultig ISearchResults it displayes 0 Docs and TotalItems 12. But I cannot expand the view. Can anybody explain that to me? How do I get the files as a search result? Is this the right way to achive it.

    see screnshot here

  • Carlos Gomes 37 posts 183 karma points
    May 11, 2019 @ 22:43
    Carlos Gomes

    As far as I know - and please someone correct me and show me how to do that if I am wrong - Umbraco does not index any file within the media section.

    There is this nugget to index the media files but it seems to be outdated.


  • steschu 75 posts 412 karma points
    May 12, 2019 @ 08:05

    Somewhere in the documentation I read that the Indexer does index every nodetype with every property by default. I thought files in the media sections are nothing but a node, so they should be indexed, too?

    There is also an overload of the ExamineManager.Instance.CreateSearchCriteria Method where you can pass "media" as a parameter, that indicates that media files are part of the index?

    Actually there is contradictory information in the forum about whether this is possible or not.


  • steschu 75 posts 412 karma points
    May 13, 2019 @ 10:00

    Can anybody help?

  • steschu 75 posts 412 karma points
    May 28, 2019 @ 12:26

    Ok, this was my fault! Actually Examine did everything right! The media files were found and contained in the Examine search result.

    What I did wrong was: I accidentially looked up all found items (using the id) with the TypedContent(int id) method of the UmbracoHelper class. But this of course only works for documents! If the found item is an media item, then you have to use TypedMedia(int id).

Please Sign in or register to post replies

Write your reply to: