Substring search in RavenDB

后端 未结 4 1828
广开言路
广开言路 2021-02-08 10:42

I have a set of objects of type Idea

public class Idea
{
    public string Title { get; set; }
    public string Body { get; set; }
}
4条回答
  •  别那么骄傲
    2021-02-08 11:25

    Incase anyone else comes across this. Raven 3 has a Search() extension method that allows for substring searching.

    A couple of gotchas:

    • Pay special attention to the "Query escaping" section at the bottom
    • I didn't see it mentioned anywhere, but it only worked for me if Search() was the added directly to Query() (i.e. without any Where(), OrderBy(), etc between them)

    Hope this saves someone some frustration.

提交回复
热议问题