[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
Re: umo_find with more then one language
- To: uu@total-knowledge.com
- Subject: Re: umo_find with more then one language
- From: "Alexey Parshin" <alexeyp@gmail.com>
- Date: Sat, 3 Jan 2009 15:18:32 +1100
- Delivered-to: mailing list uu@total-knowledge.com
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type:references; bh=WdfDKYtUh0LlP6b3K9EYjIweftr/D+Lyoq7u0O/kI6w=; b=gSYADDV876jqZ2r/XOlIdlfyLhzfiMaoZva0H/7URfRDpXzmT4KCZBC5MNfI9iwYJj IpgF1PRAdgGx0nLWeYfAn8Wj6bIDD5JWQqT0UbaiKzHX6JDzmkrpCGB+RwSRugidMVZ3 ZxTuNPK3ufqEuHAtw+AL98s1DuO5P5pF8FMxI=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:references; b=oP1+MJYlcbAEY7Mz+QJ2auXezIs7pOM7+UJkw9f78apJ3Sl1yUOevWhMkWpnLgBH7K Bxlot+gbU5+rOKPA5fihHoQkuAIHUBILzp8/DbxaezOzA2LoW1bmc8u9p+YocAe3WE/e rqQQSOqKHemD/zH50Dnhv0pFvYZsRvoMG/6+U=
- In-reply-to: <495EE4F2.8010102@total-knowledge.com>
- Mailing-list: contact uu-help@total-knowledge.com; run by ezmlm
- References: <495EE4F2.8010102@total-knowledge.com>
Commit the test suite, and I'd fix the problem.
2009/1/3 Ilya A. Volynets-Evenbakh
<ilya@total-knowledge.com>
I tested searching for UMOs with more then one language
and it seems that if "All of selected" is used, there is
a problem.
I added following to the test suit:
Index: db/procs/umo_version.sql
===================================================================
--- db/procs/umo_version.sql (revision 343)
+++ db/procs/umo_version.sql (working copy)
@@ -1076,8 +1076,14 @@
RAISE NOTICE 'UMO (id=%) has % child UMOs', parent_umo_version_id,
counter;
SELECT COUNT(*) INTO counter FROM
umo_find('Test','Alexey','topic','English','2008-01-01',current_date::varchar,9999,NULL,200);
- RAISE NOTICE 'FOUND % UMOs matching the search criterias', counter;
+ RAISE NOTICE 'FOUND % UMOs matching the search criterias (English)',
counter;
+ SELECT COUNT(*) INTO counter FROM
umo_find('Test','Alexey','topic','English|French','2008-01-01',current_date::varchar,9999,NULL,200);
+ RAISE NOTICE 'FOUND % UMOs matching the search criterias (any of
English or French)', counter;
+
+ SELECT COUNT(*) INTO counter FROM
umo_find('Test','Alexey','topic','English&French','2008-01-01',current_date::varchar,9999,NULL,200);
+ RAISE NOTICE 'FOUND % UMOs matching the search criterias (both
English and French)', counter;
+
--PERFORM umo_delete_content(content_id);
-- Create new version of the umo_v1
And here is the output:
FOUND 4 UMOs matching th search criterias (English)
FOUND 6 UMOs matching the search criterias (any of English or French)
## ERROR: column reference "uc_keywords" is ambiguous
## LINE 1: ...pe ON uv_object_type = ot_id WHERE ot_is_umo AND
uc_keyword...
## ^
## QUERY: SELECT DISTINCT uv_id FROM umo_content uc JOIN umo_version ON
uc.uc_umo_version = uv_id JOIN language_list ll1 ON uc.uc_language =
ll1.ll_id AND uc.uc_language = 2 JOIN umo_content uc2 ON
uc2.uc_umo_version = uv_id JOIN language_list ll2 ON uc2.uc_language =
ll2.ll_id AND ll2.ll_id = 3 JOIN person_list ON uv_author = pl_id JOIN
object_type ON uv_object_type = ot_id WHERE ot_is_umo AND uc_keywords
@@ to_tsquery('Test') AND (pl_first_name || ' ' ||
pl_last_name)::tsvector @@ 'Alexey'::tsquery AND ot_name::tsvector @@
'topic'::tsquery AND uv_updated::date BETWEEN '2008-01-01' AND
'2009-01-03' LIMIT 9999
## CONTEXT: PL/pgSQL function "umo_find" line 15 at FOR over EXECUTE
statement
## SQL statement "SELECT COUNT(*) FROM
umo_find('Test','Alexey','topic','English&French','2008-01-01',current_date::varchar,9999,NULL,200)"
## PL/pgSQL function "umo_version_functions_test" line 45 at SQL statement
--------------------------------
Any suggestions?
Ilya.
P.S. if you don't mind, I'll commit the test suit adjustment.
--
Alexey Parshin,
http://www.sptk.net