Megosztás a következőn keresztül:


SearchModelFactory.FacetResult Method

Definition

Initializes a new instance of FacetResult.

public static Azure.Search.Documents.Models.FacetResult FacetResult (long? count = default, System.Collections.Generic.IReadOnlyDictionary<string,object> additionalProperties = default);
static member FacetResult : Nullable<int64> * System.Collections.Generic.IReadOnlyDictionary<string, obj> -> Azure.Search.Documents.Models.FacetResult
Public Shared Function FacetResult (Optional count As Nullable(Of Long) = Nothing, Optional additionalProperties As IReadOnlyDictionary(Of String, Object) = Nothing) As FacetResult

Parameters

count
Nullable<Int64>

The approximate count of documents falling within the bucket described by this facet.

additionalProperties
IReadOnlyDictionary<String,Object>

Additional Properties.

Returns

A new FacetResult instance for mocking.

Examples

This sample shows how to mock FacetResult type.

var count = 2;
var additionalProperties = new Dictionary<string, object>()
{
     ["value"] = "Luxury"
}
var facetResult = SearchModelFactory.FacetResult(count, additionalProperties);
Assert.AreEqual(count, facetResult.Count);

var additionalProperty = additionalProperties.First();
Assert.AreEqual(additionalProperty.Value, facetResult.TryGetValue(additionalProperty.Key, out object value) ? value : null);

Remarks

For more details please refer https://docs.microsoft.com/en-us/rest/api/searchservice/search-documents#query-parameters

Applies to