Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
47 lines (29 sloc) 1.75 KB

Indexes: Extending Indexes

{NOTE: }

  • An index is defined with a mapping function that utilizes a LINQ-like syntax.

  • Writing a complex LINQ expression can be a non-trivial task.
    You can extend your indexing processing capabilities by adding custom code to the index definition.
    This will enable calling the added custom functions or using external libraries logic (e.g. NodaTime) in your LINQ expression.

  • The indexing process will execute the LINQ code and the invoked additional source code.

  • Adding this custom code can be done from Studio or from code using the additional sources feature.
    See example below.

  • Advantages:

    • Readability: Index work logic is clearer and more readable
    • Code usage: Code fragments are re-used
    • Performance: Using the additional source feature can perform better then complex LINQ expressions
    • Extendability: External libraries can be included and used


{PANEL: Including additional sources from client code}

  • AdditionalSources is a property of the AbstractIndexCreationTask class.
  • It should be defined in your index class constructor which derives from AbstractIndexCreationTask.
  • Example:

{CODE additional_sources_1@Indexes\AdditionalSources.cs /}


{NOTE: Note: Deploying External DLLs}

  • External DLLs that are referenced must be manually deployed to the folder containing the Raven.Server executable.


Related articles


You can’t perform that action at this time.