# Full-text search

Full-text search is used to run a full-text search in the database. Properties to be included in the search must be [enabled for full-text search](https://docs.appfarm.io/reference/data-model/object-class-properties#general-properties) in the data model.

{% hint style="info" %}
**Tier requirement**

Access to Full-text search is dependent on your solution's subscription tier.
{% endhint %}

## Usage

This action node can be used when large amounts of data in the database should be searchable by the user, but only need to be retrieved on demand. This approach reduces the need for reading data to the client, which can improve the application's performance. An example can be a library of articles or case files that the user only needs access to on demand.

See [How to configure Full-text search](https://docs.appfarm.io/how-to/logic-and-flow/configure-full-text-search) for a step-by-step guide on how to set up Full-text search in an app.

## Properties

<table><thead><tr><th width="226">Property</th><th>Description</th></tr></thead><tbody><tr><td><strong>Data Source</strong></td><td>Select the data source you want to populate with the search results. Must be a runtime-only data source.</td></tr><tr><td><strong>Search Score</strong></td><td><p>Every object returned by Full-text search is assigned a score based on relevance.</p><p>Select a property on the selected <strong>Data Source</strong> to store this score. Must be of type float.<br><br>Many factors can influence an object's score, including:<br>- The position of the search term in the object<br>- The frequency of occurrence of the search term in the object<br>- The type of operator the query uses<br>- The type of analyzer the query uses</p></td></tr><tr><td><strong>Filter</strong></td><td>Define the <a href="../../reference/platform-concepts/filters">filter</a> to apply to the results.</td></tr><tr><td><strong>Search Type</strong></td><td><ul><li><strong>Text:</strong> perform textual analyzed search. Corresponds to the <a href="../../../reference/platform-concepts/operators#string-operators">contains any string operator</a>.</li><li><strong>Autocomplete:</strong> perform a search-as-you-type query from an incomplete input string.</li><li><strong>Equals</strong>: search for an exact match. This works for string, integer or float properties.</li></ul></td></tr><tr><td><strong>Search in Properties</strong></td><td>Choose which object class properties to search in. Only properties enabled for Full-text search in the data model will be listed.</td></tr><tr><td><strong>Sorting</strong></td><td>Add <a href="https://docs.appfarm.io/library/action-nodes/sort-objects#sorting">sorting rules</a>. The objects will be sorted before they are read into the data source.</td></tr><tr><td><strong>Search Term</strong></td><td>Define the term to search for in the database. This will typically be an App Variable containing the search string.</td></tr><tr><td><strong>Limit Result</strong></td><td>Limit the maximum number of objects returned in the search.</td></tr><tr><td><strong>Match Criteria</strong></td><td><em>Available for Search Type <strong>Text</strong> only.</em><br><br>Select criteria to use to match the search term. The criteria can be one of the following:<br><br>- <strong>any</strong>: return entries that match any of the words in the search term.<br>- <strong>all</strong>: return entries that contain all of the words in the search term.</td></tr><tr><td><strong>Fuzzy Match</strong></td><td>Enable to find matches even when the search term does not exactly match the result. Useful when typos can occur in the search term.</td></tr><tr><td><strong>Fuzzy Max Edits</strong></td><td><em>Available when <strong>Fuzzy Match</strong> is enabled.</em><br><br>Maximum number of single-character edits required to match the specified search term. Value can be 1 or 2. Default is 2.<br><br>A single-character edit can be an insertion, deletion, or substitution of a character, or a transposition of two adjacent characters.<br><br>Example, if your search term is 'cat':<br><br>- With fuzzyMaxEdits: 1, possible matches could include 'bat' (substitution), 'cats' (insertion), or 'at' (deletion)<br>- With fuzzyMaxEdits: 2, it would allow for edits like 'cart' (substitution and insertion), 'scat' (insertion and substitution), or 'tac' (transposition).<br></td></tr><tr><td><strong>Fuzzy Prefix Length</strong></td><td><em>Available when <strong>Fuzzy Match</strong> is enabled.</em><br><br>Number of characters at the beginning of each term in the result that must exactly match. The default value is 0.</td></tr><tr><td><strong>Fuzzy Max Expansions</strong></td><td><em>Available when <strong>Fuzzy Match</strong> is enabled.</em><br><br>Controls how many possible variations the search considers when finding similar terms to your query.<br>Adjusting this can change both the number of results and how quickly you get them. The default value is 50.<br>- Low Number (e.g., 50):<br>- <strong>Effect</strong>: The search checks up to 50 variations.<br>- It is faster but might miss some matches.<br>- <strong>Suitable for</strong>: Fast searches when precision is not as critical.<br><br>- High Number (e.g., 500):<br>- <strong>Effect</strong>: The search considers up to 500 variations.<br>- You get more matches, but it might take longer.<br>- <strong>Suitable for</strong>: Thorough searches where finding more potential matches is important, even with typos.',</td></tr><tr><td></td><td></td></tr></tbody></table>


---

# 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.appfarm.io/library/action-nodes/full-text-search.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.
