# Auto Refetch/refresh result on clearing search box text

**URL:** <https://discuss.elastic.co/t/auto-refetch-refresh-result-on-clearing-search-box-text/206233>\
**Category:** Elastic Search\
**Tags:** elastic-app-search\
**Created:** [November 2, 2019, 10:02am UTC](https://discuss.elastic.co/t/auto-refetch-refresh-result-on-clearing-search-box-text/206233 "2019-11-02T10:02:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Swapnil\_Ghorpade](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/swapnil_ghorpade/32/56943_2.png) [@Swapnil\_Ghorpade](https://discuss.elastic.co/u/Swapnil_Ghorpade)\
**Post date:** [November 2, 2019, 10:02am UTC](https://discuss.elastic.co/t/auto-refetch-refresh-result-on-clearing-search-box-text/206233/1 "2019-11-02T10:02:14Z")

</div>

Result is not get automatically refresh or fetched on clearing entered text from search box ?  
Its showing old result. Need to hit search button or enter.

---

<div class="post-metadata">

**Author:** ![JasonStoltz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasonstoltz/32/49893_2.png) [@JasonStoltz](https://discuss.elastic.co/u/JasonStoltz)\
**Post date:** [November 4, 2019, 7:09pm UTC](https://discuss.elastic.co/t/auto-refetch-refresh-result-on-clearing-search-box-text/206233/2 "2019-11-04T19:09:55Z")

</div>

@Swapnil_Ghorpade Could you please be more specific with your questions?

Are you using Search UI for this?

I don't think I understand the question. Why would you expect the search results to refresh without submitting the search form?

---

<div class="post-metadata">

**Author:** ![Swapnil\_Ghorpade](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/swapnil_ghorpade/32/56943_2.png) [@Swapnil\_Ghorpade](https://discuss.elastic.co/u/Swapnil_Ghorpade)\
**Post date:** [November 5, 2019, 6:30am UTC](https://discuss.elastic.co/t/auto-refetch-refresh-result-on-clearing-search-box-text/206233/3 "2019-11-05T06:30:37Z")

</div>

@JasonStoltz yes I'm using search-ui.  
is it possible to call search api to get default result on clearing the search box input as {query: ""} ?

---

<div class="post-metadata">

**Author:** ![JasonStoltz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasonstoltz/32/49893_2.png) [@JasonStoltz](https://discuss.elastic.co/u/JasonStoltz)\
**Post date:** [November 5, 2019, 1:56pm UTC](https://discuss.elastic.co/t/auto-refetch-refresh-result-on-clearing-search-box-text/206233/4 "2019-11-05T13:56:50Z")

</div>

@Swapnil_Ghorpade I'm curious what the root of your problem is, it doesn't seem like something you should be running into. That being said, you can of course use the `setSearchTerm` action to execute a new query [https://github.com/elastic/search-ui/blob/master/ADVANCED.md#actions](https://github.com/elastic/search-ui/blob/master/ADVANCED.md#actions).

```auto
setSearchTerm("")

```

---

<div class="post-metadata">

**Author:** ![Swapnil\_Ghorpade](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/swapnil_ghorpade/32/56943_2.png) [@Swapnil\_Ghorpade](https://discuss.elastic.co/u/Swapnil_Ghorpade)\
**Post date:** [November 6, 2019, 11:02am UTC](https://discuss.elastic.co/t/auto-refetch-refresh-result-on-clearing-search-box-text/206233/5 "2019-11-06T11:02:41Z")

</div>

@JasonStoltz thanks for response..

yes I got it

---

<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:** [December 4, 2019, 11:02am UTC](https://discuss.elastic.co/t/auto-refetch-refresh-result-on-clearing-search-box-text/206233/6 "2019-12-04T11:02:41Z")

</div>

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