Hi, I've followed the docs and implemented PDFIndex and MultiSearcher.
In the backend these are both healthy and return results.
However, when I use them in code I get zero results from the PdfIndex either directly or via the MultiSearcher.
This is the code which creates the PdfIndex and MultiSearcher...
public void Initialize()
{
//Get both the external and pdf index
if (_examineManager.TryGetIndex(Constants.UmbracoIndexes.ExternalIndexName, out var externalIndex)
&& _examineManager.TryGetIndex(PdfIndexConstants.PdfIndexName, out var pdfIndex))
{
//register a multi searcher for both of them
var multiSearcher = new MultiIndexSearcher("MultiSearcher", new IIndex[] { externalIndex, pdfIndex });
_examineManager.AddSearcher(multiSearcher);
}
}
This is how I'm searching the PdfIndex directly...
var textFields = new[]
{
"title", "description", "content", "bodyText", "location", "pageHeading", "subHeading",
"nodeName", "__NodeTypeAlias"
};
if (ExamineManager.Instance.TryGetIndex("PDFIndex", out index))
{
searcher = index.GetSearcher(); ;
var query = searcher.CreateQuery("media").GroupedOr(textFields, searchQuery.Fuzzy(0.2f));
results = query.Execute();
}
...and this is a search against the MultiSearcher
if (_searchPdf && ExamineManager.Instance.TryGetSearcher("MultiSearcher", out searcher))
{
var query = searcher.CreateQuery("media,content").GroupedOr(textFields, searchQuery/*.Fuzzy(0.2f)*/);
results = query.Execute();
}
I suspect I'm phrasing the search incorrectly. I'll continue to "fiddle" and strip the code down to minimum.
I have multi searcher over 3 indexes including pdfindex working. I suspect its your query, try getting rid of "media,content" bit also in your textfields you do not have fileTextContent which is where it stores the extracted content:
Also can you do query.ToString() and report back the actual generated lucene query.
Examine MultiSearcher and PDFIndex not working
Hi, I've followed the docs and implemented PDFIndex and MultiSearcher.
In the backend these are both healthy and return results.
However, when I use them in code I get zero results from the PdfIndex either directly or via the MultiSearcher.
This is the code which creates the PdfIndex and MultiSearcher...
This is how I'm searching the PdfIndex directly...
...and this is a search against the MultiSearcher
I suspect I'm phrasing the search incorrectly. I'll continue to "fiddle" and strip the code down to minimum.
Suggestions appreciated.
Follow up on my experiments...
Based on the fields I see in results when testing the PdfIndex in backoffice, I've tried the following textFields variation...
still, sadly, with zero results.
Andy,
I have multi searcher over 3 indexes including pdfindex working. I suspect its your query, try getting rid of "media,content" bit also in your textfields you do not have fileTextContent which is where it stores the extracted content:
Also can you do query.ToString() and report back the actual generated lucene query.
Thanks for your help Ismail, it's really appreciated. I'll need a couple days to get back to you.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.