[Qgis-user] QGIS Webclient PostgreSQL search table
Dennis Ströer
dennis.stroeer at geosysnet.de
Mon Jun 25 05:30:27 PDT 2012
Am 25.06.2012 14:09, schrieb Bernhard Ströbl:
> Hi Dennis,
>
> please try to execute SELECT to_tsvector('bla') in a SQL shell.
> What happens?
> Your error message indicates you call the funtion without an argument.
> Maybe you should read the doc on the Full text Search
> http://www.postgresql.org/docs/8.4/static/textsearch.html
> and/or the tsvector data type
> http://www.postgresql.org/docs/8.4/static/datatype-textsearch.html
>
> Bernhard
>
> Am 25.06.2012 13:11, schrieb Dennis Ströer:
>> Hello everybody,
>>
>> I'm testing the QGIS webclient in the moment. Thanks for developing such
>> a great project! Its a nice tool and the default settings and
>> functionality works fine. Now I'm trying to realize the search with wsgi
>> and a PostgreSQL table setup for searching like explained in the
>> chapters 6 and 7 of the installation guide.
>> I created a searchtable and now I want to fill it with some test data,
>> but a problem appears. When I want to fill the field
>> searchstring_tsvector with the value to_tsvector() I'm getting the
>> following error:
>>
>> ERROR: function to_tsvector() does not exist
>>
>> I'm using PostgreSQL 8.4, so I think the tsearch package is already
>> included?! And when I add a new column to a table I can select the data
>> type tsvector...
>>
>> Do I have to create the function to_tsvector by hand?
>>
>> Does anybody know a solution for this error?
>>
>> Cheers,
>> D. Stroeer
>> _______________________________________________
>> Qgis-user mailing list
>> Qgis-user at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/qgis-user
>>
>>
>
>
>
>
> ________ Information from NOD32 ________
> This message was checked by NOD32 Antivirus System for Linux Mail Server.
> http://www.nod32.com
Hey guys,
thanks for the quick response!
Like Andreas told me, I executed the tsearch2.sql script which installed
the data types and function. If I execute SELECT to_tsvector('bla') it
returns 'bla' :1, so I think it works fine.
But if I try to fill the searchtable, the same error message appears:
ERROR: function to_tsvector() does not exist
Like Bernhard mentioned, it seems that I call the funtion without an
argument. But when I look at the example in the installation guide on
page 16, it seems to me, that I have to:
CREATE TABLE public.searchtable
(
searchstring text, --the search string (all lower case), e.g. "z~ 1
richstrasse 46, 8610 uster"
displaytext text NOT NULL, --the display text for the search combobox,
e.g. "Z~ 1 richstrasse 46, 8610 Uster (address
search_category text, --should have a leading two digit number:, e.g.
--"03_parcels", where 03 is the order of the search categories, the number
--should be unique across all search tables
the_geom geometry,
--the actual geometry
geometry_type text,
--the geometry type as returned by ST_GeometryType(the_geom)
searchstring_tsvector tsvector, *-- be sure to fill this with to_tsvector()*
CONSTRAINT searchtable_pkey PRIMARY KEY (displaytext)
)
WITH (
OIDS=FALSE
);
Cheers,
D. Stroeer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20120625/9c0454ce/attachment.html>
More information about the Qgis-user
mailing list