I want to display a list of Articles that belong to a certain category and are in the selected language.
The search constraint for the category works, but it is always displaying articles in all languages, and also articles that don’t have published=yes. In other words, the first search constraint works as filter, the other two don’t. Also when I hardcode language = German etc. it does not filter by language. Nor when I add a Search Articles:filtered
Does anyone have an idea how to make the search work? What may I have overlooked?
multiple search constraints work as and operation meaning all three constraints should not be empty to show any results but if you want to show results even if one constraint is empty then you should check “Ignore privacy rules” This way if a search constraint let’s say language is empty it just ignored it and evaluates other two constraints. Search constraints are better compared to filters if your filtering logic Is not that complex and advanced as search constraints filters at database level and pre filters and returns the data only needed where as filter works similarly when you have multiple constraints in filtered then it evaluates as ‘OR’ meaning it ignores the constraint if it is empty. In your case your setup looks correct as you didn’t checked ignore privacy rules it should return values only that satisfies all search constraints. If the first constraint is working and the other two aren’t then the problem would be in your app data double check there are entries with language and published fields filled. If this doesn’t resolve then try searching constraints one by one like remove all three constraints and check constraint 2 i.e published is yes and debug step by step to escalate which constraints is causing this issue. I guess there could a data type mismatch check your are referencing correct data type .Hope this helps
Thank you @VersaSync_Studios this is exactly my understanding, that search constraints should work as AND operators.
So my issue is not that I see too few entries (for which your description would be the perfect checklist), but there is too much displayed, or not enough filtered out. E.g. when I add the language filter it does not filter out the other language content but still displays everything that fits the category constraint. It does not filter out “published=No” or “Language=[other]” entries.
For testing purposes I am now displaying the language of every article in the subtitle. As this screenshot in debugging mode shows, the search constraint on the Repeating Group is “Language=German” but still it is displaying also content with “Language=Français”.
I am at the end of my ideas.
(with a condition “when Language is not … then the current cell is not visible” the other language content IS actually hidden, but instead of the hidden content the empty space remains, so this is not a way to go either🙈)
Check your database entries have language set
yes @boston85719 the “French Title” article has set Language=Français as displayed also in the list, and written in the database
Are both fields for language in the article and user the same types? If yes is it an option set or just plain text?
Yes they both are the same Option Set OS_Language
But also when I add the constraint directly with Language=Deutsch (not referring to the User’s field) it does not filter other languages out.