Copied to clipboard

Flag this post as spam?

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

  • Nick 37 posts 130 karma points
    Aug 07, 2013 @ 14:08

    Search both content and PDF's in a single examine query?


    I am using Examine to search the site but currently the search is not returning PDF's that are stored in the Media folder.

    In looking at the documentation it looks like I have to create a seperate Indexer and associated Searcher and IndexSet to specifically handle indexing PDF's.

    If I do this then how can I create a search that combines both the site content index and the PDF index so that the search results include both site content and PDFs that are in the Media folder.

    I am running Umbraco 6.


  • Ismail Mayat 4511 posts 10091 karma points MVP 2x admin c-trib
    Aug 27, 2013 @ 10:59
    Ismail Mayat


    You can do it with examine multi searcher see the configuration in the first post shows you how you create the searcher using config file although you can also do it programatically

            /// <summary>
        /// for given list of examine indexes it builds up a multi searcher so u can cross search indexes
        /// </summary>
        /// <param name="indexes"></param>
        /// <returns></returns>
        public static MultiIndexSearcher GetMultiSearcher(string[] indexes)
            var directories = new List<DirectoryInfo>();
            foreach (var index in indexes)
                var indexer = ExamineManager.Instance.IndexProviderCollection[index];
                var dir = new DirectoryInfo(((LuceneIndexer)indexer).LuceneIndexFolder.FullName.Replace("\\Index", ""));
            var i = new MultiIndexSearcher(directories, new StandardAnalyzer(Lucene.Net.Util.Version.LUCENE_29));
            return i;

    You can then query in standard examine way. One issue i am having at the moment is that results all have score of 1 see



  • Mohammed BOUTEBEL 64 posts 103 karma points
    Sep 27, 2013 @ 10:35
    Mohammed BOUTEBEL

    Hi Nick.

    I would like to know how do you index your pdf files in Examine ? I tried the CogUmbracoMediaIndexer package, but it never worked properly.

Please Sign in or register to post replies

Write your reply to: