Hello all. I got a question via email from a customer so I thought I would share the answer here. question: “Is there a way when searching to ensure your results are limited to a particular customer”
Lots of ways to answer so lets start with the basics:
Enterprise search will retrieve and index data for the companies set up in the index configuration. However an individual user will only be able to retrieve results for the company they have access to. So you could have an index that is company specific, or limit a user to a single company.
however that is not what they are asking for: Assuming an index spans companies and the user has access to more than one company, how can they filter just to a single company?
First they could Enter the company ID as standard criteria. For example: Epic06 from the training DB. However that will not directly filter to the company but will find records that also contain that value. Depending on how unique your companyID this might be close enough for most of you.
There is the ability to use keywords to limit the results you see to a particular BAQ but there is no built in feature to limit the results to a particular company. If you have enterprise search premium - which I recommend of course - you can however build your own magic.
Fundemental understanding of what ES does:
It takes your results from the BAQs you create and using basic English language rules turns them into words where possible. For example you may want to see all closed orders. But that is a bit field 0 or 1 that translates into true or false in the BAQ results. You can search on “true” or “false” but as you can already guess that is not going to limit your search results very much!
instead what you do is add a calculated column to your BAQ that basically says: If(Order.Closed) return “ClosedOrders” else return “OpenOrders”. make sure you update hte BAQ into your index and rebuild. Because of the lack of space, the ES logic will put ClosedOrders and OpenOrders into the database as a single ‘word’.
Now you can search on: Dalton ClosedOrders to get all closed orders for the customer Dalton or search on Dalton OpenOrders to get all open orders for dalton. Make sense?
You can use this for anything - so if you want to limit results to company add a calculated column to your BAQs that returns CompanyEpic06 for the company ID that is likely very unique in the DB and a great way to filter.
This little used fact: the abiliy to us calculated columns in a BAQ to create custom search terms is incredibly powerful - every company has their own language just like every industry does. Use that to your advantage - take your cultural terms and build them into your indexing - your fellow employees will love you for it.