Wait for indexing to complete

May 5, 2015 at 2:41 PM
How do I update indexes and wait for them to complete? I've noticed I need to run the sample twice, the first time the index is changed it is not available because it is rebuilding (?).
    rdb = RaptorDB.RaptorDB.Open("data"); // a "data" folder beside the executable
    RaptorDB.Global.RequirePrimaryView = false;

    Console.WriteLine("Registering views..");
    rdb.RegisterView(new SalesInvoiceView());

    rdb.WaitForViewsToUpdate(); // something like this?
It would be great if you could document more. For example, what are the indexing options in View base class? Which parts are asynchronous and which parts are not? I'm used to RavenDB so it would be nice to have some information for people with this background. Is there a Reduce option to views?

All in all, great library! I've been looking for something like this to use in my web sites that are running in shared environments. I'm hoping for something that is more light-weight than RavenDB Embedded.
Coordinator
May 19, 2015 at 7:58 AM
Sorry for the delay, codeplex isn't notifying me of new messages.

Yes, currently in the rudimentary console sample you have to wait for the rebuild to happen and you have to run twice since console apps are sequential , in production a wait would not be necessary since your users can retry etc. and things happen very fast.

Indexing is generally background unless view.BackgroundIndexing=false or the view is a "primary view", see the codeproject article for this.

Reduce is handled via LINQ aggregate queries of "Server Side" queries on views.