---
title: "Creates a search algorithm"
method: POST
path: "/search-algorithm"
tags: ["Search algorithm"]
---

# Creates a search algorithm

`POST /search-algorithm`

## Request

- The document declares no server URL.
- Auth: API key in header `TWN-InstanceKey` and API key in header `TWN-Authentication`

## Request body

- union: Base model for creating a search algorithm
  - object
    - `discriminator` 'ApiSearchAlgorithmCreateExactMatch', required
    - `AttributeId` integer, nullable: Optional linked attribute id
    - `NumberRecognitionRemoveString` string, nullable: String removed during number recognition
    - `Sequence` integer, nullable: Execution order of the algorithm
    - `Weight` number, double, nullable: Weight of the algorithm
    - `StopWhenResultsFound` boolean: Stops when results were found
    - `Enabled` boolean: Indicates whether the search algorithm is enabled
  - object
    - `discriminator` 'ApiSearchAlgorithmCreateWord', required
    - `UseFullTextRank` boolean, nullable: Enables full text rank usage
    - `EnableConjugations` boolean, nullable: Enables conjugations
    - `MatchStart` boolean, nullable: Matches on start of terms
    - `NumberRecognitionRemoveString` string, nullable: String removed during number recognition
    - `SearchAlgorithmAttributes` ApiSearchAlgorithmCreateAttribute[]: Attributes linked to this algorithm
      - `AttributeId` integer: Linked attribute id
      - `HasPriority` boolean: Indicates priority
      - `UseAutocorrect` boolean: Enables autocorrect for the attribute
    - `Sequence` integer, nullable: Execution order of the algorithm
    - `Weight` number, double, nullable: Weight of the algorithm
    - `StopWhenResultsFound` boolean: Stops when results were found
    - `Enabled` boolean: Indicates whether the search algorithm is enabled
  - object
    - `discriminator` 'ApiSearchAlgorithmCreateDamereau', required
    - `SearchAlgorithmAttributes` ApiSearchAlgorithmCreateAttribute[]: Attributes linked to this algorithm
      - `AttributeId` integer: Linked attribute id
      - `HasPriority` boolean: Indicates priority
      - `UseAutocorrect` boolean: Enables autocorrect for the attribute
    - `Sequence` integer, nullable: Execution order of the algorithm
    - `Weight` number, double, nullable: Weight of the algorithm
    - `StopWhenResultsFound` boolean: Stops when results were found
    - `Enabled` boolean: Indicates whether the search algorithm is enabled
  - object
    - `discriminator` 'ApiSearchAlgorithmCreateCategoryMatch', required
    - `UseSortTemplate` boolean, nullable: Use sort template for this algorithm
    - `UseConjugationsOnCategory` boolean, nullable: Use conjugations on category
    - `UseSynonymsOnCategory` boolean, nullable: Use synonyms on category
    - `SearchAlgorithmExcludedCategories` ApiSearchAlgorithmCreateExcludedCategory[]: Excluded categories linked to this algorithm
      - `CategoryId` integer: Category id
    - `Sequence` integer, nullable: Execution order of the algorithm
    - `Weight` number, double, nullable: Weight of the algorithm
    - `StopWhenResultsFound` boolean: Stops when results were found
    - `Enabled` boolean: Indicates whether the search algorithm is enabled
  - object
    - `discriminator` 'ApiSearchAlgorithmCreateFuzzyV2', required
    - `SearchAlgorithmAttributes` ApiSearchAlgorithmCreateAttribute[]: Attributes linked to this algorithm
      - `AttributeId` integer: Linked attribute id
      - `HasPriority` boolean: Indicates priority
      - `UseAutocorrect` boolean: Enables autocorrect for the attribute
    - `Sequence` integer, nullable: Execution order of the algorithm
    - `Weight` number, double, nullable: Weight of the algorithm
    - `StopWhenResultsFound` boolean: Stops when results were found
    - `Enabled` boolean: Indicates whether the search algorithm is enabled
  - object
    - `discriminator` 'ApiSearchAlgorithmCreateMerchandisingRule', required
    - `Sequence` integer, nullable: Execution order of the algorithm
    - `Weight` number, double, nullable: Weight of the algorithm
    - `StopWhenResultsFound` boolean: Stops when results were found
    - `Enabled` boolean: Indicates whether the search algorithm is enabled
  - object
    - `discriminator` 'ApiSearchAlgorithmCreatePhonetic', required
    - `Sequence` integer, nullable: Execution order of the algorithm
    - `Weight` number, double, nullable: Weight of the algorithm
    - `StopWhenResultsFound` boolean: Stops when results were found
    - `Enabled` boolean: Indicates whether the search algorithm is enabled
  - object
    - `discriminator` 'ApiSearchAlgorithmCreateNumberRecognition', required
    - `AttributeId` integer, nullable: Optional linked attribute id
    - `Sequence` integer, nullable: Execution order of the algorithm
    - `Weight` number, double, nullable: Weight of the algorithm
    - `StopWhenResultsFound` boolean: Stops when results were found
    - `Enabled` boolean: Indicates whether the search algorithm is enabled
  - object
    - `discriminator` 'ApiSearchAlgorithmCreateVectorSearch', required
    - `AttributeId` integer, nullable: Optional linked attribute id
    - `MinimumItemScore` number, double, nullable: Minimum score for resulting items
    - `Sequence` integer, nullable: Execution order of the algorithm
    - `Weight` number, double, nullable: Weight of the algorithm
    - `StopWhenResultsFound` boolean: Stops when results were found
    - `Enabled` boolean: Indicates whether the search algorithm is enabled
  - object
    - `discriminator` 'ApiSearchAlgorithmCreateExactStart', required
    - `AttributeId` integer, nullable: Optional linked attribute id
    - `NumberRecognitionRemoveString` string, nullable: String removed during number recognition
    - `Sequence` integer, nullable: Execution order of the algorithm
    - `Weight` number, double, nullable: Weight of the algorithm
    - `StopWhenResultsFound` boolean: Stops when results were found
    - `Enabled` boolean: Indicates whether the search algorithm is enabled
  - object
    - `discriminator` 'ApiSearchAlgorithmCreatePlugAndPlayVectorSearch', required
    - `MinimumItemScore` number, double, nullable: Minimum score for resulting items
    - `Sequence` integer, nullable: Execution order of the algorithm
    - `Weight` number, double, nullable: Weight of the algorithm
    - `StopWhenResultsFound` boolean: Stops when results were found
    - `Enabled` boolean: Indicates whether the search algorithm is enabled

## Response `200`

OK

- integer

## Other responses

- `400`: Bad Request

---

[API](https://skmtc.dev/tweakwise/apis/app-api.md) - [All operations](https://skmtc.dev/tweakwise/apis/app-api/llms.txt) - [OpenAPI document](https://skmtc.dev/tweakwise/apis/app-api/revisions/dc936bf76941?raw)
