if (_examineManager.TryGetIndex(Constants.UmbracoIndexes.ExternalIndexName, out var externalIndex) && _examineManager.TryGetIndex(Constants.UmbracoIndexes.InternalIndexName, out var internalIndex) && _examineManager.TryGetIndex(PdfIndexConstants.PdfIndexName, out var pdfIndex) && _examineManager.TryGetIndex("IntranetUserIndex", out var intranetMemberIndex))
{
var multiSearcher = new MultiIndexSearcher("PDFMultiSearcher", new IIndex[] { externalIndex, pdfIndex, intranetMemberIndex });
_examineManager.AddSearcher(multiSearcher);
if (!(internalIndex is LuceneIndex Iindex))
throw new InvalidOperationException("Could not cast");
Iindex.TransformingIndexValues += InternalIndexProviderTransformingIndexValues;
}
In Umbraco 9 _examineManager don't contain AddSearcher ?
some things have changed in U9. It seems the ExamineManager Interface no longer provides methods for adding searchers and indexes.
Instead you can register them, as well as a multisearcher, as a service in your service collection. If you do that in your startup class you can do something like:
Multisearcher Umbraco 9
In Umbraco 8 I could add searcher like this:
In Umbraco 9 _examineManager don't contain AddSearcher ?
Anyone that can help ?
Hi Thomas,
some things have changed in U9. It seems the ExamineManager Interface no longer provides methods for adding searchers and indexes.
Instead you can register them, as well as a multisearcher, as a service in your service collection. If you do that in your startup class you can do something like:
You just need to specifiy the names of your indexes that should be part of the multisearcher.
It also seems that the nuget package UmbracoCms.UmbracoExamine.PDF is not yet ready for U9 and .NET 6, so I used this one Umbraco.ExaminePDF
So all you need to do is install the nuget package, register your multisearcher in your code and it will appear in Umbracos Examine Management Tab.
Hope that helps.
Thanks Alex ! :) Worked
is working on a reply...