Pagetree Search Plugin

Name Pagetree Search Plugin
Vendor Shannon Krebs
Authors Shannon Krebs
Homepage http://confluence.atlassian.com/display/CONFEXT/Pagetree+Search+Plugin
Issue Management http://developer.atlassian.com
Categories Extractor Plugins
Version 1.3.2
Availability Confluence v2.7 to v2.9-m5
State Stable
Support Unsupported Plugins
License Freeware / Open Source (BSD)
Price Free
Release Docs http://confluence.atlassian.com/display/CONFEXT/Pagetree+Search+Plugin
Java API Docs n/a
Download Source http://svn.atlassian.com/svn/public/contrib/confluence/pagetreesearch-plugin/tags/1.3.2
Download JAR pagetreesearch-1.3.2.jar

Description/Features

This plugin provides functionality to search a hierarchal page tree within a space. It contains an extractor to add the hierarchy information to the confluence index as well as a macro for searching using the new field.

This plugin goes some of the way to addressing the following issues:

CONF-986
CONF-5135
CONF-5114

Usage

Once you install the plugin you will need to reindex your confluence instance so the new ancestorIds field is added to the confluence lucene index.

Pagetree Search Macro

The pagetree search macro contains a search box that you can put in any page to allow searching within a page tree. If no parameters are specified the current page will be used as the page tree root. If you want to specify another page as the root of the hierarchy this can be done by specifying the page as the first parameter. (Alternatively you can use the named rootPage parameter.)

examples

{pagetreesearch}
Searches the page hierarchy from the current page.

{pagetreesearch:Your page name}
{pagetreesearch:rootPage=Your Page Name}
Searches the page hierarchy from the page called "Your page name" in the current space.

{pagetreesearch:ds:}
Searches the space with the key "ds".

{pagetreesearch:rootPage=ds:pageName}
Searches the page hierarchy from the page called "pageName" in the "ds" space.

Manual Searching

If you want to manually search a page tree hierachy from the confluence search screen you need to know the pageId for the root page of the hierachy. Each page will now have a field called ancestorIds which contain the pageIds of itself plus all of its ancestors. To search this field your search string will need to look something like this:

ancestorIds:12345 AND <searchTerm>

Plugin Versions

