O'Reilly logo

RavenDB 2.x Beginner's Guide by Khaled Tannir

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – creating multifields searching index

You will create a new index class and register three fields to be indexed. This index will perform search over the Cities and Countries collections. To query this index you will use consecutive .Search() method and specify SearchOptions for each method.

  1. Start Visual Studio and open the RavenDB_CH05 solution.
  2. Add a new class to the project, name it Cities_MultiFieldsSearch and it inherits from AbstractIndexCreationTask class:
    Time for action – creating multifields searching index
  3. Add a default constructor, and then add the Map function within the class constructor using the following code snippet:
  4. Add Indexes field's registration to the class constructor ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required