I was actually thinking about this one for work last week. I had thought to
make a GeoTools search and function; and then adjust the sql encoder to encode
it if the textsearchable_index_col is a match. That is kind of where my
thinking stopped; figured I would talk to justin about it if I get paid.
An alternative is aaime's recent work allowing you to define your own SQL
"view".
I do not recommend extending filter or like filter (since it represents a
controlled data structure that must be emulated on WFS, SQL, shapefile etc...).
The filter data structure is however extendable in two ways:
- functions (you can define your own functions as above)
- property accessors (you can teach the filter to work on more kinds of content
then just features)
The interesting question for me is how the internals of the JDBC-NG datastore's
handle encoding a filter into SQL; and if there are any hooks already defined
which you can use to teach it how to handle specific functions.
There is a dialect object which contains all the database specific work in one
spot; when I last looked the code responsible for doing the SELECT statement
was duplicated a few times but that could be fixed to recognise a specific
"function encoding" opportunity.
Jody
On 27/07/2010, at 6:09 AM, Scott Pezanowski wrote:
> Hello,
>
> I have recently been made aware of efficient text searching in Postgresql by
> storing text in a tsvector column type and searching on this column with a
> sql query such as this:
>
> where textsearchable_index_col @@ to_tsquery('Haiti');
>
> My question is: Has anyone tried creating these types of sql queries with
> Geotools?
>
> My end goal is to use Geoserver to produce dynamic wms maps based upon
> records that match user entered search terms. I would like to do this on
> relatively longer text strings and large amounts of records. Therefore, I
> would like to avoid using "equals" and "like" queries of text strings.
>
> If no one has done this before, can you give me advice on how to implement
> this? I was advised that I could look at the gt2 jdbc packages and gt2
> postgis packages and either create a new filter or extend the "like" filter.
> Any other ideas?
>
> Thanks,
> Scott
>
>
> *********************************************
> Scott Pezanowski
> email: [email protected]
> *********************************************
>
>
> ------------------------------------------------------------------------------
> The Palm PDK Hot Apps Program offers developers who use the
> Plug-In Development Kit to bring their C/C++ apps to Palm for a share
> of $1 Million in cash or HP Products. Visit us here for more details:
> http://ad.doubleclick.net/clk;226879339;13503038;l?
> http://clk.atdmt.com/CRS/go/247765532/direct/01/_______________________________________________
> Geotools-gt2-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users