开发者

Sharepoint 2010 FullTextSqlQuery using LIKE predicate does not find anything

I'm trying to execute a search in SharePoint 2010 with the FullTextSqlQuery开发者_如何学Go class:

using (SPSite site = new SPSite("http://localhost"))
{
  using (FullTextSqlQuery query = new FullTextSqlQuery(site))
  {
    query.QueryText = "SELECT Title, FooText FROM scope() WHERE FooText = 'Foo2'";
    query.ResultTypes = ResultType.RelevantResults;

    //result output here...
  }
}

The SQL statement used above returns some results. But with the following statement, replacing '=' with 'LIKE', no results are returned:

SELECT Title, FooText FROM scope() WHERE FooText LIKE 'Foo2'

Note: FooText is a Managed Property of type Text and single valued.


Setting the "Reduce storage requirements for text properties by using a hash for comparison" option in the settings of the managed property makes the LIKE predicate work.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