I would like your help on extracting the IndexSetName from a Searcher. You can see the IndexSetName is available under each searcher. You can see this in ProviderProperties.
The reason I'm doing this I'm developing a plugin/package where you choose a Searcher e.g ExternalSearcher, InternalSearcher or any other.
I have to get the IndexSetName to create an event handler for GatheringNode.
ExamineManager.Instance.IndexProviderCollection["ExternalIndexer"].GatheringNodeData += MediaSearchController_GatheringNodeData;
var Searcher = ExamineManager.Instance.SearchProviderCollection["ExternalSearcher"];
I'm trying to avoid hardcoding the name of the Searcher (ExternalSearcher) and IndexSetName (ExternalIndexSet).
So I would select ExternalSearcher from a dropdown and it passes this name "ExternalSearcher" as a variable SearcherTypeName into the SearchProviderCollection.
var Searcher = ExamineManager.Instance.SearchProviderCollection[SearcherTypeName];
I need to do the same for ExamineManager.Instance.IndexProviderCollection["ExternalIndexer"]
How I get the IndexSetName from my choice of Searcher i.e. "ExternalIndexer"?
Is there a better of getting the IndexSetName?
Would ExternalSearcher and ExternalIndexer always be available in all of Umbraco 7 installations?
Can you please help?
Update:
This is what I can see from the Searcher properties. It's a bit limited
I have done with indexers and you have to cast it to LuceneIndex then you can get to the properties, I suspect you have to do something similar for searcher? Take a look at examine code and see what base class searcher implements.
That fixed the issue. You've pointed me in the right direction. I needed LuceneSearcher.
var searchIndexer = (Examine.LuceneEngine.Providers.LuceneSearcher)ExamineManager.Instance.SearchProviderCollection[2];
var indexSetName = searchIndexer.IndexSetName;
With this code, I was able to get the IndexSetName.
Examine - Getting IndexSetName from Searcher
HI folks,
I would like your help on extracting the IndexSetName from a Searcher. You can see the IndexSetName is available under each searcher. You can see this in ProviderProperties.
The reason I'm doing this I'm developing a plugin/package where you choose a Searcher e.g ExternalSearcher, InternalSearcher or any other.
I have to get the IndexSetName to create an event handler for GatheringNode.
I'm trying to avoid hardcoding the name of the Searcher (ExternalSearcher) and IndexSetName (ExternalIndexSet).
So I would select ExternalSearcher from a dropdown and it passes this name "ExternalSearcher" as a variable SearcherTypeName into the SearchProviderCollection.
I need to do the same for ExamineManager.Instance.IndexProviderCollection["ExternalIndexer"]
How I get the IndexSetName from my choice of Searcher i.e. "ExternalIndexer"?
Is there a better of getting the IndexSetName? Would ExternalSearcher and ExternalIndexer always be available in all of Umbraco 7 installations?
Can you please help?
Update: This is what I can see from the Searcher properties. It's a bit limited
John,
I have done with indexers and you have to cast it to LuceneIndex then you can get to the properties, I suspect you have to do something similar for searcher? Take a look at examine code and see what base class searcher implements.
Regards
Ismail
Hi Ismail,
That fixed the issue. You've pointed me in the right direction. I needed LuceneSearcher.
With this code, I was able to get the IndexSetName.
Thanks for your help, Ismail! :)
is working on a reply...