本文整理汇总了C#中SolrQueryExecuter.GetFacetFieldOptions方法的典型用法代码示例。如果您正苦于以下问题:C# SolrQueryExecuter.GetFacetFieldOptions方法的具体用法?C# SolrQueryExecuter.GetFacetFieldOptions怎么用?C# SolrQueryExecuter.GetFacetFieldOptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SolrQueryExecuter
的用法示例。
在下文中一共展示了SolrQueryExecuter.GetFacetFieldOptions方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FacetFieldOptions
public void FacetFieldOptions()
{
var querySerializer = new SolrQuerySerializerStub("q");
var facetQuerySerializer = new DefaultFacetQuerySerializer(querySerializer, null);
var queryExecuter = new SolrQueryExecuter<TestDocument>(null, null, querySerializer, facetQuerySerializer, null);
var facetOptions = queryExecuter.GetFacetFieldOptions(
new FacetParameters {
Queries = new List<ISolrFacetQuery> {
new SolrFacetQuery(new SolrQuery("q")),
},
Prefix = "pref",
EnumCacheMinDf = 123,
Limit = 100,
MinCount = 5,
Missing = true,
Offset = 55,
Sort = true,
}).ToDictionary(x => x.Key, x => x.Value);
Assert.AreEqual("pref", facetOptions["facet.prefix"]);
Assert.AreEqual("123", facetOptions["facet.enum.cache.minDf"]);
Assert.AreEqual("100", facetOptions["facet.limit"]);
Assert.AreEqual("5", facetOptions["facet.mincount"]);
Assert.AreEqual("true", facetOptions["facet.missing"]);
Assert.AreEqual("55", facetOptions["facet.offset"]);
Assert.AreEqual("true", facetOptions["facet.sort"]);
}