------=_Part_89_6084440.1209660673308
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
I found a way to do this but I don't know if there is a better way.
What I did was to create a separate index on each table and construct a
query like:
SELECT * FROM a WHERE (to_tsvector(...) @[EMAIL PROTECTED]
to_tsquery(...)) OR primaryKey
IN
(SELECT distinct(foreign_key) FROM b WHERE to_tsvector(...) @[EMAIL PROTECTED]
(...))
Is there a better way to do this?
Thanks,
-Mont
On Thu, May 1, 2008 at 8:48 AM, Mont Rothstein <mont.rothstein@[EMAIL PROTECTED]
>
wrote:
> Is it possible to perform a text search with tables A-->>B returning A
for
> matches in B?
> What I want to do is to be able take columns from both A and B and
perform
> a search based on the keywords entered by the user that matches A, B, or
> both but always returns A.
>
> Can this be done?
>
> Thanks,
> -Mont
>
>
------=_Part_89_6084440.1209660673308
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
I found a way to do this but I don't know if there is a better
way.<div><br></div><div>What I did was to create a separate index on each
table and construct a query like:</div><div><br></div><div>SELECT * FROM a
WHERE (to_tsvector(...) @[EMAIL PROTECTED]
to_tsquery(...)) OR primaryKey IN (SELECT
distinct(foreign_key) FROM b WHERE to_tsvector(...) @[EMAIL PROTECTED]
(...))</div>
<div><br></div><div>Is there a better way to do
this?</div><div><br></div><div>Thanks,</div><div>-Mont</div><div><br><br><div
class="gmail_quote">On Thu, May 1, 2008 at 8:48 AM, Mont Rothstein <<a
href="mailto:mont.rothstein@[EMAIL PROTECTED]
">mont.rothstein@[EMAIL PROTECTED]
>>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px
#ccc solid;padding-left:1ex;">Is it possible to perform a text search with
tables A-->>B returning A for matches in B?<div><br></div><div>What I
want to do is to be able take columns from both A and B and perform a
search based on the keywords entered by the user that matches A, B, or
both but always returns A.</div>
<div><br></div><div>Can this be
done?</div><div><br></div><div>Thanks,</div><div>-Mont</div><font
color="#888888"><div><br></div>
</font></blockquote></div><br></div>
------=_Part_89_6084440.1209660673308--


|