Copied to clipboard

Flag this post as spam?

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


  • John Hodgkinson 613 posts 355 karma points
    Jan 30, 2017 @ 20:30
    John Hodgkinson
    0

    Indexing and search of media files?

    what needs to be done to enable searching for media files (doc, docx, pdf, etc)?

    right now seeing any media files returned in search results. many thanks!

  • John Hodgkinson 613 posts 355 karma points
    Jan 30, 2017 @ 20:44
    John Hodgkinson
    0

    actually see files returned if I search for a keyword in the file name. what should the content field(s) be that are indexed and used in content or description fields? not seeing anything listed in the index properties... thanks in advance!

  • David Peck 651 posts 1765 karma points c-trib
    Jan 30, 2017 @ 21:32
    David Peck
    0

    It's not supported out of the box. See https://github.com/umbraco/UmbracoExamine.PDF

    Docx you might be out of luck for. You might have more like using an external search like the Google Custom Search Engine API.

  • John Hodgkinson 613 posts 355 karma points
    Jan 31, 2017 @ 14:17
    John Hodgkinson
    0

    thanks David. will take a look at the PDF indexing. site will only be storing internal documentation so Goggle search may not be an option.

  • John Hodgkinson 613 posts 355 karma points
    Feb 02, 2017 @ 17:07
    John Hodgkinson
    0

    I think I have this working.

    How can I output the FileTextContent for the media files?

    I see it in the Examine Mangement search results in the back office but does not appear to be available in the search preview field when I try to output the value.

                @Umbraco.RenderMacro("ezSearch", new {hideFromSearchField="umbracoNaviHide", indexType="BOTH", pageSize="5", previewFields="description,content,metaDescription,FileTextContent", previewLength="500", rootContentNodeId="1100", rootMediaNodeId="1126", searchFields="nodeName,metaTitle,metaDescription,metaKeywords,bodyText,title,subtitle,content,tags,fileTextContent,FileTextContent", searchFormLocation="TOP"})
    

    @helper RenderMediaResult(SearchViewModel model, IPublishedContent result) {

    @result.Name

        @foreach (var field in model.SearchFields.Where(field => result.HasValue(field)))
        {
            <p>@Highlight(Truncate(Umbraco.StripHtml(result.GetPropertyValue("FileTextContent").ToString()), model.PreviewLength), model.SearchTerms)</p>
            break;
        }
    </div>
    

    }

Please Sign in or register to post replies

Write your reply to:

Draft