Copied to clipboard

Flag this post as spam?

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


  • steschu 66 posts 380 karma points
    May 10, 2019 @ 13:08
    steschu
    0

    Examine Search Media Files Problem

    Hi,

    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 33 posts 176 karma points
    May 11, 2019 @ 22:43
    Carlos Gomes
    0

    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.

    https://github.com/umbraco/UmbracoExamine.PDF

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

    Thanks,

  • steschu 66 posts 380 karma points
    May 12, 2019 @ 08:05
    steschu
    0

    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.

    Stephan

  • steschu 66 posts 380 karma points
    May 13, 2019 @ 10:00
    steschu
    0

    Can anybody help?

  • steschu 66 posts 380 karma points
    May 28, 2019 @ 12:26
    steschu
    100

    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:

Draft