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.
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.
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).
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
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.
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,
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
Can anybody help?
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).
is working on a reply...