Share via


SimilarityAlgorithm Class

Definition

Base type for similarity algorithms. Similarity algorithms are used to calculate scores that tie queries to documents. The higher the score, the more relevant the document is to that specific query. Those scores are used to rank the search results. Please note SimilarityAlgorithm is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. The available derived classes include BM25Similarity and ClassicSimilarity.

public class SimilarityAlgorithm
public class SimilarityAlgorithm : System.ClientModel.Primitives.IJsonModel<Azure.Search.Documents.Indexes.Models.SimilarityAlgorithm>, System.ClientModel.Primitives.IPersistableModel<Azure.Search.Documents.Indexes.Models.SimilarityAlgorithm>
type SimilarityAlgorithm = class
type SimilarityAlgorithm = class
    interface IJsonModel<SimilarityAlgorithm>
    interface IPersistableModel<SimilarityAlgorithm>
Public Class SimilarityAlgorithm
Public Class SimilarityAlgorithm
Implements IJsonModel(Of SimilarityAlgorithm), IPersistableModel(Of SimilarityAlgorithm)
Inheritance
SimilarityAlgorithm
Derived
Implements

Methods

JsonModelWriteCore(Utf8JsonWriter, ModelReaderWriterOptions)

Explicit Interface Implementations

IJsonModel<SimilarityAlgorithm>.Create(Utf8JsonReader, ModelReaderWriterOptions)

Reads one JSON value (including objects or arrays) from the provided reader and converts it to a model.

IJsonModel<SimilarityAlgorithm>.Write(Utf8JsonWriter, ModelReaderWriterOptions)

Writes the model to the provided Utf8JsonWriter.

IPersistableModel<SimilarityAlgorithm>.Create(BinaryData, ModelReaderWriterOptions)

Converts the provided BinaryData into a model.

IPersistableModel<SimilarityAlgorithm>.GetFormatFromOptions(ModelReaderWriterOptions)

Gets the data interchange format (JSON, Xml, etc) that the model uses when communicating with the service.

IPersistableModel<SimilarityAlgorithm>.Write(ModelReaderWriterOptions)

Writes the model into a BinaryData.

Applies to