> For the complete documentation index, see [llms.txt](https://docs.fact-finder.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fact-finder.com/webcomponents-overview/api/more-features/single-word-search.md).

# Single Word Search

\`ff-single-word-search\` breaks multi-word searches into separate word-level results. Use its record element to show matches and link each word to a new search.

## Documentation

With the `ff-single-word-search` element, you can split a search result into separate words. It is only shown when the search request has more than one word.

Each word and its search results are rendered by a `ff-single-word-search-record` element. Inside this element, you can access the `SingleWordSearchResult` data object that was received from FactFinder. This includes, among others, *hit count* and the *products* found by the word. See your FactFinder REST API documentation for details.

Inside the `ff-single-word-search-record` element, you can use an `ff-record-list` element to render the found products. Also, you can set the `data-search="singleWord"` attribute on any element to attach a click listener which triggers a search for the current word.

```html
<ff-single-word-search>

    <!-- Define a Header if needed. -->
    <h1>
        <span id="singleWordSearchCaption">For a part of your search following products could be found:</span>
    </h1>

    <!-- Design the look of your single-word-search. -->
    <ff-single-word-search-record>

        <!-- Set the data-search="singleWord" attribute to trigger a search by clicking the element. -->
        <!-- `word` and `totalHits` are from the SingleWordSearchResult data object. -->
        <h2 data-search="singleWord">{{word}} ({{totalHits}}) </h2>

        <!-- Use a regular ff-record-list to display the found records. -->
        <ff-record-list>
            <template data-role="record">
                <ff-record>
                    <img data-image="{{variantValues.0.ImageName}}">
                    <div class="title">{{variantValues.0.Title}}</div>
                    <div class="price">{{$ variantValues.0.Price}}</div>
                </ff-record>
            </template>
        </ff-record-list>
    </ff-single-word-search-record>
</ff-single-word-search>
```

## API

### `ff-single-word-search`

#### Properties

| Name                                            | Description                                                   |
| ----------------------------------------------- | ------------------------------------------------------------- |
| **singleWordResults** (Array) (JavaScript only) | An array of `SingleWordSearchResult` objects from FactFinder. |

#### Events

| Name            | Description                                |
| --------------- | ------------------------------------------ |
| **dom-updated** | Fires whenever the element is re-rendered. |

### `ff-single-word-search-record`

#### Properties

| Name                                            | Description               |
| ----------------------------------------------- | ------------------------- |
| **singleWordResult** (Object) (JavaScript only) | The data from FactFinder. |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.fact-finder.com/webcomponents-overview/api/more-features/single-word-search.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
