# Search UI is not suupoting hashing in url

**URL:** <https://discuss.elastic.co/t/search-ui-is-not-suupoting-hashing-in-url/240519>\
**Category:** Elasticsearch\
**Created:** [July 9, 2020, 11:36am UTC](https://discuss.elastic.co/t/search-ui-is-not-suupoting-hashing-in-url/240519 "2020-07-09T11:36:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ranjeet.tiwari](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ranjeet.tiwari/32/55160_2.png) [@ranjeet.tiwari](https://discuss.elastic.co/u/ranjeet.tiwari)\
**Post date:** [July 9, 2020, 11:36am UTC](https://discuss.elastic.co/t/search-ui-is-not-suupoting-hashing-in-url/240519/1 "2020-07-09T11:36:56Z")

</div>

We are using search ui library that allows to quickly implement search experience leveraging Elasticsearch.

We have used hashing in the url routing (which generate the url like this [http://www.example.com/](http://www.example.com/) **#/Search** , it is to load **search** component) and we have also enabled the trackURLState in the config of searchUI, so, on the click of back/forward button of browser, searchUI can maintain the selection of refiners.

Problem is that when we enable the hashing in solution and try to select any of the refiner, we are facing below issue

suppose i am search page - [http://www.example.com/](http://www.example.com/) **#/Search**

when i select "US" in the refiner then  
"[http://www.example.com/?size=n\_20\_n&filters[0][field]=Region&filters[0][values][0]=US&filters[0][type]=any](http://www.example.com/?size=n_20_n&filters%5B0%5D%5Bfield%5D=Region&filters%5B0%5D%5Bvalues%5D%5B0%5D=US&filters%5B0%5D%5Btype%5D=any)"

now if you notice in the above url " **#search**" got removed, which is creating the problem in application.

@JasonStoltz.. Please help me here

---

<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:** [July 9, 2020, 12:20pm UTC](https://discuss.elastic.co/t/search-ui-is-not-suupoting-hashing-in-url/240519/2 "2020-07-09T12:20:17Z")

</div>

Hey Ranjeet, I unfortunately don't think `trackUrlState` is going to be compatible with hash routing.

---

<div class="post-metadata">

**Author:** ![ranjeet.tiwari](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ranjeet.tiwari/32/55160_2.png) [@ranjeet.tiwari](https://discuss.elastic.co/u/ranjeet.tiwari)\
**Post date:** [July 9, 2020, 12:32pm UTC](https://discuss.elastic.co/t/search-ui-is-not-suupoting-hashing-in-url/240519/3 "2020-07-09T12:32:41Z")

</div>

@JasonStoltz- can you please help us in achieving this? any suggestion to achieve this?

---

<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:** [July 9, 2020, 12:50pm UTC](https://discuss.elastic.co/t/search-ui-is-not-suupoting-hashing-in-url/240519/4 "2020-07-09T12:50:04Z")

</div>

That's a tough one.

First and foremost, I highly recommend trying to find a way to load the search page without using hash routing.

If that is not possible, then I'd recommend disabling `trackUrlState`.

If you still need `trackUrlState` to be enabled and you can't change your hash routing, then you're going to have to get creative.

[https://github.com/elastic/search-ui/blob/master/packages/search-](https://github.com/elastic/search-ui/blob/master/packages/search-)[ui/src/URLManager.js](http://URLManager) manages the url state in Search UI. You could attempt to use your own that preserves hash state...

You'd need to do something like this in order to use it:

```auto
import { SearchDriver } from "@elastic/search-ui";

const config = {
  /* your config */
};
const driver = new SearchDriver(config);
driver.URLManager = YourCustomURLManager

...

<SearchProvider driver={driver}>
</SearchProvider>

```

That's the best I can do for you. Be cautious if you do that though, you're changing Search UI internals directly, which means updating Search UI versions could break your implementation. I've also never tried that before, so I have no idea how well it will work. It will also require looking at our source code, particularly the URLManager and SearchProvider.

Good luck!

Jason

---

<div class="post-metadata">

**Author:** ![ranjeet.tiwari](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ranjeet.tiwari/32/55160_2.png) [@ranjeet.tiwari](https://discuss.elastic.co/u/ranjeet.tiwari)\
**Post date:** [July 10, 2020, 5:49am UTC](https://discuss.elastic.co/t/search-ui-is-not-suupoting-hashing-in-url/240519/5 "2020-07-10T05:49:29Z")

</div>

Thanks for the quick reply @JasonStoltz

---

<div class="post-metadata">

**Author:** ![ranjeet.tiwari](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ranjeet.tiwari/32/55160_2.png) [@ranjeet.tiwari](https://discuss.elastic.co/u/ranjeet.tiwari)\
**Post date:** [July 10, 2020, 5:56am UTC](https://discuss.elastic.co/t/search-ui-is-not-suupoting-hashing-in-url/240519/6 "2020-07-10T05:56:59Z")

</div>

@JasonStoltz, is there any plan to support hashing in the url in searchui?

---

<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:** [August 7, 2020, 6:04am UTC](https://discuss.elastic.co/t/search-ui-is-not-suupoting-hashing-in-url/240519/7 "2020-08-07T06:04:47Z")

</div>

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