: But when i search for some medicine, following my business rules, i have to : verify if the result of my search contains any Original medicine, if there : is any, then i wouldn't show the generics of this respective medicine, on : the other hand, if there wasnt any original product in the result i would : have to return its generics. : Im currently returning the original and generics, is there a way to do this : kind of "checking" in solr?
Think carefully about what you really want here, because there is a subtlety in your description that is a bit ambiguious. Do you want the logic to be "if total result set contains any original medicines, then remove all generic medicines from the result set" or is the logic you need "if total result set contains any original medicines X, then remove all generic medicines Y such that Y is a generic form of X." Those are very different. Imagine Vaxidrop and Vaxipill are both original meds, while Generidrop and Generipill are the corrisponding generics. If i do a search that (unaltered) matches the following docs... * Vaxidrop * Generidrop * Generipill ...then what should the result set be after your biz rules? just Vaxidrop, or Vaxidrop + Generipill? -Hoss