UniverseUniversity


Home Projects Jobs Clientele Contact

uu


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: umo_find with more then one language



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

Authoright © Total Knowledge: 2001-2008