How to install and configure RavenDb index replication

rI looked at questions and really RavenDb docs. There's a bit of RavenDb Index Replication Docs , but there is no guidance on how / when / where to create IndexReplicationDestination

Our use case is very simple (this is a spike). We are currently creating new objects (Cows) and storing them in Raven. We have several queries created dynamically using LINQ (for example, from c in session.Query<Cows> select c).

Now I do not see where I should determine the index for replication. Any ideas? I received the package and added it to the server directory (I assume that it should be in RavenDB.1.0.499\server\Pluginswhere RavenDB.1.0.499\serverRaven.Server.exe contains)

Edit : Thanks Ayende ... the answers below and in ravendb groups helped. There was a moment of facepalm. Regardless, here are some details that may help someone else. It is really very simple and really “just works”:

a) Make sure plugins are connected. You can view them in the statistics, accessible via the URL / localhost: 8080 / stats (subject to the default settings). You should see entries in the "Extensions" regarding the IndexReplication package.

If not, make sure the versions of the DLL (package and server) are the same.

b) Make sure that the index you want to reproduce has been created. They can be created through the client API or the HTTP API.

Client API:

public class Cows_List : AbstractIndexCreationTask<Cow>
{
    public Cows_List()
    {
        Map = cows => from c in cows select new { c.Status };
        Index( x => x.Status, FieldIndexing.Analyzed);
    }
}

HTTP API (in the studio): // Cows / List of docs.Cows. Select (q => new {Status = q.Status})

c) . - . , . Db:

var replicationDocument = new Raven.Bundles.IndexReplication.Data.IndexReplicationDestination {   Id = "Raven/IndexReplication/Cows_List", ColumnsMapping = {{ "Status", "Status" }},   ConnectionStringName = "Reports", PrimaryKeyColumnName = "Id",   TableName = "cowSummaries" }; session.Store(replicationDocument); sesson.SaveChanges();

d) , (, MVC ) :

e) . 'cowReports':

CREATE TABLE [dbo]. [cowSummaries] (     [Id] nvarchar NULL,     [Status] nchar NULL)

. . Facepalm. , . !

+5
1

. a) , . b) , RavenDB, ,

+1

All Articles