当我使用 Search.asmx 网络服务时,它不允许我搜索元数据。我有办法做到这一点吗?
以下是我到目前为止为我的查询提出的结果,但每次运行它时都会出错并显示 InvalidPropertyException
。
<?xml version="1.0" encoding="utf-8" ?>
<QueryPacket xmlns="urn:Microsoft.Search.Query" Revision="1000">
<Query domain="QDomain">
<SupportedFormats><Format>urn:Microsoft.Search.Response.Document.Document</Format></SupportedFormats>
<Context>
<QueryText language="en-US" type="MSSQLFT">
<![CDATA[ SELECT Title, Rank, Size, Description, Write, Path FROM portal..scope() WHERE "Published" = 'Yes' ORDER BY "Rank" DESC ]]>
</QueryText>
</Context>
<Range><StartAt>1</StartAt><Count>20</Count></Range>
<EnableStemming>false</EnableStemming>
<TrimDuplicates>true</TrimDuplicates>
<IgnoreAllNoiseQuery>true</IgnoreAllNoiseQuery>
<ImplicitAndBehavior>true</ImplicitAndBehavior>
<IncludeRelevanceResults>true</IncludeRelevanceResults>
<IncludeSpecialTermResults>true</IncludeSpecialTermResults>
<IncludeHighConfidenceResults>true</IncludeHighConfidenceResults>
</Query></QueryPacket>
最佳答案
您不能只搜索任意一列元数据,您需要确保它首先被抓取并以合理的名称(托管属性)提供。参见 this blog post举个例子。
另外,如果 Published 是一个 bool 值,我认为您可能想要测试 "Published"= 1,而不是 yes。
关于web-services - 是否可以搜索 SharePoint 元数据?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4328554/