Menu

intranet-search and XoWiki problem

Domagoj
2012-04-24
2012-11-13
  • Domagoj

    Domagoj - 2012-04-24

    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

     
  • Domagoj

    Domagoj - 2012-04-24

    Addition: Still crashes if page have more revisions. So we have to see what is live revision (published)
    Query now looks like this:

                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 and
                    i.live_revision = d.revision_id
    

    Regards,
    Domagoj

     
  • Frank Bergmann

    Frank Bergmann - 2012-04-25

    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

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.