Mapscript: can't use @@ operator for querying postgis layer

Steve Lime Steve.Lime at DNR.STATE.MN.US
Mon Feb 26 12:12:21 EST 2007


There could be some string escaping going on in php or MapServer itself
perhaps?
If you could try one more thing it might help debug.

In PHP write a quick script that does this:

- open the mapfile
- open the layer
- use the layer setFilter method to set it to
"name_hutment_dweller_souindics @@ '(GPN)|(TKRM)'::tsquery"
- save the mapfile

What does the saved FILTER string look like?

Steve

>>> Swapnil Hajare <dreamil at GMAIL.COM> 2/26/2007 2:24:16 AM >>>
Steve,
  I added a filer like this in my mapfile
       FILTER "name_hutment_dweller_souindics @@
'(GPN)|(TKRM)'::tsquery"
  and I generated png from mapfile using shp2img. I can see matching
polygins displayed in the image, That means postGIS is processing the
query
correctly. Is it the queryByAttributes which is making mistake then?


regards,

On 2/18/07, Steve Lime <Steve.Lime at dnr.state.mn.us> wrote:
>
> MapServer or MapScript passes the query string directly on to the
> PostGIS driver so
> it's likely there the problem lies (if there is one). What happens
if
> you set a FILTER
> in the map file using that operator and use shp2img? That might help
in
> debugging
> this since queryByAttributes simply resets the layer filter
temporarily.
>
> Steve
>
> >>> Swapnil Hajare <dreamil at GMAIL.COM> 02/16/07 10:14 PM >>>
> Hi list,
>   first greetings to the list.
>   I am using mapserver 4.8.3 (ubuntu edgy package) with
postgis-pgsql
> 8.1
> and php5-mapscript.
>   I am trying to implement full text search engine for Marathi-
> Devanagari
> text (mr_IN) using tsearch2 extension of pgsql. In my map, I am
> providing a
> search interface (which is based on kamap & mapscript), to type text
in
> Marathi and search it in my postgis layer.  For string comparison in
> queryByAttributes, I get results when I use ~* operator. But I don't
get
> any
> results when I try to use @@ operator. is it that this operator is
not
> supported by mapscript? I thought anything supported by pgsql, should
be
> available in mapscript also. Please guide me on this.
>
> regards,
>
>
> --
> Swapnil Hajare
>
>


-- 
Swapnil Hajare



More information about the mapserver-users mailing list