Partager via


SearchModelFactory.FacetResult Méthode

Définition

Initialise une nouvelle instance de 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

Paramètres

count
Nullable<Int64>

Nombre approximatif de documents relevant du compartiment décrit par cette facette.

additionalProperties
IReadOnlyDictionary<String,Object>

Propriétés supplémentaires.

Retours

Une nouvelle FacetResult instance pour se moquer.

Exemples

Cet exemple montre comment simuler FacetResult le 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);

Remarques

Pour plus d’informations, consultez https://docs.microsoft.com/en-us/rest/api/searchservice/search-documents#query-parameters

S’applique à