Filtering by field on custom type is being applied to other type

I've got a project configured with a custom type called "Event" and a custom type called "Page". The event type has a visible_on and visible_until field that allows the client to hide future/past events from the public interface

I have a sitewide search that is querying Prismic for both "Event" and "Page" documents. It also includes date queries on the visible_on and visible_until dates. Here is my predicate configuation:


The date predicates, which I assumed would only be applied to the "Event" custom type, seem to be filtering out my "Page" documents. With those predicates included I get 0 page documents back from the API, but when I remove them I get the expected documents back.

Is this the expected behaviour?

Hi @chris.hunt ,

The API returns documents that match all parameters, and the my.[custom-type].[field] predicates implicitly only match documents of the given Custom Type.

In your case, the date predicates restrict your results to only event documents, making your any predicate superfluous. In short: yes, this is expected behavior.

I hope this makes sense. Let me know if you have any more questions :slight_smile:


This thread has been closed due to inactivity. Flag to reopen.