Implementing Visibility Rules in Search Engine
TLDR Dima shared a problem with visibility rules for documents in a dataset. Jason recommended using Role Based Access Control, filters, and "OR" (introduced in version 0.24.0).




Mar 13, 2023 (6 months ago)
Dima
08:52 PMDima
08:54 PMSome of documents in my dataset have different visibility rules and I want to reproduce them in the search engine. For example:
• Article with list of employees, available for the whole company
• Article with internal department rules, available for
department1
(i.e. for all teams in this department)• Article with internal team’s drafts, available for
team1
My first idea was to use arrays for such visibility fields and then fullfill them with corresponding values. If visibility chosen as
department1
, we will add corresponding teams too. Solution looks like thisProblems with this solution are:
• Some people can be outside teams or departments. For example CEO or other leaders.
• We need to update index every time when new teams are created, otherwise they will get empty results (e.g. newcomer team5 won’t get even publicly available documents)
Jason
08:57 PMJason
08:58 PMYou could add them to an internal admin “system” team of sorts, that is not exposed to your end users
Jason
08:59 PMYou could create another attribute called
is_public: true|false
in each documentDima
08:59 PMJason
08:59 PM(departments:=[`department1`] && teams:=[`team1`]) || is_public:true
Dima
08:59 PMJason
09:00 PMDima
09:01 PMJason
09:01 PMDima
09:02 PM
Dima
09:05 PMI got only
"available for all"
document, but expected "available for department1 (so for all nested teams)"
too, because departments
contains department1
🤔Jason
09:07 PMDima
09:08 PMDima
09:10 PM
Dima
09:10 PM

Typesense
Indexed 2764 threads (79% resolved)
Similar Threads
Fixing Multiple Document Retrieval in Typesense
Phil needed an efficient way to retrieve multiple documents by id. Kishore Nallan proposed a solution available in a pre-release build. After some bug fixing regarding id matching by Jason and Kishore Nallan, Phil successfully tested the solution.



Docsearch Scrapper Metadata Configuration and Filter Problem
Marcos faced issues with Docsearch scrapper not adding metadata attributes and filtering out documents without content. Jason helped fix the issue by updating the scraper and providing filtering instructions.

Discussions on Typesense, Collections, and Dynamic Fields
Tugay shares plans to use Typesense for their SaaS platform and asks about collection sizes and sharding. Jason clarifies Typesense's capabilities and shares a beta feature. They discuss using unique collections per customer and new improvements. Kishore Nallan and Gabe comment on threading and data protection respectively.


Troubleshooting Typesense Setup and Understanding Facets and Keywords
Demitri encountered errors when exploring Typesense for the first time. Jason guided them through troubleshooting and discussed facets, keyword settings, and widget configurations. Helin shared a Python demo app and its source code to help Demitri with their project.

Querying with Typesense-Js and Handling Null Values
michtio was querying using typesense-js and receiving fewer results than expected. Kishore Nallan suggested using different query parameters. Further discussion led to the handling of 'null' values and filtering syntax in the search queries. The thread ended with Jason offering migration support from Algolia to Typesense.


