0

请给我一些建议如何让我的 WSSQL 搜索查询正常工作。我正在尝试使用 LIKE 谓词在 Windows System.Search.Contents 属性中查找与正则表达式匹配的项目。

试验结果:

  1. 正则表达式定义应该与我的 win10 测试平台兼容,因为它通过对 Filename 属性的查询返回正确的结果。(见下面的 $query-1)

  2. Contents 属性中有匹配的单词 - 使用 Freetext 谓词进行验证。(见下面的 $query-2)

    $query-1 = "select system.itemname, system.itempathdisplay from systemindex where Filename like '%hello%'" #结果:OK,返回正确的行。

    $query-2 = "select system.itemname, system.itempathdisplay from systemindex where freetext(contents, 'hello')" #结果:OK,返回正确的行。

    $query-3 = "select system.itemname, system.itempathdisplay from systemindex where System.Search.Contents LIKE '%hello%'" #结果:失败,返回 0,没有错误

我正在测试的系统运行 Windows 10 专业版。

任何建议将不胜感激。谢谢你。

4

0 回答 0