> ## Documentation Index
> Fetch the complete documentation index at: https://doc.lucidworks.com/llms.txt
> Use this file to discover all available pages before exploring further.

# widget:spelling-suggestions

export const LwTemplate = ({title = "Key questions to get you started", icon = "sparkles", cta = "Powered by Agent Studio", linkHref = "https://lucidworks.com/demo/?utm_source=docs&utm_medium=referral&utm_campaign=docs_cta_ai"}) => {
  const [isLoaded, setIsLoaded] = useState(false);
  useEffect(() => {
    const timer = setTimeout(() => {
      setIsLoaded(true);
    }, 500);
    return () => clearTimeout(timer);
  }, []);
  return <div className="lw-template-container">
      <Card title={title} icon={icon}>
        {isLoaded && <span dangerouslySetInnerHTML={{
    __html: `<lw-template id="a029c1a9-28be-427e-b0e1-5d918920246a"></lw-template
            >`
  }} />}
        <Link href={linkHref} className="agent-studio-link text-left text-gray-600 gap-2 dark:text-gray-400 text-sm font-medium flex flex-row items-center hover:text-primary dark:hover:text-primary-light group-hover:text-primary group-hover:dark:text-primary-light">Powered by Lucidworks Agent Studio</Link>
      </Card>
    </div>;
};

[localhost link]: http://localhost:3000/docs/4/app-studio/reference/tags/lightning.directive.widgetSpellingSuggestions

[mintlify link]: https://doc.lucidworks.com/docs/4/app-studio/reference/tags/lightning.directive.widgetSpellingSuggestions

[old doc.lw link]: https://doc.lucidworks.com/app-studio/4.2/1138

<LwTemplate />

## Description

## Usage

as element:

```xml wrap  theme={"dark"}
<widget:spelling-suggestions
       response="{string}"
       query="{string}">
</widget:spelling-suggestions>
```

#### Parameters

| Param    | Type       | Details                                                                                                                                     |
| -------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| response | **string** | The name of the response from which to retrieve the spelling suggestion messages.                                                           |
| query    | **string** | The name of the query originally submitted by the user. This can differ from the one on the Response which was sent to the search platform. |

## Example

#### Source

```xml wrap  expandable  theme={"dark"}
<h3 id="example_not-auto-corrected">Not Auto-Corrected</h3>
<h4 id="example_not-auto-corrected_default">Default</h4>
<tk-example>
    <widget:spelling-suggestions response="notAutoCorrected" query="query"></widget:spelling-suggestions>
</tk-example>
<tk-code-wrapper>
    <code hljs hljs-no-escape>&lt;widget:spelling-suggestions response="notAutoCorrected" query="query"&gt;&lt;/widget:spelling-suggestions&gt;</code>
</tk-code-wrapper>
<hr />
<h4 id="example_not-auto-corrected_with-label-and-suffix">With Label and Suffix</h4>
<tk-example>
    <widget:spelling-suggestions response="notAutoCorrected" query="query" label="Were you looking for:" suffix="?"></widget:spelling-suggestions>
</tk-example>
<tk-code-wrapper>
    <code hljs hljs-no-escape>&lt;widget:spelling-suggestions response="notAutoCorrected" query="query" label="Were you looking for:" suffix="?"&gt;&lt;/widget:spelling-suggestions&gt;</code>
</tk-code-wrapper>
<hr />
<h3 id="example_auto-corrected">Auto-Corrected</h3>
<h4 id="example_auto-corrected_default">Default</h4>
<tk-example>
    <widget:spelling-suggestions response="autoCorrected" query="query"></widget:spelling-suggestions>
</tk-example>
<tk-code-wrapper>
    <code hljs hljs-no-escape>&lt;widget:spelling-suggestions response="autoCorrected" query="query"&gt;&lt;/widget:spelling-suggestions&gt;</code>
</tk-code-wrapper>
<hr />
<h4 id="example_auto-corrected_with-label-and-suffix">With Label and Suffix</h4>
<tk-example>
    <widget:spelling-suggestions response="autoCorrected" query="query" original-label="Couldn't find anything for:" original-suffix=". :(" corrected-label="How about:" corrected-suffix="? :)"></widget:spelling-suggestions>
</tk-example>
<tk-code-wrapper>
    <code hljs hljs-no-escape>&lt;widget:spelling-suggestions response="autoCorrected" query="query" original-label="Couldn't find anything for:" original-suffix=". :(" corrected-label="How about:" corrected-suffix="? :)"&gt;&lt;/widget:spelling-suggestions&gt;</code>
</tk-code-wrapper>
<hr />
```

```js wrap  expandable  theme={"dark"}
angular.module('lightning')
.controller('ExampleController', ['$scope','$timeout','ResponseService','QueryService', function($scope,$timeout,ResponseService,QueryService) {
            $scope.notAutoCorrected = {
                page: 2,
                query: {
                    rpp: 50
                },
                facets: {},
                results: [],
                "messages": [
                    {
                        "type": "spelling",
                        "count": 0,
                        "label": "Twigkit",
                        "query": "Twigkit",
                        "auto-corrected": false
                    }
                    ]
            };

            $scope.autoCorrected = {
                page: 2,
                query: {
                    rpp: 50
                },
                facets: {},
                results: [],
                "messages": [
                    {
                        "type": "spelling",
                        "count": 0,
                        "label": "Twigkit",
                        "query": "Twigkit",
                        "auto-corrected": true
                    }
                    ]
            };

            $scope.query = {
                q:'tiwkit'
            };

            ResponseService.setResponse('notAutoCorrected', $scope.notAutoCorrected);
            ResponseService.setResponse('autoCorrected', $scope.autoCorrected);
            QueryService.setQuery('query',$scope.query);
        }]);
```

#### Result

<img src="https://mintcdn.com/lucidworks/J_LymSfRoWq3UOvg/assets/images/app-studio/as-examples/tags/widgetSpellingSuggestions.png?fit=max&auto=format&n=J_LymSfRoWq3UOvg&q=85&s=fcd1c3c3089e369dcb8faabd468305c8" alt="Result" width="1024" height="1275" data-path="assets/images/app-studio/as-examples/tags/widgetSpellingSuggestions.png" />
