Question

i am facing an error while using contains function of LINQ query

following error occured

Contains is not supported, doing a substring match over a text field is a very 
slow operation, and is not allowed using the Linq API.
The recommended method is to use full text search (mark the field as Analyzed and
use the Search() method to query it.

here is my query

query = from u in Session.Query<Article>() where u.Tags.Contains(tags) orderby u.CreationDate descending select 

StartWith/EndsWith works fine but it is not full filling my requirements

Was it helpful?

Solution

As the error states, Contains won't work and you need to use Analyzed fields. You can start here: http://ravendb.net/docs/client-api/querying/static-indexes/configuring-index-options

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top