Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Rob Williams 12 posts 31 karma points
    Sep 19, 2013 @ 21:57
    Rob Williams
    0

    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? 

  • Niclas Schumacher 67 posts 87 karma points
    Sep 26, 2013 @ 15:34
    Niclas Schumacher
    0

    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

  • James Woodruff 6 posts 27 karma points
    Nov 04, 2013 @ 14:56
    James Woodruff
    0

    Hi Niclas

     

    Could you post some examples please?  I'm just looking into implementing something along these lines

     

    Thanks

  • Niclas Schumacher 67 posts 87 karma points
    Nov 04, 2013 @ 16:29
    Niclas Schumacher
    0

    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 :)

     

  • James Woodruff 6 posts 27 karma points
    Nov 04, 2013 @ 21:23
    James Woodruff
    0

    Briliant, thanks Niclas, I'll give it a try....

Please Sign in or register to post replies

Write your reply to:

Draft