I am migrating an existing application from Mapserver 6.2.1 to Mapserver 7.0. How did the expression-Querying change there?
When doing an itemnquery or itemquery it always fails in querying my postgis-Layers. This is my query:
mapserv.exe "QUERY_STRING=mode=itemnquery&schluesselgesamt='0335502400092'&qstring=hausnummer='5'&qlayer=alkisadresssuche&mapsize=1129+646&map=E:\tmp\tmp_alkis.map&"
I didn't use any FILTER in my layer but it seems that it therefore includes an empty filter which can be found in the Postgres-log:
syntax error at or near ")"
here is the sent query from Postgres-Log
select "schluesselgesamt","id","hausnummer",encode(ST_AsBinary(ST_Force2D("geom"),'NDR'),'hex') as geom,"id"
from (SELECT schluesselgesamt, id, geom geom FROM alkis.adresssuche ) as ergebnis where geom
&& ST_GeomFromText('POLYGON((593025 5891783,593025 5893724,595424 5893724,595424 5891783,593025 5891783))',25832)
and () and (schluesselgesamt='0335502400092')
It works with ONE query parameter but not with multiple parameters. I tried several different calls to mapserver and it works without EXPRESSION or FILTER or PROCESSING=NATIVE_FILTER.
This was the important part in the original query: :&qstring=schluesselgesamt='0335502400092'+AND+hausnummer='5'&
The Mapserver homepage just told me, that the FILTER has changed but not that it is now needed. Also is there no hint on the Mapserver EXPRESSION page on possible changes. The Mapserver7 changelog only gives some tickets about changes in query but they didn't help much (http://mapserver.org/development/changelog/changelog-7-0.html#changelog-7-0-0-beta2)
Does somebody has any hints for me in this case? Any not so well documented changes in Mapserver7?
By the way: here is my layer:
LAYER
CONNECTIONTYPE postgis
NAME "alkisadresssuche"
CONNECTION "user=***** dbname=local_database host=localhost password=****"
DATA "geom from (SELECT schluesselgesamt, id, hausnummer, geom FROM alkis.adresssuche
) as ergebnis using unique id USING srid=25832"
STATUS On
TYPE POLYGON
DEBUG On
HEADER "../templates/utf8/search_h.html"
TEMPLATE "../templates/utf8/search_q.html"
CLASS
NAME "Alkis-Adresssuche"
STYLE
WIDTH 5
OUTLINECOLOR 0 0 255
END
END
VALIDATION
"schluesselgesamt" "."
"hausnummer" "."
"qstring" "."
END
END