# SearchUI - Using autocompleteQuery with elastic search connector

**URL:** <https://discuss.elastic.co/t/searchui-using-autocompletequery-with-elastic-search-connector/327682>\
**Category:** Elastic Search\
**Tags:** elastic-app-search\
**Created:** [March 14, 2023, 3:04pm UTC](https://discuss.elastic.co/t/searchui-using-autocompletequery-with-elastic-search-connector/327682 "2023-03-14T15:04:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jackfrost](https://avatars.discourse-cdn.com/v4/letter/j/59ef9b/32.png) [@jackfrost](https://discuss.elastic.co/u/jackfrost)\
**Post date:** [March 14, 2023, 3:04pm UTC](https://discuss.elastic.co/t/searchui-using-autocompletequery-with-elastic-search-connector/327682/1 "2023-03-14T15:04:18Z")

</div>

Im moving from using the app search connector to the elastic client connector. It seems that autocompleteQuery does not work in the Elasticsearch connector the same way it does in the app search connector.

Example

App search connector:

1. Go to the app search connector demo page [here](https://codesandbox.io/s/github/elastic/search-ui/tree/main/examples/sandbox?from-embed=&initialpath=/search-bar-in-header&file=/src/pages/search-bar-in-header/index.js)
2. type "yos" into the header

You will get the following results in the UI:  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/a/1/a1f6194f38e142d61ba66a76bda4b175b02141f4.png)

and the following requests will have been sent:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/5/b/5b474ccc9b3d7f2fd902056f2914d35982950e22.png)

using this config

```auto
autocompleteQuery: {
    results: {
      resultsPerPage: 5,
      result_fields: {
        title: {
          snippet: {
            size: 100,
            fallback: true
          }
        },
        nps_link: {
          raw: {}
        }
      }
    },
    suggestions: {
      types: {
        documents: {
          fields: ["title", "description"]
        }
      },
      size: 4
    }
  },

```

However, if you do the same thing using

1. the Elasticsearch connector demo page [here](https://codesandbox.io/s/github/elastic/search-ui/tree/main/examples/sandbox?from-embed=&initialpath=/elasticsearch&file=/src/pages/elasticsearch/index.js)
2. type "yos" into the header

You will get the following results in the UI:  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/a/a/aa08dccfd48d16cfafe6daf8b4cffccf89e9dd80.png)

and the following requests will have been sent:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/6/d/6dbf45e66f419d10e474265a291d3a19bf02e6ab.png)

using this config:

```auto
autocompleteQuery: {
    results: {
      search_fields: {
        parks_search_as_you_type: {}
      },
      resultsPerPage: 5,
      result_fields: {
        title: {
          snippet: {
            size: 100,
            fallback: true
          }
        },
        nps_link: {
          raw: {}
        }
      }
    },
    suggestions: {
      types: {
        documents: {
          fields: ["parks_completion"]
        }
      },
      size: 4
    }
  }

```

So my question is, even though both of these example apps have the same config setup, why does only the app search connector return the auto complete queries in the UI?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 11, 2023, 3:04pm UTC](https://discuss.elastic.co/t/searchui-using-autocompletequery-with-elastic-search-connector/327682/2 "2023-04-11T15:04:47Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
