Uli and Simon,<div><br></div><div>Thank you very much for your quick response.</div><div>I agree in not searching table by table, and merging the results.</div><div>I will store the Full Text ts_vector data into one common table. I guess I will use the TableOID + GID to know excatly where the indexed data came from. </div>
<div><br></div><div>Thanks again to both of you !</div><div><br></div><div><br></div><div>Ricardo</div><div><br><div class="gmail_quote">On Wed, Aug 4, 2010 at 5:55 AM, uli mueller <span dir="ltr"><<a href="mailto:uli.mueller@gmx.ch">uli.mueller@gmx.ch</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Ricardo,<br>
<br>
Clearly, if you want to search across different tables you need a way to<br>
combine data in a common place. You should not do anything like search<br>
the tables one after the other and combine the results.<br>
<br>
Even if you merge all tables into one, you will need some explicit<br>
mechanism (trigger!) to keep your tsvector up to date.<br>
<br>
Using inheritance? I would not see inheritance as a real goodie with<br>
PostgreSQL. There are some serious caveats that may cause more problems<br>
than inheritance can solve. Check the last paragraph in the docs on<br>
inheritance<br>
(<a href="http://www.postgresql.org/docs/8.4/interactive/ddl-inherit.html" target="_blank">http://www.postgresql.org/docs/8.4/interactive/ddl-inherit.html</a>).<br>
<br>
A system using triggers to build the tsvector is not so hard to<br>
maintain. Once you have written the triggers it simply runs and runs.<br>
Any time data in any relevant table changes, a trigger updates the<br>
tsvector, some key (gid or whatever) and maybe other data like bounding<br>
boxes in the one and only table that will be searched. Some challenge<br>
could arise, if it takes too long to rebuild your index on the tsvector.<br>
But normally this is not critical.<br>
<br>
We use the trigger approach for our search engine on<br>
<a href="http://mapmatters.org" target="_blank">http://mapmatters.org</a> . The hardest thing there was and still is to<br>
optimize the way how data are combined and weighted for the tsvector (<br>
so how you feed the "to_tsvector" function).<br>
<br>
Uli<br>
<br>
<br>
Am 04.08.2010 00:33, schrieb Ricardo Bayley:<br>
<div><div></div><div class="h5">> Hi fellows,<br>
><br>
> I am creating a search engine for my spatial data.<br>
> And I am thinking of the best approach.<br>
><br>
> My idea is to have a full text search (tsvector) coulmn for every table.<br>
> Instead of performing a search on every table, I have thought of a few<br>
> options<br>
><br>
> 1. "Merge" all tables into one, regardless of their geometry type.<br>
> 2. Use PostgreSQL goodies such as table Inheritance to split geometry<br>
> types. (not sure if it would be of any good)<br>
> 3. Create a table to store table oid, gid and full text search data of<br>
> every table in my system, and query this table instead. This should be<br>
> harder to maintain, since it should be done through triggers and rules.<br>
><br>
> Hope I explained it clearly.<br>
><br>
> By the way, at start I only have 20 tables, with not more than 500k rows<br>
> total. So it is not much, but this should grow considerably.<br>
><br>
><br>
> Do you guys have any thoughts on this ?<br>
><br>
><br>
> Looking foward to hearing from you.<br>
><br>
><br>
> Ricardo<br>
><br>
><br>
><br>
</div></div><div class="im">> _______________________________________________<br>
> postgis-users mailing list<br>
> <a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>
> <a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
<br>
<br>
</div><font color="#888888">--<br>
geOps GeoInformatics<br>
<a href="http://www.geOps.de" target="_blank">www.geOps.de</a><br>
D-79098 Freiburg<br>
</font><div><div></div><div class="h5"><br>
<br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
</div></div></blockquote></div><br></div>