Every index is required to have a name and a Map function. The Map function is the way for us to tell RavenDB how to find the data we are interested in, and what fields we are going to be searching on. The Map function is written in LINQ, just like you'd write a simple query
The Reduce function is optional, and is written and executed just like the Map function, but this time on the results of the Map function. This is actually a second indexing pass, which allows us to perform aggregation operations quite cheaply, directly from the index.
Sorting by default is performed lexographically.
FieldStorageNo (default) – Does not store the value of the field in the indexYes – Stores the value of field Compress – Compresses the value of the field (good for long text or binary fields)FieldInexing OptionsAnalyzed – Standard analysis good for full text search or text fields (breaks up text into terms and performs stemming analysis)Default – LowerCaseKeywordAnalyzer (stores the entire field as a single term for exact matching)No – Field is not indexed thus cannot be searched. But it can still be accessed assuming it was stored.NotAnalyzed – Indexes the field without performing analysis. This is good for unique ids like product numbers (UPC, ISBN, MPN)
Using the Live Projections feature, you have more control over what to load into the result entity, and since it returns a projection of the original entity, you also get the chance to filter out properties you do not need.
Alonso RoblesS Principal Consultant @ HeadspringS Blog: http://alonsorobles.comS Linked In: http://linkedin.com/in/alonsoroblesS Twitter: @alonsorobles
Central TexasGiveCampSeptember 28-30, 2012Interested in Participating? Developer – Make software. Have fun. Do good! Non-Profit – What can we build for you? Sponsor – Help make the even successful.More Info:http://ctxgivecamp.org
The QueryHow does RavenDB find what we are looking for? S
BASE QueriesS FastS Stale ResultsS Powered by Lucene
LuceneS Mature, De Facto Standard Information Retrieval LibraryS Scalable, High Performance IndexingS Powerful, Accurate and Efficient Search AlgorithmsS Originally Written in Java and Ported to Many LanguagesS Used by Apple, IBM, Linked In and many more…
Types of IndexesS Temporary Dynamic Index S Created on the fly to service a query when no existing index can be usedS Permanent Dynamic Index S Promoted when a temporary index is used a lotS Static Index S User defined
Static IndexesWhy? Aren’t the dynamic indexes enough? S
Reasons for Static IndexesS Index Creation is ExpensiveS Additional Functionality S Custom Sorting S Boosting S Full-Text Search S Live Projections S Spatial Search
More InfoS Official Raven Website: http://ravendb.netS Oren’s Blog: http://ayende.comS Google Group: http://groups.google.com/group/ravendb/S My Blog: http://alonsorobles.comS Local Training: http://headspring.com