You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Specific: In order to publish an app to the iOS AppStore the app is required to allow blocking users. In this case, we can't display the products of another user anymore.
General: We need a feature, that hides products from a user. Maybe because he doesn't want to see it anymore, because it's blocked content, or maybe because of other parameters that are disallowing access.
Implementation with elasticsearch
In the past, we used the elasticsearch plugin like this:
// Overwrote the search query:if(ctx.activeUserId){constowner=awaitthis.productOwnerService.getOwner(ctx);// Apply list of blocked users for search inputsearchInput.blocked=owner.customFields.blockedUsers??[];searchInput.blockedBy=owner.customFields.blockedBy??[];}constresult=awaitthis.elasticsearchService.search(ctx,searchInput,true);
// Inside the elasticsearch config:
mapQuery: (query: any,input: ExtendedSearchInput,searchConfig: DeepRequired<SearchConfig>)=>{// Don't display product of a block userconst{ blocked =[], blockedBy =[]}=input;if(blocked.length>0||blockedBy.length>0){query.bool={
...query.bool,must_not: {terms: {'product-ownerId.keyword': [...blocked, ...blockedBy],},},};}}
The text was updated successfully, but these errors were encountered:
Draykee
changed the title
AdvancedSearch: Allow contains search operation
AdvancedSearch: Add a feature to hide products based on parameters
Mar 16, 2023
Usecase:
Implementation with elasticsearch
In the past, we used the elasticsearch plugin like this:
The text was updated successfully, but these errors were encountered: