Mapscript: can't use @@ operator for querying postgis layer
Swapnil Hajare
dreamil at GMAIL.COM
Tue Feb 27 03:29:38 PST 2007
Steve,
I wrote such program and added a filter to it and then wrote back the
mapfile. It doesnt add any extra escape chars or anything like that. Another
point which I forgot to mention is that the datatype of this
name_hutment_dweller_souindics column is tsvector
Due to this, the mapserver complains that it cannot cast a tsvector to
text. Does this mean that mapserver casts query field to text and then does
query?
bye
On 2/26/07, Steve Lime <Steve.Lime at dnr.state.mn.us> wrote:
>
> 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
>
--
Swapnil Hajare
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20070227/04e04817/attachment.htm>
More information about the MapServer-users
mailing list