Tsearch2 - Error using tsquery object in GROUP BBY queries

Started by Henrik Zagerholmover 19 years ago4 messagesgeneral
Jump to latest
#1Henrik Zagerholm
henke@mac.se

Hello list,

I've set up tsearch2 to handle full-text searches (obviously :)).

I have a problem I can't find a solution to and it feels its tsquery
objects fault.

The query I'm executing has a GROUP BY clause and because I'm using
the headline function I need my tsquery object in the SELECT clause
and therefor also in the GROUP BY clause.
BUT when executing the query I get the following error. -> "could not
identify an ordering operator for type tsquery"

How do I solve this?

Regards,
Henrik

#2Teodor Sigaev
teodor@sigaev.ru
In reply to: Henrik Zagerholm (#1)
Re: Tsearch2 - Error using tsquery object in GROUP BBY

The query I'm executing has a GROUP BY clause and because I'm using the
headline function I need my tsquery object in the SELECT clause and
therefor also in the GROUP BY clause.
BUT when executing the query I get the following error. -> "could not
identify an ordering operator for type tsquery"

Which version do you use? Only 8.2 will have comparison operator for tsquery.

How do I solve this?

Use subselect:
SELECT *, headline(..., to_tsquery()) FROM
{
SELECT .... GROUP BY ...
);

BTW, for performance reason, it might be useful to use limit in inner select -
headline function is slow enough.

--
Teodor Sigaev E-mail: teodor@sigaev.ru
WWW: http://www.sigaev.ru/

#3Henrik Zagerholm
henke@mac.se
In reply to: Teodor Sigaev (#2)
Re: Tsearch2 - Error using tsquery object in GROUP BBY

1 dec 2006 kl. 09:56 skrev Teodor Sigaev:

The query I'm executing has a GROUP BY clause and because I'm
using the headline function I need my tsquery object in the SELECT
clause and therefor also in the GROUP BY clause.
BUT when executing the query I get the following error. -> "could
not identify an ordering operator for type tsquery"

Which version do you use? Only 8.2 will have comparison operator
for tsquery.

I'm using 8.1.4 at the moment but I guess I need to update. The 8.2
is looking really promising. So with 8.2 I don't need the subselect?

How do I solve this?

Use subselect:
SELECT *, headline(..., to_tsquery()) FROM
{
SELECT .... GROUP BY ...
);

Thanks I'll try it.

BTW, for performance reason, it might be useful to use limit in
inner select -
headline function is slow enough.

You think?! ;)
Thanks again for your quick reply.
Cheers, Henrik

Show quoted text

--
Teodor Sigaev E-mail:
teodor@sigaev.ru
WWW: http://
www.sigaev.ru/

---------------------------(end of
broadcast)---------------------------
TIP 6: explain analyze is your friend

#4Teodor Sigaev
teodor@sigaev.ru
In reply to: Henrik Zagerholm (#3)
Re: Tsearch2 - Error using tsquery object in GROUP BBY

I'm using 8.1.4 at the moment but I guess I need to update. The 8.2 is
looking really promising. So with 8.2 I don't need the subselect?

IMHO, don't need

headline function is slow enough.

You think?! ;)

I known :) - computing headline is a hard task
--
Teodor Sigaev E-mail: teodor@sigaev.ru
WWW: http://www.sigaev.ru/