Search both content and PDF's in a single examine query?
Hi,
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.
/// <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", ""));
directories.Add(dir);
}
var i = new MultiIndexSearcher(directories, new StandardAnalyzer(Lucene.Net.Util.Version.LUCENE_29));
return i;
}
Search both content and PDF's in a single examine query?
Hi,
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.
thanks.
Nick,
You can do it with examine multi searcher see http://our.umbraco.org/forum/core/general/20321-Implementing-Multi-Index-Search-in-470 the configuration in the first post shows you how you create the searcher using config file although you can also do it programatically
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 http://our.umbraco.org/forum/developers/api-questions/44289-Examine-Multisearcher
Regards
Ismail
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.
is working on a reply...