O'Reilly logo

RavenDB High Performance by Brian Ritchie

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

Searching like Google

Performing a full text search is often the easiest way for users to find what they are looking for. However, a great user experience also requires showing highlighted text excerpts and providing spelling suggestions. Since RavenDB is built on Lucene.NET, these tasks become fairly simple. First, our index needs to be updated. It needs to store, index, and vector the text field of our book document:

public class BookIndex : AbstractIndexCreationTask<Book> { public BookIndex() { Map = books => from book in books select new { book.Category, book.Cost, book.Published, book.Title, book.Text }; Store(x => x.Text, FieldStorage.Yes); Index(x => x.Text, FieldIndexing.Analyzed); TermVector(x => x.Text, FieldTermVector.WithPositionsAndOffsets); ...

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