# Term suggester with Multitenant

**URL:** <https://discuss.elastic.co/t/term-suggester-with-multitenant/84416>\
**Category:** Elasticsearch\
**Created:** [May 3, 2017, 1:13pm UTC](https://discuss.elastic.co/t/term-suggester-with-multitenant/84416 "2017-05-03T13:13:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ariel\_Rosenthal](https://avatars.discourse-cdn.com/v4/letter/a/fbc32d/32.png) [@Ariel\_Rosenthal](https://discuss.elastic.co/u/Ariel_Rosenthal)\
**Post date:** [May 3, 2017, 1:13pm UTC](https://discuss.elastic.co/t/term-suggester-with-multitenant/84416/1 "2017-05-03T13:13:15Z")

</div>

I am trying to create a multi tenant architecture with elasticsearch. After going through your documentation I decided to choose the fake index alias option ([https://www.elastic.co/guide/en/elasticsearch/guide/current/faking-it.html](https://www.elastic.co/guide/en/elasticsearch/guide/current/faking-it.html)). Each company gets a fake index for each one of our models. So, for example, a company has a fake index for the Invoice model and a fake index for the Client model.

My search queries all use the term suggester for a "did you mean" functionality. I tried using the phrase suggester and after following your documentation, I received far worst results than the results I am receiving when using the term suggester, so I rolled back to the term suggester.

The problem is that I am receiving suggestions that relate to other tenants and are irrelevant to the current tenant. I expected that this will disappear after moving to the fake index method, but it didn't. It is needless to say that this is not only ugly, but it is also a security vulnerability, so of course I cannot use it in the current form.

I would love to understand how to fix this. After searching for days for a solution, I am pretty much helpless and need any help I can get.

Thanks!  
Ariel

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 9, 2017, 11:09am UTC](https://discuss.elastic.co/t/term-suggester-with-multitenant/84416/2 "2017-05-09T11:09:14Z")

</div>

What version are you on?

> [@Ariel\_Rosenthal](#):
>
> it is also a security vulnerability

Aliases, even filtered ones, are not a security solution. You should look at Security with field level security.

---

<div class="post-metadata">

**Author:** ![Ariel\_Rosenthal](https://avatars.discourse-cdn.com/v4/letter/a/fbc32d/32.png) [@Ariel\_Rosenthal](https://discuss.elastic.co/u/Ariel_Rosenthal)\
**Post date:** [May 9, 2017, 11:23am UTC](https://discuss.elastic.co/t/term-suggester-with-multitenant/84416/3 "2017-05-09T11:23:42Z")

</div>

Thank you. I'll check field lever security. Regarding your question - I am using version 5.3.

---

<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:** [June 6, 2017, 11:30am UTC](https://discuss.elastic.co/t/term-suggester-with-multitenant/84416/4 "2017-06-06T11:30:24Z")

</div>

Closed on June 6, 2017, 11:30am UTC

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