6

在 FAST 搜索查询中,我想获得适用于搜索词的所有细化。目前我只能得到 100 个结果。我想知道是否有一个设置来获得超过 100 个优化结果,我必须在我的查询中传递这些结果。

这是查询的 Refiners 部分:

<IncludeRefinementResults><Refiners><Refiner>*PROPERTY NAME*</Refiner></Refiners></IncludeRefinementResults>

我已经研究过深度优化器与浅层优化器(https://technet.microsoft.com/en-us/library/gg193929(v=office.14).aspx),它处理基于所有结果的改进与仅基于改进的改进前 100 个结果,并且不处理正在返回的细化结果的实际数量。

如果有人可以向我指出 Microsoft 文档说明 100 是硬限制或指导我找到我缺少的过滤器,那就太好了。

4

2 回答 2

3

发现这个论坛帖子,它建议更改精炼参数“过滤器”应该允许超过 100 个结果。

添加托管属性(通过 Sharepoint UI),并将其标记为“Refiner 属性”并标记为“Deep Refiner”。

使用细化器参数“filter”,您可以使用此参数获得 100 多个细化器。

您需要将此参数与您的细化器属性一起设置,例如

作者(过滤器=500)

于 2016-08-10T19:13:04.460 回答
1

经过大量搜索,我找到了一篇带有答案的博客文章。简而言之,值是硬编码的,在类的GetRefinableManagedPropertyInfos方法中Microsoft.Office.Server.Search.RefinementUtilities.ManagedPropertyInfoProvider。以下是一个长代码片段,但请注意将GetValuesForRefinableProperties100硬编码到maxItems变量中的方法调用。我使用反射器生成以下内容:

public IEnumerable<RefinableManagedPropertyInfo> GetRefinableManagedPropertyInfos(SiteCollectionReference siteCollectionReference, double percentageThreshold = 0.8, TermReference? termReference = new TermReference?())
{
    using (new SPMonitoredScope("ManagedPropertyInfoProvider::GetRefinableManagedPropertyInfos"))
    {
        long num;
        IEnumerable<Refinement> enumerable3;
        IEnumerable<RefinerData> enumerable6;
        IEnumerable<ManagedPropertyInfo> refinablePropertiesInSchema = this.GetAllRefinableProperties(siteCollectionReference).ToList<ManagedPropertyInfo>();
        if (!termReference.HasValue)
        {
            ULS.SendTraceTag(0x153103, ULSCat.msoulscat_SEARCH_Admin, ULSTraceLevel.High, "ManagedPropertyInfoProvider::GetRefinableManagedPropertyInfos: Schema info only requested. Returning.", new object[] { "ManagedProperties" });
            return CreateRefinableManagedPropertyInfoList(refinablePropertiesInSchema);
        }
        IEnumerable<string> source = (from r in refinablePropertiesInSchema select r.Name).ToList<string>();
        if (!source.Contains<string>("ManagedProperties", StringComparer.OrdinalIgnoreCase))
        {
            ULS.SendTraceTag(0x153104, ULSCat.msoulscat_SEARCH_Admin, ULSTraceLevel.High, "ManagedPropertyInfoProvider::GetRefinableManagedPropertyInfos: Can not find managed property {0} in schema. Returning only refinable properties from schema.", new object[] { "ManagedProperties" });
            return CreateRefinableManagedPropertyInfoList(refinablePropertiesInSchema);
        }
        try
        {
            enumerable3 = this.GetValuesForRefinableProperty(siteCollectionReference, "ManagedProperties", termReference.Value, 0x7fffffff, out num).ToList<Refinement>();
        }
        catch (QueryFailedException exception)
        {
            exception.RefinablePropertiesFromSchema = CreateRefinableManagedPropertyInfoList(refinablePropertiesInSchema);
            throw;
        }
        if (num == 0L)
        {
            ULS.SendTraceTag(0x153105, ULSCat.msoulscat_SEARCH_Admin, ULSTraceLevel.High, "ManagedPropertyInfoProvider::GetRefinableManagedPropertyInfos: Query returned 0 results. Returning only refinable properties from schema.");
            return CreateRefinableManagedPropertyInfoList(refinablePropertiesInSchema);
        }
        ULS.SendTraceTag(0x153106, ULSCat.msoulscat_SEARCH_Admin, ULSTraceLevel.Verbose, "ManagedPropertyInfoProvider::GetRefinableManagedPropertyInfos: Found {0} refinable properties with index values.", new object[] { enumerable3.Count<Refinement>() });
        long threshold = (long) Math.Round((double) (num * percentageThreshold));
        IEnumerable<string> enumerable4 = (from r in enumerable3
            where r.RefinementCount >= threshold
            select r.RefinementName).ToList<string>();
        ULS.SendTraceTag(0x153107, ULSCat.msoulscat_SEARCH_Admin, ULSTraceLevel.Verbose, "ManagedPropertyInfoProvider::GetRefinableManagedPropertyInfos: Found {0} managed properties with values above threshold {1}", new object[] { enumerable4.Count<string>(), threshold });
        IEnumerable<string> enumerable5 = source.Intersect<string>(enumerable4, StringComparer.OrdinalIgnoreCase).ToList<string>();
        ULS.SendTraceTag(0x153108, ULSCat.msoulscat_SEARCH_Admin, ULSTraceLevel.Verbose, "ManagedPropertyInfoProvider::GetRefinableManagedPropertyInfos: Want to find entropy for {0} managed properties.", new object[] { enumerable5.Count<string>() });
        try
        {
            enumerable6 = this.GetValuesForRefinableProperties(siteCollectionReference, enumerable5, termReference.Value, 100, out num).ToList<RefinerData>();
        }
        catch (QueryFailedException exception2)
        {
            exception2.RefinablePropertiesFromSchema = CreateRefinableManagedPropertyInfoList(refinablePropertiesInSchema);
            throw;
        }
        ULS.SendTraceTag(0x153109, ULSCat.msoulscat_SEARCH_Admin, ULSTraceLevel.Verbose, "ManagedPropertyInfoProvider::GetRefinableManagedPropertyInfos: Total hits in entropy query = {0} Number of refiners returned = {1}", new object[] { num, enumerable6.Count<RefinerData>() });
        return CreateRefinableManagedPropertyInfoList((from r in enumerable6
            where r.Entropy > 0M
            select r).ToDictionary<RefinerData, string, RefinerData>(suggestedRefiner => suggestedRefiner.RefinerName, r => r, StringComparer.OrdinalIgnoreCase), num, enumerable3, refinablePropertiesInSchema);
    }
}

我没有通过反编译、更改值和重新编译来验证这一点,但除非 Microsoft 提供补丁,否则 100 似乎是一个硬限制。上面的反编译代码在 SharePoint 2013 中是最新的。

于 2016-08-08T13:48:33.807 回答