Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

RavenDB specify Lucene vs Corax in C# code

I’m migrating from RavenDB 6.0.106 to 6.2.

I have a lot of complex indexes that are not compatible with Corax.
Using the UI, one can set which index type is used.

However, after perusing the RavenDB site, I have yet to find how to specify this in C# code alone. Is this even possible? If so, how is it done? Where’s the documentation?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You can specify which search engine to use in 3 ways/levels:

  1. Setting the search engine server-wide (for all databases):
    update your settings.json file as shown in this link:
    https://ravendb.net/docs/article-page/6.2/csharp/indexes/search-engine/corax#select-search-engine-server-wide
  2. Setting the search engine per database:
    done via the Studio as shown in this link:
    https://ravendb.net/docs/article-page/6.2/csharp/indexes/search-engine/corax#select-search-engine-per-database
  3. Setting the search engine per index:
    can be done via the client API code as shown in this link:
    https://ravendb.net/docs/article-page/6.2/csharp/indexes/search-engine/corax#select-index-search-engine-using-code

    Basically, set this in your index definition:
    SearchEngineType = Raven.Client.Documents.Indexes.SearchEngineType.Corax;
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading