RavenDB full-text search

Boris Mitchenko picture Boris Mitchenko · Nov 30, 2010 · Viewed 7.3k times · Source

Can you please tell how to perform simple full-text search in RavenDb. The database is stored document: Movie {Name = "Pirates of the Carribean"}. I wish that this document was found on the search phrase "Pirates Carribean" or any other combination of words.

Answer

Ayende Rahien picture Ayende Rahien · Nov 27, 2011

Boris, Rob's answer has the right index, but it is a bit awkward for querying. You can do that using:

 session.Query<Movie, Movie_ByName>()
         .Search(x=>x.Name, searchTerms)
         .ToList()

That will