We will create a new static index and add it to the World
database (created in Chapter 2, RavenDB Management Studio). You will create this index using the PutIndex()
method. Then you will analyze the RavenDB logs and open the index in Management Studio to view it and execute it.
Open the
RavenDB_Ch04
solution in Visual Studio.Add the following code to the
Main()
method to create the static index:Add the following code to the
Main()
method to query theCities/CountryCode
index:Save all the files, build and run
RavenDB_Ch04
.Select the RavenDB prompt window in Windows Explorer and analyze the RavenDB logs to understand how RavenDB created the index.
In Management Studio, select the
World
database, click on the Indexes tab and open theCities/CountryCode
index in edit mode and look at theMap function
code.In Management Studio, execute the
Cities/CountryCode
index and observe the result.