Version Date State License Price
Show description 1.3.2 (#8) 04 Jun 2008 Stable Freeware / Open Source (BSD) Free

Release Notes

This plugin provides functionality to search a hierarchical page tree within a space. It contains an extractor to add the hierarchy information to the Confluence index as well as a macro for searching using the new field.

The 1.3.2 release is a minor bug fix release to stop the macro form and hidden fields being rendered in preview mode. This prevents these fields conflicting with other fields that are present in the normal edit form.

Contributors

  • Shannon Krebs — Developer

Show description 1.3 (#6) 06 May 2008 Stable Freeware / Open Source (BSD) Free

Release Notes

This plugin provides functionality to search a hierarchical page tree within a space. It contains an extractor to add the hierarchy information to the Confluence index as well as a macro for searching using the new field.

The 1.3 release adds the page ancestor search field to attachments (attached to pages) and also fixes some internationalisation issues.

Contributors

  • Shannon Krebs — Developer

Show description 1.2 (#5) 13 Jan 2008 Stable Freeware / Open Source (BSD) Free

Release Notes

This plugin provides functionality to search a hierarchical page tree within a space. It contains an extractor to add the hierarchy information to the Confluence index as well as a macro for searching using the new field.

The 1.2 release contains a slight change to the extractor implementation to make it compatible with Confluence 2.7. This release will not work on previous Confluence versions.

Contributors

  • Shannon Krebs — Developer

Show description 1.1.1 (#4) 03 Dec 2007 Stable Freeware / Open Source (BSD) Free

Release Notes

This plugin provides functionality to search a hierarchical page tree within a space. It contains an extractor to add the hierarchy information to the confluence index as well as a macro for searching using the new field.

The 1.1.1 release is a bug fix release to add the base url to the front of the search form link for Confluence installs that aren't hosted as the root application.

Contributors

  • Shannon Krebs — Developer

Show description 1.1 (#3) 06 Sep 2007 Stable Freeware / Open Source (BSD) Free

Release Notes

This plugin provides functionality to search a hierarchical page tree within a space. It contains an extractor to add the hierarchy information to the confluence index as well as a macro for searching using the new field. The 1.1 release is a minor feature release to disable the search button in preview mode, and to add the space key to the search, so you can just search within a space without specifying a parent page.

Contributors

  • Shannon Krebs — Developer

Show description 1.0 (#2) 06 May 2007 Stable Freeware / Open Source (BSD) Free

Release Notes

This plugin provides functionality to search a hierarchical page tree within a space. It contains an extractor to add the hierarchy information to the confluence index as well as a macro for searching using the new field.

Contributors

  • Shannon Krebs — Developer

Screenshots

Labels

codegeist_2007_confluence codegeist_2007_confluence Delete
search search Delete
hierarchy hierarchy Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Jul 05, 2007

    James Mortimer says:

    tidy little macro. nice. should be part of the UI already. on conf. 2.3.3., fu...

    tidy little macro. nice. should be part of the UI already.

    • on conf. 2.3.3., full site search reindexing failed at 99% (Closing Index) step. Will re-attempt with and without this plugin installed.
    • otherwise, seemed to work well for newly indexed individual pages prior to full reindex.
    • feature request: allow the syntax {pagetreesearch:ds:}, for example, to search the entire ds: space. In this way, this macro can completely replace the built in 'searchbox' and simplify things for users.
    • feature request: display a message 'PageTreeSearch cannot display in preview mode', or a static, non-form view, instead of completely blocking the 'preview' view as it does now. (any macros that use a form seem to show a 'blank' preview panel in page edit mode, not just this one)
    1. Aug 28, 2007

      Shannon Krebs says:

      Hi James, (apologies for the slow response, I only just saw your comment, must o...

      Hi James, (apologies for the slow response, I only just saw your comment, must of forgot to watch this page...)

      I agree, it would be better if this functionality was bundled with confluence. I would like to see this integrated with the livesearch macro also, but that macro is not released under an opensource license, so Atlassian would have to insource it.

      Have you had any other indexing problems?

      • seach entire space feature request: thats doable, haven't got time right now though...
      • display search form feature request: I'm testing on 2.5.4 atm, they must have changed the way the renderer works in preview mode. In 2.5.4 the renderer seems to display the form input elements but strips out the surrounding form tag, so the search input box and submit button are actually displayed. (Unfortunately since the submit button is now part of the page form, it submits the page.) I've checked in a minor change so the the submit button is disabled in preview mode and if there are any errors. Will role that up into a release at some point.
      1. Sep 06, 2007

        Shannon Krebs says:

        The 1.1 release now lets you just specify a space if you want.

        The 1.1 release now lets you just specify a space if you want.

  2. Sep 23, 2007

    Paul Curren says:

    Hi there. I don't think you have created the 1.1 tag in source control yet.

    Hi there.

    I don't think you have created the 1.1 tag in source control yet.

  3. Oct 24, 2007

    Andy Brook says:

    I just tried this plugin in my home space, when it executes it seems to want to ...

    I just tried this plugin in my home space, when it executes it seems to want to find /plugins (eg http://host/plugins/pagetreesearch/pagetreesearch.action) and doesn't notice Ive deployed to a sub-context ( eg, http://host/context/plugins/...) and so breaks with a 404.  There isn't any configuration available, so I'm guessing this is a bug?

  4. Nov 27, 2007

    Cathy Ran says:

    We are having a similar problem with the pagetreesearch macro 404 error&nbsp;&nb...

    We are having a similar problem with the pagetreesearch macro - 404 error  

    "The requested resource (/plugins/pagetreesearch/pagetreesearch.action) is not available."

    The plugin appears to only work if Confluence is not accessed with a context path. The Confluence instance we have has [http://abc.company.com/confluence/. ]; The searching process would redirect to an invalid link: http://abc.company.com/plugins/pagetreesearch/pagetreesearch.actionNote that the contextPath "confluence" is gone. Please advise a workaround.

    1. Dec 02, 2007

      Shannon Krebs says:

      Yes, this does appear to be a bug, the base url needs to be added in the search....

      Yes, this does appear to be a bug, the base url needs to be added in the search.vm template.

      1. Dec 03, 2007

        Shannon Krebs says:

        The 1.1.1 version should hopefully fix this bug.

        The 1.1.1 version should hopefully fix this bug.

  5. Jan 07, 2008

    Bob Swift says:

    Copied from comment on wrong page

    Copied from comment on wrong page
    Does this work on 2.7? It seems to be displaying properly, but, when re-indexed my site, there were some pagetree errors in the log.

    Plugin module com.atlassian.confluence.plugins.pagetreesearch:PageHierarchyExtractor is incompatible with this version of Confluence. You will need to upgrade to a newer version of the Pagetree Search plugin. java.lang.NoSuchMethodError: org.apache.lucene.document.Field.Text(Ljava/lang/String;Ljava/lang/String;)Lorg/apache/lucene/document/Field;
    

    What does such an error affect?

    1. Jan 07, 2008

      Shannon Krebs says:

      The extractor part of the plugin is not adding its information to the lucene ind...

      The extractor part of the plugin is not adding its information to the lucene index correctly for the new version, thus although the macro will display properly there will be no hierarchical data in the index to search with.

      1. Jan 13, 2008

        Shannon Krebs says:

        The 1.2 release in the plugin repository now should work with Confluence 2.7. Pr...

        The 1.2 release in the plugin repository now should work with Confluence 2.7. Previous versions of Confluence will need to use the 1.1.1 version of the plugin.

  6. Feb 03

    Alexander Jang says:

    Nice macro, exactly what we are looking for.\\ One question though: the search d...

    Nice macro, exactly what we are looking for.

    One question though: the search doesn't seem to include attachments, but only pages. Is this a known limitation? The normal search searches in the attachments too.

    1. Feb 03

      Shannon Krebs says:

      good point, something to add to the to do list.

      good point, something to add to the to do list.

      1. Mar 19

        Neil Arrowsmith says:

        Big 1 from me on searching attachments. I thought this plugin was going to solve...

        Big +1 from me on searching attachments. I thought this plugin was going to solve a big problem for me (allowing a limited search to a load of word documents attached to a single page within a larger space), but sadly not.

        1. May 06

          Shannon Krebs says:

          Version 1.3 of the plugin adds this functionality. Attachments will now have the...

          Version 1.3 of the plugin adds this functionality. Attachments will now have the same ancestorIds field added to their lucene index entry if they are attached to a normal page (not a blogpost).

  7. Feb 06

    Denis Motorniy says:

    Hi, Shannon Found a limitation wich makes it not possible for us to use this mac...

    Hi, Shannon
    Found a limitation wich makes it not possible for us to use this macro.
    It does not search in russian.
    The normal search fine searches in russian.

    For example, page containing pagetree macro:
    http://confluence.atlassian.com/display/CHEESE/Home

    And child page containing word in russian (Сырный тест):
    http://confluence.atlassian.com/display/CHEESE/CheeseTest

    Search for Сырный at pagetree macro is void.
    While, global search works fine.

    Is it possible to fix it?

    Thanks a lot anyway!

    PS Сырный тест means Cheese test

    1. Feb 08

      Shannon Krebs says:

      Hurrm, looks like the urls were not getting encoded properly. I have uploaded th...

      Hurrm, looks like the urls were not getting encoded properly. I have uploaded the pagetreesearch-1.3-SNAPSHOT.jar version as an attachment to this page, please let me know if this release fixes the issues for you.

  8. Feb 20

    Kay Lefevre says:

    FYI, we've just upgraded to 2.7.1 and&nbsp;pagetreesearch stopped working looked...

    FYI, we've just upgraded to 2.7.1 and pagetreesearch stopped working - looked like probs with indexes so I reindexed the content - still not working. I upgraded to 1.2 and it's fine now.

  9. Feb 24

    Neeraj Jhanji says:

    Hello, Thanks for a useful plugin. But pagetree search does not work for Japane...

    Hello,

    Thanks for a useful plugin. But pagetree search does not work for Japanese characters -
    in other words, if you enter Japanese text in the search box, no results are returned.

    Could you kindly fix this in the next release of the plugin?

    regards,

    Neeraj

    1. Feb 24

      Shannon Krebs says:

      Can you give the 1.3SNAPSHOT version of the plugin (see comment above) a go, thi...

      Can you give the 1.3-SNAPSHOT version of the plugin (see comment above) a go, this should fix issues with the encoding of chracters.

  10. Apr 14

    Bruno Duarte says:

    First things first. Thanks for a the plugin. :) We found an issue. If we create...

    First things first. Thanks for a the plugin.

    We found an issue. If we create a space template with the pagetreesearch macro and a template variable, confluence tries to create the page in an undefined space. We didn't find any solution yet!

    Anyone knows if it's a problem of the plugin or of confluence (we are using 2.6.2)??

    1. May 07

      Shannon Krebs says:

      I can reproduce the problem in Confluence 2.8. Not sure what the fix is though, ...

      I can reproduce the problem in Confluence 2.8. Not sure what the fix is though, it doesn't appear as though the template input screen has its own render output type (like exports do), so there is no way for the macro to know what it should or shouldn't in this case be displaying.

  11. May 28

    David Matsumoto says:

    This macro works very well for us in our environment, the only issue is that whe...

    This macro works very well for us in our environment, the only issue is that when we try to preview a page which uses this macro we get an error and the preview effectively fails.  Is there a way to resolve this, i.e. like the rate macro which displays a message or maybe some other solution, so that the preview will work correctly?  We are currently using Confluence 2.7.3 if that matters.

    1. May 28

      Shannon Krebs says:

      from a quick look at the code, the macro should appear in the preview mode with ...

      from a quick look at the code, the macro should appear in the preview mode with the search button disabled. (I haven't actually tried this in 2.7.3 though). Can you provide some more details about the error you are seeing, does it just mess up the preview page, or do you get an exception ?

      1. May 28

        David Matsumoto says:

        Just double checked a couple of things. We are using version 2.7 not 2.7.3 as I ...

        Just double checked a couple of things. We are using version 2.7 not 2.7.3 as I had thought. The exact error message is "Error:Unknown runtime error" which pops up in a warning dialog. I'm not getting the normal stack dump I get when an exception does occur. The preview page will simply display the Comment, Restrictions, and Labels items with no content displayed after you select ok on the dialog.

        We are currently using version 1.2, it didn't appear from the release note that 1.3's change would be directly related.

        Thank you for the quick response 

        1. Jun 02

          David Matsumoto says:

          In separate testing, I was able to verify that the page tree search macro will d...

          In separate testing, I was able to verify that the page tree search macro will disable the search button under other circumstances such as print preview or the export space functionality.

          Still not working in the preview step though, any other recommendations on what we may try or additional information required?

          1. Jun 04

            Shannon Krebs says:

            I haven't been able to reproduce your specific problem, however I did find a pro...

            I haven't been able to reproduce your specific problem, however I did find a problem with the page tree search and the preview screen where the macro hidden fields were overwriting the hidden fields in the edit form such as spaceKey.

            I have created a new minor release (1.3.2) with an update that doesn't render search form and its hidden fields in preview mode, but does render the input fields so the user will know what they look like.

            What browser are you seeing the error in? I have (briefly) tested this new version with firefox and IE7 here. If there is still problems we can change the macro to just output a static message in preview mode like {livesearch} does, but from a users point of view I think it would be better to give some indication of what the normal display will look like in preview mode, if possible.

            1. Jun 04

              David Matsumoto says:

              We'll try your new version and provide feedback on how it goes. Actually I beli...

              We'll try your new version and provide feedback on how it goes.

              Actually I believe you found the crux of the issue, I didn't think of testing it with FireFox and it works fine there. IE6 is the standard here and that appears to be the issue, it would appear that is the overall cause, but I'm unsure what exactly is incompatible.

              Thanks again for the support

              1. Jun 04

                David Matsumoto says:

                Version 1.3.2 resolved the issue, preview now works as expected in IE6. Thank yo...

                Version 1.3.2 resolved the issue, preview now works as expected in IE6. Thank you very much for resolving this issue.