# SEMANTICSEARCH

The **SEMANTICSEARCH** workflow application performs a hybrid full-text and semantic search on requests, with customizable filters and scoring. It returns structured JSON results for use in process logic.

## Required parameters

<table><thead><tr><th width="264.63531494140625" valign="top">Parameter</th><th width="113.991455078125" valign="top">Type</th><th width="114.91168212890625" valign="top">Direction</th><th valign="top">Description</th></tr></thead><tbody><tr><td valign="top"><code>QUERY</code></td><td valign="top">TEXT</td><td valign="top">IN</td><td valign="top">The main search query (full-text and similarity)</td></tr><tr><td valign="top"><code>QUERY_DATA_&#x3C;NAME></code></td><td valign="top">TEXT</td><td valign="top">IN</td><td valign="top">Query for a specific data field (e.g. <code>QUERY_DATA_TITLE</code>)</td></tr><tr><td valign="top"><code>RESULT</code></td><td valign="top">TEXT</td><td valign="top">OUT</td><td valign="top">JSON string containing the search results</td></tr></tbody></table>

{% hint style="info" %}
At least one of `QUERY` or `QUERY_DATA_<NAME>` must be provided.
{% endhint %}

## Optional parameters

<table><thead><tr><th width="263.923095703125" valign="top">Parameter</th><th width="111.1424560546875" valign="top">Type</th><th width="112.63818359375" valign="top">Direction</th><th valign="top">Description</th></tr></thead><tbody><tr><td valign="top"><code>REQUEST_ID</code></td><td valign="top">NUMERIC</td><td valign="top">IN</td><td valign="top">The request number to filter on</td></tr><tr><td valign="top"><code>REQUEST_STATE</code></td><td valign="top">TEXT</td><td valign="top">IN</td><td valign="top">Request state: <code>OPEN</code> or <code>CLOSED</code></td></tr><tr><td valign="top"><code>REQUEST_SUBSTATE</code></td><td valign="top">TEXT</td><td valign="top">IN</td><td valign="top"><p>Substate:</p><ul><li>For <code>OPEN</code>, use <code>NOT_RUNNING_NOT_STARTED</code> or <code>RUNNING</code></li><li> For <code>CLOSED</code>, use <code>COMPLETED</code> or <code>ABORTED</code></li></ul></td></tr><tr><td valign="top"><code>REQUEST_CREATED_AT_FROM</code></td><td valign="top">DATETIME</td><td valign="top">IN</td><td valign="top">Filter: request created at (from)</td></tr><tr><td valign="top"><code>REQUEST_CREATED_AT_TO</code></td><td valign="top">DATETIME</td><td valign="top">IN</td><td valign="top">Filter: request created at (to)</td></tr><tr><td valign="top"><code>REQUEST_CLOSED_AT_FROM</code></td><td valign="top">DATETIME</td><td valign="top">IN</td><td valign="top">Filter: request closed at (from)</td></tr><tr><td valign="top"><code>REQUEST_CLOSED_AT_TO</code></td><td valign="top">DATETIME</td><td valign="top">IN</td><td valign="top">Filter: request closed at (to)</td></tr><tr><td valign="top"><code>REQUESTER_USERNAME</code></td><td valign="top">TEXT</td><td valign="top">IN</td><td valign="top">Requester's username</td></tr><tr><td valign="top"><code>PROCESS_NAME</code></td><td valign="top">TEXT</td><td valign="top">IN</td><td valign="top">Process name</td></tr><tr><td valign="top"><code>PROCESS_VERSION</code></td><td valign="top">NUMERIC</td><td valign="top">IN</td><td valign="top">Process version</td></tr><tr><td valign="top"><code>QUERY_SCORE</code></td><td valign="top">NUMERIC</td><td valign="top">IN</td><td valign="top">Score threshold for the main query (default: <code>0.5</code>); see <a href="#query-scores">Query scores</a> below for more information</td></tr><tr><td valign="top"><code>QUERY_SCORE_DATA_&#x3C;NAME></code></td><td valign="top">NUMERIC</td><td valign="top">IN</td><td valign="top">Score threshold for the specific data field query (e.g. <code>QUERY_SCORE_DATA_SUBJECT</code>); see <a href="#query-scores">Query scores</a> below for more information</td></tr><tr><td valign="top"><code>SELECT_DATA_LIST</code></td><td valign="top">TEXT</td><td valign="top">IN</td><td valign="top">Comma- or semicolon-separated list of data fields to include in the search result</td></tr></tbody></table>

{% hint style="info" %}
`QUERY_SCORE_DATA_<NAME>` is required if you have a `QUERY_DATA_<NAME>` parameter.
{% endhint %}

#### Query scores

* Query scores are applicable to semantic search only, not full-text search.
* The default score of `0.5` is equivalent to a 50% similarity threshold.
* For stricter matching, use a score closer to `1.0` (e.g. `0.75` for a 75% similarity threshold).
* For looser matching, use a score closer to `0.0` (e.g. `0.25` for a 25% similarity threshold).

This applies to both the `QUERY_SCORE` and the `QUERY_SCORE_<NAME>` parameters.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.workflowgen.com/admin/10.0/workflow-applications/semanticsearch.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
