Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I install and setup the RavenDb index replication
    primarykey
    data
    text
    <p>rI've looked at the questions and indeed the RavenDb docs. There's a little at <a href="http://ravendb.net/bundles/index-replication" rel="noreferrer">RavenDb Index Replication Docs</a> but there doesn't seem any guidance on how/when/where to create the IndexReplicationDestination</p> <p>Our use case is very simple (it's a spike). We currently create new objects (Cows) and store them in Raven. We have a couple of queries created dynamically using LINQ (e.g. <code>from c in session.Query&lt;Cows&gt; select c</code>).</p> <p>Now I can't see where I should define the index to replicate. Any ideas? I've got hold of the bundle and added it to the server directory (I'm assuming it should be in <code>RavenDB.1.0.499\server\Plugins</code> where <code>RavenDB.1.0.499\server</code> contains Raven.Server.exe) </p> <p><strong>Edit</strong>: Thanks Ayende... the answer below and in the ravendb groups helped. There was a <em>facepalm</em> moment. Regardless here's some detail that may help someone else. It really is very easy and indeed 'just works':</p> <p>a) Ensure that the plugins are being picked up. You can view these in the statistics - available via the /localhost:8080/stats url (assuming default settings). You should see entries in 'Extensions' regarding to the IndexReplication bundle. </p> <p>If not present ensure the versions of the DLLs (bundle and server) are the same</p> <p>b) Ensure the index you want to replicate has been created. They can be created via Client API or HTTP API.</p> <p>Client API:</p> <pre><code>public class Cows_List : AbstractIndexCreationTask&lt;Cow&gt; { public Cows_List() { Map = cows =&gt; from c in cows select new { c.Status }; Index( x =&gt; x.Status, FieldIndexing.Analyzed); } } </code></pre> <p>HTTP API (in studio): //Cows/List docs.Cows .Select(q => new {Status = q.Status})</p> <p>c) create the replication document. The clue here is DOCUMENT. Like everything stored, it too is a document. So after creating it must be stored in the Db :</p> <p>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();</p> <p>d) Ensure you have the following in the CLIENT (e.g. MVC app or Console)</p> <p></p> <p>e) Create the RDBMS schema. I have a table in 'cowReports' :</p> <p>CREATE TABLE [dbo].[cowSummaries]( [Id] nvarchar NULL, [Status] nchar NULL) </p> <p>My particular problem was not adding the index document to the store. I know. <em>facepalm</em>. Of course <em>everything</em> is a document. Works like a charm!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload