Hey Rob. Hopefully you have found a way to solve this, otherwise i have had the same issue. On a site i had to import a article from a api, i only stored the id which should be retrieved when the specefic page was loaded. The content from the api should also be searchable. The thing i did: i hooked up on the inderEvent via GatheringNodeDataHandler, in here i could add a new field to the index with the information i retrieved from the api.
I can give some code examples if the above dosn't make proper sense :)
i created a clas called WebsiteSearchIndexerEvents, (WebsiteSearch is my the name of my indexer) extending ApplicationStartupHandler. Created a GatheringNodeDataHandler method, which i hooked to my indexer
var indexer = ExamineManager.Instance.IndexProviderCollection["WebsiteIndexer"];
Adding external content to Examine index
We have a site deployed in 4.9. We're using pretty much a stock setup on our site search for examine.
The client has requested that we add content from some external links (press releases hosted elsewhere) to the search index.
Is this possible?
Hey Rob.
Hopefully you have found a way to solve this, otherwise i have had the same issue.
On a site i had to import a article from a api, i only stored the id which should be retrieved when the specefic page was loaded. The content from the api should also be searchable.
The thing i did: i hooked up on the inderEvent via GatheringNodeDataHandler, in here i could add a new field to the index with the information i retrieved from the api.
I can give some code examples if the above dosn't make proper sense :)
- Niclas Schumacher
Hi Niclas
Could you post some examples please? I'm just looking into implementing something along these lines
Thanks
Hey James.
Sure.
i created a clas called WebsiteSearchIndexerEvents, (WebsiteSearch is my the name of my indexer) extending ApplicationStartupHandler. Created a GatheringNodeDataHandler method, which i hooked to my indexer
var indexer = ExamineManager.Instance.IndexProviderCollection["WebsiteIndexer"];
indexer.GatheringNodeData += GatheringNodeDataHandler;
then you just gather the information you need to put into the index , and do e.Fields.Add("Field", content);
If this explenation dosn't cut it, ill be glad to put the code up :)
But the rest of my code is problem specefic. So as long you do the 2-3 things ive told, you should be set :)
Briliant, thanks Niclas, I'll give it a try....
is working on a reply...