> For the complete documentation index, see [llms.txt](https://utca.knowledgator.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://utca.knowledgator.com/executable-schemas/semanticsearchschema.md).

# SemanticSearchSchema

Schema for semantic search

Subclass of [**Executable**](/core/executable.md). Type of [**Executable**](/core/executable.md)**\[**[**SemanticSearchSchemaInput**](#semanticsearchschemainput)**,** [**SemanticSearchSchemaOutput**](#semanticsearchschemaoutput)**]**

## Module: [implementation](/framework-structure.md#implementation).schemas

## Methods and properties

Main methods and properties

***

### <mark style="color:blue;">\_\_init\_\_</mark>

#### Arguments:

* <mark style="color:orange;">**dataset**</mark>**&#x20;(Optional\[List\[str]], optional):** Dataset for search. Defaults to None.
* <mark style="color:orange;">**encoder**</mark>**&#x20;(Optional\[**[**TransformersTextEmbedding**](/tasks/transformerstextembedding.md)**\[Any, Any]], optional):** Encoder for embeddings creation. If equals to None, default encoder will be used. Defaults to None.
* <mark style="color:orange;">**input\_class**</mark>**&#x20;(Type\[**[**SemanticSearchSchemaInput**](#semanticsearchschemainput)**], optional):** Class for input validation. Defaults to [**SemanticSearchSchemaInput**](#semanticsearchschemainput).
* <mark style="color:orange;">**output\_class**</mark>**&#x20;(Type\[**[**SemanticSearchSchemaOutput**](#semanticsearchschemaoutput)**], optional):** Class for output validation. Defaults to [**SemanticSearchSchemaOutput**](#semanticsearchschemaoutput).
* <mark style="color:orange;">**name**</mark>**&#x20;(Optional\[str], optional):** Name for identification. If equals to None, class name will be used. Defaults to None.

***

***

***

## <mark style="color:green;">**SemanticSearchSchemaInput**</mark>

Subclass of [**IOModel**](/core/schemas.md#iomodel)**.**

***

### <mark style="color:blue;">\_\_init\_\_</mark>

#### Arguments:

* <mark style="color:orange;">**query**</mark>**&#x20;(List\[str])**
* <mark style="color:orange;">**results\_count**</mark>**&#x20;(int)**

***

***

***

## <mark style="color:green;">**SemanticSearchSchemaOutput**</mark>

Subclass of [**IOModel**](/core/schemas.md#iomodel)**.**

***

### <mark style="color:blue;">\_\_init\_\_</mark>

#### Arguments:

* <mark style="color:orange;">**search\_results**</mark>**&#x20;(Dict\[str, Any]):** Expected keys:
  * <mark style="color:red;">**"distances"**</mark>**&#x20;(List\[float]):** List of distances;
  * <mark style="color:red;">**"indexes"**</mark>**&#x20;(List\[Any]):** Indexes of indexed data;
  * <mark style="color:red;">**"texts"**</mark>**&#x20;(List\[str]):** Texts of results;

***

***
