[Geoserver-devel] [JIRA] (GEOS-9291) CQL filter OR operator does not work on attributes that are multiple on MongoDB DataSource

Artem Groznykh created an issue

GeoServer / BugGEOS-9291

CQL filter OR operator does not work on attributes that are multiple on MongoDB DataSource

Issue Type:

BugBug

Affects Versions:

2.15.2

Assignee:

Unassigned

Attachments:

stations-stations (1).png, stations-stations (2).png, stations-stations.png

Created:

19/Jul/19 5:37 PM

Environment:

windows 7
MongoDB 3.6

Priority:

MediumMedium

Reporter:

Artem Groznykh

I’ve created a collection with data from here (just two records), created 2dsphere index

Then I created a layer from that collection and tried to request it by WMS
with cql_filter in URL params.

  1. when I use simple attributes (that are not multiple) in the filter all is
    fine (points are visible):
  • filter: “contract.mail” ILIKE ‘%@mail.com%’ OR “name” ILIKE ‘%station%’

  • mongo log: { … , filter: { }, projection: { geometry: 1, contact.mail: 1, name: 1 }

    , … }

  1. when I use attributes that are multiple in the filter then it DOES NOT
    work (there is no any point on received PNG):
  • filter: “measurements.name” ILIKE ‘%wind%’ OR “measurements.unit” ILIKE
    ‘%c%’

  • mongo log: { … , filter: { }, projection: {geometry: 1, measurements.unit: 1, measurements.name: 1}

    , … }

  1. when I change OR to AND in previous filter then it’s works fine:
  • filter: “measurements.name” ILIKE ‘%wind%’ AND “measurements.unit” ILIKE
    ‘%c%’

  • mongo log: { …, filter:
    Unknown macro: { $and}

    , projection:

    { geometry: 1 }

    , … }

So I concluded that GeoServer does AND operation by sending filter to
mongoDB. And OR operation by itself requesting all records from collection.
But with attributes that are multiple something goes wrong.

Add Comment

Add Comment

Get Jira notifications on your phone! Download the Jira Cloud app for Android or iOS


This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100105-sha1:1408920)

Atlassian logo