Copied to clipboard

Flag this post as spam?

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


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • Torleif 11 posts 68 karma points
    Feb 19, 2015 @ 09:41
    Torleif
    0

    Programmatically start indexing RavenDB

    Hi,

    Is it possible to manually/programmatically start the indexing process of the RavenDB
    (Same process that start when you push the magic button in backoffice) ?

    I tried accessing UCommerce.Search.Indexers.ScratchIndexer without any luck. 

    Any help is appreciated! 

  • Morten Skjoldager 440 posts 1499 karma points
    Feb 19, 2015 @ 16:18
    Morten Skjoldager
    0

    yes, using the following line of code:

     

    ObjectFactory.Instance.Resolve<ScratchIndexer>().Index();

    This is the following we use to index on a background thread when pushing the button:

            protected void BeginIndexFromScratch_OnClick(object sender, EventArgs e)
            {
                new Thread(DoWork).Start();
                BeginIndexFromScratch.Enabled = false;
                IndexerStartedLabel.Visible = true;
                IndexerStartedLabel.Text = GetLocalResourceObject("IndexStarted.Text").ToString();
            }
    
            private void DoWork()
            {
                ObjectFactory.Instance.Resolve<ScratchIndexer>().Index();
            }

    Hope this helps in the right direction

    Best regards

    Morten

Please Sign in or register to post replies

Write your reply to:

Draft