# Private Searching with Elasticsearch

**URL:** https://discuss.elastic.co/t/private-searching-with-elasticsearch/351674
**Category:** Elastic Search
**Tags:** elastic-app-search
**Created:** [January 24, 2024, 1:01am UTC](https://discuss.elastic.co/t/private-searching-with-elasticsearch/351674 "2024-01-24T01:01:16Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![aisyaharifin](https://avatars.discourse-cdn.com/v4/letter/a/b9e5f3/32.png) [@aisyaharifin](https://discuss.elastic.co/u/aisyaharifin)
#### Post date: [January 24, 2024, 1:01am UTC](https://discuss.elastic.co/t/private-searching-with-elasticsearch/351674/1 "2024-01-24T01:01:16Z")

</div>

Hello Elastic,

I do have question to ask on Searching where are we able to do private searching?

 ![mypet (2)](https://us1.discourse-cdn.com/elastic/original/3X/4/0/403b9f168d617d72504360d3810f6530c5e89cf9.jpeg)

So from the picture, we have both private and public channel that we would like to do searching on.

The question right now is, can the application pass to elastic the userId for elastic to process the data and determine that this user can access to private channel and do searching for private post?

Thanks.

---

<div class="post-metadata">

### Author: ![aisyaharifin](https://avatars.discourse-cdn.com/v4/letter/a/b9e5f3/32.png) [@aisyaharifin](https://discuss.elastic.co/u/aisyaharifin)
#### Post date: [January 24, 2024, 3:08am UTC](https://discuss.elastic.co/t/private-searching-with-elasticsearch/351674/2 "2024-01-24T03:08:10Z")

</div>

I'm going to explain further on my situation.

We have application that is a platform that contain like post or content, announcement etc of our company.

We already pull our data using Microsoft SQL Connector and set Advanced sync rules to get the filtered data from the db.

The data going to pull is Channel post that is public and the second one is Channel post that is private.

The first rules will not pull the userID for the public Channel post as it is public and everyone can access.

The second rules will pull the userID together to set that this is the list of users that able to access to the private Channel post.

The question is, can our front end application pass the userid and keyword to do the searching to Elastic, for it to process, if the userId available in the data, then they able to access to the private Channel and do the searching for private post?

I did get the reference on the document security level, but this is untested and I'm reaching out of time to do any testing that this going to work. The deadline is this Friday.

> **[Document level security | Elasticsearch Guide \[8.12\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/document-level-security.html)**

Need solution that is proven.

Thanks.

---

<div class="post-metadata">

### Author: ![Kathleen\_DeRusso](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kathleen_derusso/32/132039_2.png) [@Kathleen\_DeRusso](https://discuss.elastic.co/u/Kathleen_DeRusso)
#### Post date: [January 24, 2024, 2:22pm UTC](https://discuss.elastic.co/t/private-searching-with-elasticsearch/351674/3 "2024-01-24T14:22:21Z")

</div>

You found the right answer, Document Level Security is what you need here!

---

<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: [February 21, 2024, 2:22pm UTC](https://discuss.elastic.co/t/private-searching-with-elasticsearch/351674/4 "2024-02-21T14:22:28Z")

</div>

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