# Adding search bar to my web application

**URL:** https://discuss.elastic.co/t/adding-search-bar-to-my-web-application/195899
**Category:** Elasticsearch
**Created:** [August 20, 2019, 11:17am UTC](https://discuss.elastic.co/t/adding-search-bar-to-my-web-application/195899 "2019-08-20T11:17:34Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![saurabhbora](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/saurabhbora/32/51197_2.png) [@saurabhbora](https://discuss.elastic.co/u/saurabhbora)
#### Post date: [August 20, 2019, 11:17am UTC](https://discuss.elastic.co/t/adding-search-bar-to-my-web-application/195899/1 "2019-08-20T11:17:34Z")

</div>

I have a single database with 20+ tables in MySQL with different structures and linking. How should I ingest them in elasticsearch with the same format and how many indexes must be used?

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [August 20, 2019, 12:36pm UTC](https://discuss.elastic.co/t/adding-search-bar-to-my-web-application/195899/2 "2019-08-20T12:36:53Z")

</div>

I'd totally forget about the existing model and would just think about the usage to build the right "search" objects for my use case.  
Here I can't really answer as I don't know the use case.

Basically I'd recommend to ask yourself 2 questions:

- What kind of objects my users want to get back as a response? If it's object `X`, then just index object `X`
- What typical attributes my users want to search for? Let say I need attribute `a`, `b` and `c`, just index those attributes within object `X` whatever the original source of those attributes is.

Also I shared most of my thoughts there: [http://david.pilato.fr/blog/2015/05/09/advanced-search-for-your-legacy-application/](http://david.pilato.fr/blog/2015/05/09/advanced-search-for-your-legacy-application/)

Basically, I'd recommend modifying the application layer if possible and send data to elasticsearch in the same "transaction" as you are sending your data to the database.

Then if it's for a search bar, I'd also look at AppSearch.

---

<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: [September 17, 2019, 12:37pm UTC](https://discuss.elastic.co/t/adding-search-bar-to-my-web-application/195899/3 "2019-09-17T12:37:00Z")

</div>

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