Explanation of service portal search functionality for a use case which is defined like below.
Catalog contains category_1, category_2
category_1 contains item_1
category_2 contains subcategory_2
subcategory_2 contains item_2
Both category 1 and 2 have a user criteria "available for" that doesn't permit the user to see them, and for the subcategory_2 user has access.
2. Type "item_1" in the typeahead search and could see No results.
3. Type "item_2" in the typeahead search and could see item_2 in the results.
- As per the configuration, item_2 is in subcategory_2 and subcategory_2 is in category_2, but for category_2 the user doesn't have access. So logically user should not have access to "item_2" even though the "available for" is allowing the user.
User criteria on the category are solely for the purpose of browsability. When searching for an item it checks if there is any category that is accessible for the user and displays it if it has any.
In the above use case, both category and subcategory are from the sc_category table. The system looks at all the records in the table and validates the access.
So if we see the above use case, there is no logical relation between 'category_2' and 'subcategory_2' with respect to the current system functionality.
So this is why the 'item_2' has resulted in the search for the user. This is the expected behavior of the system.