Can I make location[within] return also entries with no location defined


I have one content type of service that can be of type digital or physical.

If it’s physical it will have a location field value, but if it’s digital the the value for that field is null.

I would like a query like location[within]=lat,long,radius to return services in that radius, but also services where the location is null.

Is there a way to get this without using 2 queries?


Hi Jose,

Because you’re already using a value for the location parameter, you’d have to send a separate query to get the items that don’t have a location value.

To do that, you can use the existence parameter, as described in the following section of our documentation:

1 Like