VectorSearchOptions Class

  • java.lang.Object
    • com.microsoft.semantickernel.data.vectorstorage.options.VectorSearchOptions

public class VectorSearchOptions

Options for a vector search.

Field Summary

Modifier and Type Field and Description
static final int DEFAULT_TOP

The default limit of the number of results to return.

Constructor Summary

Constructor Description
VectorSearchOptions(VectorSearchFilter vectorSearchFilter, String vectorFieldName, int top, int skip, boolean includeVectors, boolean includeTotalCount)

Creates a new instance of the VectorSearchOptions class.

Method Summary

Modifier and Type Method and Description
static Builder builder()

Creates a new instance of the Builder class.

static VectorSearchOptions createDefault(String vectorFieldName)

Creates a new instance of the VectorSearchOptions class with default values.

int getSkip()

Gets the offset of the results to return.

int getTop()

Gets the limit of the number of results to return.

java.lang.String getVectorFieldName()

Gets the name of the vector field.

VectorSearchFilter getVectorSearchFilter()

Gets the vector search filter.

boolean isIncludeTotalCount()

Gets a value indicating whether to include the total count of the results.

boolean isIncludeVectors()

Gets a value indicating whether to include vectors in the results.

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Field Details

DEFAULT_TOP

public static final int DEFAULT_TOP

The default limit of the number of results to return.

Constructor Details

VectorSearchOptions

public VectorSearchOptions(VectorSearchFilter vectorSearchFilter, String vectorFieldName, int top, int skip, boolean includeVectors, boolean includeTotalCount)

Creates a new instance of the VectorSearchOptions class.

Parameters:

vectorSearchFilter - The vector search filter.
vectorFieldName - The name of the vector field.
top - The limit of the number of results to return.
skip - The offset of the results to return.
includeVectors - A value indicating whether to include vectors in the results.
includeTotalCount - A value indicating whether to include the total count of the results.

Method Details

builder

public static VectorSearchOptions.Builder builder()

Creates a new instance of the Builder class.

Returns:

A new instance of the Builder class.

createDefault

public static VectorSearchOptions createDefault(String vectorFieldName)

Creates a new instance of the VectorSearchOptions class with default values.

Parameters:

vectorFieldName - The name of the vector field.

Returns:

A new instance of the VectorSearchOptions class with default values.

getSkip

public int getSkip()

Gets the offset of the results to return.

Returns:

The offset of the results to return.

getTop

public int getTop()

Gets the limit of the number of results to return.

Returns:

The limit of the number of results to return.

getVectorFieldName

public String getVectorFieldName()

Gets the name of the vector field.

Returns:

The name of the vector field.

getVectorSearchFilter

public VectorSearchFilter getVectorSearchFilter()

Gets the vector search filter.

Returns:

The vector search filter.

isIncludeTotalCount

public boolean isIncludeTotalCount()

Gets a value indicating whether to include the total count of the results.

Returns:

A value indicating whether to include the total count of the results.

isIncludeVectors

public boolean isIncludeVectors()

Gets a value indicating whether to include vectors in the results.

Returns:

A value indicating whether to include vectors in the results.

Applies to