Compartilhar via


SearchModelFactory.FacetResult Método

Definição

Inicializa uma nova instância 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

Parâmetros

count
Nullable<Int64>

A contagem aproximada de documentos que estão dentro do bucket descrito por essa faceta.

additionalProperties
IReadOnlyDictionary<String,Object>

Propriedades adicionais.

Retornos

Uma nova FacetResult instância para zombar.

Exemplos

Este exemplo mostra como simular FacetResult o tipo.

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);

Comentários

Para obter mais detalhes, consulte https://docs.microsoft.com/en-us/rest/api/searchservice/search-documents#query-parameters

Aplica-se a