Hi
Just wanted to share solution
I have 3 different instances of XoWiki. One is for my employees (internal), one is for distributors, and third for end-users.
When I created and published page in one instance, search crashed with "query returns more than one row".
I found sql in packages/intranet-search-pg/www/search.tcl with following text:
"::xowiki::Page" {
set page_name ""
set package_mount ""
db_0or1row page_info "
select s.name as package_mount,
i.name as page_name
from cr_items i,
apm_packages p,
site_nodes s, xowiki_pagex d
where i.item_id = :object_id and
p.package_id = s.object_id and
p.package_key = 'xowiki'
Just for info, there is only one record in cr_items for miro_mirkovic. In query above, there is no relation between cr_items and package_id and instance_id. So I used view xowiki_pagex to connect it to cr_items and updated sql to:
"::xowiki::Page" {
set page_name ""
set package_mount ""
db_0or1row page_info "
select s.name as package_mount,
i.name as page_name
from cr_items i,
apm_packages p,
site_nodes s, xowiki_pagex d
where i.item_id = :object_id and
p.package_id = s.object_id and
p.package_key = 'xowiki' and
p.package_id = d.object_package_id and
i.item_id=d.item_id
If there is better way of solving the problem, let me know. I also think that search should support multiple instances of xowiki.
]po[ version is 4.0.3 (latest)
Regards,
Domagoj
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi
Just wanted to share solution
I have 3 different instances of XoWiki. One is for my employees (internal), one is for distributors, and third for end-users.
When I created and published page in one instance, search crashed with "query returns more than one row".
I found sql in packages/intranet-search-pg/www/search.tcl with following text:
"::xowiki::Page" {
set page_name ""
set package_mount ""
db_0or1row page_info "
select s.name as package_mount,
i.name as page_name
from cr_items i,
apm_packages p,
site_nodes s, xowiki_pagex d
where i.item_id = :object_id and
p.package_id = s.object_id and
p.package_key = 'xowiki'
this query returned :
+----------+------------+
| package_mount | page_name |
+----------+------------+
| publicwiki | hr:miro_mirkovic |
| partnerwiki | hr:miro_mirkovic |
| internalwiki | hr:miro_mirkovic |
+----------+------------+
Just for info, there is only one record in cr_items for miro_mirkovic. In query above, there is no relation between cr_items and package_id and instance_id. So I used view xowiki_pagex to connect it to cr_items and updated sql to:
"::xowiki::Page" {
set page_name ""
set package_mount ""
db_0or1row page_info "
select s.name as package_mount,
i.name as page_name
from cr_items i,
apm_packages p,
site_nodes s, xowiki_pagex d
where i.item_id = :object_id and
p.package_id = s.object_id and
p.package_key = 'xowiki' and
p.package_id = d.object_package_id and
i.item_id=d.item_id
If there is better way of solving the problem, let me know. I also think that search should support multiple instances of xowiki.
]po[ version is 4.0.3 (latest)
Regards,
Domagoj
Addition: Still crashes if page have more revisions. So we have to see what is live revision (published)
Query now looks like this:
Regards,
Domagoj
Hi Vizura,
Thanks a lot for the patch. I've just included your code in CVS. Check the "project-open-development" mailing list for details :-)
Cheers,
Frank