Copied to clipboard

Flag this post as spam?

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


  • Richard Waite 11 posts 79 karma points
    Mar 04, 2020 @ 15:34
    Richard Waite
    0

    Rebuild index programmatically in Umbraco 8?

    Is there a way to rebuild an index programatically in umbraco 8? Can't find anything in the docs.

    There appears to be a way to re-index a specific node but I want to rebuild the entire index.

    any ideas?

  • Jan Bengtsson 64 posts 107 karma points
    May 11, 2020 @ 08:00
    Jan Bengtsson
    0

    I need to know this too. I've got some third party information that's regurarly imported to a few custom database tables. To make the new informaton searchable, the custom index must be rebuilt programmatically after each import. This was possible in Umbraco 7. Is it supported in Umbraco 8?

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    May 11, 2020 @ 08:29
    Ismail Mayat
    104

    Guys,

    you can inject in

            public TestController(ILogger logger,IndexRebuilder indexRebuilder)
    
    indexRebuilder.RebuildIndex("NameOfIndex");
    

    Regards

    Ismail

  • Marshall Penn 83 posts 268 karma points
    Aug 25, 2020 @ 10:43
    Marshall Penn
    0

    When i try to inject IndexRebuilder into an ApiController i get a server error - Does it need to be an UmbracoApiController ?

  • Chris Ashton 57 posts 89 karma points
    Nov 26, 2020 @ 23:09
    Chris Ashton
    0

    Perfect, just the answer I was looking for. Cheers Ismail.

  • Jan Bengtsson 64 posts 107 karma points
    May 11, 2020 @ 09:36
    Jan Bengtsson
    1

    Many thanks, Ismail! Btw, this is quite amazing. I've spent hours on this problem, but on the forum it only took a few seconds to get the right answer!

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    May 11, 2020 @ 10:06
    Ismail Mayat
    0

    To be honest took me a while to find it so your not alone

Please Sign in or register to post replies

Write your reply to:

Draft