Search the Confluence 4.1.x Documentation:

Index
Downloads (PDF, HTML & XML formats)
Other versions

This documentation relates to Confluence 4.1.x
If you are using an earlier version, please view the previous versions of the Confluence documentation and select the relevant version.
Skip to end of metadata
Go to start of metadata

 

The Livesearch macro allows you to add a search box to a Confluence page. When users enter a search term into the search box, Confluence will dynamically display matching results as they type.

Using the Livesearch Macro

To add the Livesearch macro to a page:

  1. In the Confluence editor, choose Insert > Other Macros.
  2. Find and select the required macro.

Parameters

When editing, you can click on the macro placeholder and choose Edit to display the parameters for this macro in the Macro Browser.

Parameters are options that you can set for Confluence macros to control the content or format of the macro output. The table below lists parameters for this macro that can be set in the Macro Browser.

Parameter

Default

Description

ID

none

Uniquely identifies the Livesearch when there are multiple Livesearch macros in one page.

Restrict to this Space Key

all spaces

Specify a space key to limit the search to the given space. Case-sensitive.

Related Topics

Searching Confluence
Search Results Macro
Working with Macros

Take me back to the Confluence User's Guide.

  1. Jul 16, 2008

    Am trying to use this in velocity template with 

    Does not seem to work?

    1. Jul 22, 2008

      Hi Mark,

      The spacekey with the "@self" parameter doesn't supported in LiveSearch macro. It has to be with the space key in Confluence. However, if you are keen to have this feature to be implemented in the future macro version, you can always raise a feature request at https://jira.atlassian.com.

      Regards,
      MG

        1. Oct 01, 2010

          That comment was from me; sorry.

  2. Jul 30, 2008

    I love this macro! It's so helpful, and we've now just begun to use it in customized left nav's, which can be really helpful to the space.

    We're encountering some problems with the drop-down list of candidate terms that appears when searching using this utility. For example, in a given wiki space:

    • searching "cache" yields nothing in the drop down (even there are multiple pages with this word in the title)
    • searching for "documents" = nothing in drop down (at least one page with term in title)
    • searhing "document" = extensive drop-down list (including the page with 'documents' in title)

    Performing the search (eg clicking 'Go') yields in appropriate search results for each of the above examples. It's only the drop-down list that isn't consistently functioning.

    The problem is also happening in at least one other space in our instance of Confluence. In both cases, livesearch is inside a table as follows:

    || Search || Browse || Projects ||
    | Search this wiki {livesearch:id=1|spaceKey=gregwikiprod} |

    Any tips?

    Margaret Ostrander

    1. Jul 31, 2008

      Hi Margaret,

      To enable us to investigate this issue further, I would suggest you to raise a support request in our Support Channel regarding this issue:

      Please also provide us with the following information on the support request created as they may be helpful in our investigation:

      1. A screenshot illustrating the Live Search Macros available in the Administration > Plugins page
      2. A HTML of the System Information page

      Cheers,
      Tony

      1. Aug 01, 2008

        Anonymous

        Thanks Tony!

        - Margaret

  3. Feb 23, 2009

    Is there a way to provide a search field, which searches in n spaces? Not one or all, but multiple spaces?

    1. Feb 23, 2009

      Hi Stefan,

      As far as I am concerned, the parameter 'space' accepts just one space name to be searched. Perhaps the following improvement request will enable multiple spaces searches in future.

      Vote for it and feel free to add yourself as watcher.

      Thanks
      Komathi

  4. Apr 03, 2009

    Just a small thing, but I was wondering if there was any way to include Mail items in the default search so that mail items show up in the drop-down?

    1. Apr 06, 2009

      I have created an improvement request at the plugin's issue tracker. Remember to cast your vote on it!

  5. Apr 09, 2009

    Anonymous

    Hello,

    I tried to use this macro, but what is spaceKey? Can I assign more than one spaceKey to a livesearch? If I can, how can I write the code? Thank you.

    YC

    1. Apr 09, 2009

      Anonymous

      the "spaceKey" is found in the URL of the wiki. For example, in this wiki https://wiki.thomsonreuters.com/display/gregwikiprod, the spaceKey is "gregwikiprod". It's something that you have to define when first creating a wiki space.

  6. Apr 23, 2009

    Hi,

    I would like to restrict my search to a specified space. So I use the spaceKey parameter and the drop-down menu works well.

    But when I click on the "Go" button, my results are not filter by space anymore.

    Is there a way to solve that problem ? (my version of Confluence is 2.9.2)

    Thanks

    Math

    1. Apr 24, 2009

      Hello Math,

      Good news is, it has been fixed in the plugin version 2.10. The downside is, it is not compatible with Confluence 2.9.x, hence you might want to consider your instance for an upgrade (smile)

      Hope that helps,
      Azwandi

  7. May 09, 2009

    Anonymous

    Really kewl!  My only problem with this macro is that even though everything seems to work in IE6, I get a javascript error (exclamation inside yellow triangle) with the message: 'target.form' is null or not an object.  Have you all seen that in IE6?  I know I'm living in the past, but IE6 is still the standard where i work(sad)

    Thanks,

    bc

    1. Jun 02, 2009

      Hi,

      I could not replicate the problem, could you please provide me the plugin version you are using?

      Best rgds,
      Zed

    2. Jul 03, 2009

      Anonymous

      Hi,

      i've the same problem in ie6 using the livesearch macro 2.8

      Thanks,

      /thorsten

      1. Jul 06, 2009

        This seems to be a known issue for the plugin - http://developer.atlassian.com/jira/browse/LIVESEARCH-12. Please note that this bug has been fixed in plugin version 2.10. Please check the compatibility of that plugin version with your Confluence version before upgrading the plugin.

  8. Nov 05, 2009

    Anonymous

    I've run into a weird situation with my livesearch macro. I'm using the spacekey to limit it to the appropriate space.
    I have several pages about meeting minutes, with the words "meeting" and "minutes" appearing in the body of the text and sometimes in the title of the page. When I start typing "meet," those pages appear in the results box; however, these results disappear if I keep typing past "meeti." If I hit "go" it takes me to a blank results page, but the pages show up if I manually remove the * wildcard from the search box.

    Any idea what's happening here? It doesn't make sense to me that results disappear when I type more of a word, even though the whole word appears on the page...

    1. Nov 11, 2009

      Hi,

      I believe you are encountering this bug. Although it has been resolved as fixed, the issue is still present as I am able to reproduce the issue myself. I have put a comment in the bug report so that the developers will take note of the problem.

      As a workaround, would you be able to use the backslash after the search string as mentioned in the bug report?

      Cheers
      JSashi

  9. Nov 05, 2009

    Anonymous

    since upgrading to 2.10.3 our live search macro has been behaving strangely. For example, the word "macros" appears on the title of a few pages. When searching for "macros" however, we get a null set (no results). However, when searching the singlar "macro", the pages with "macros" do appear.  Is there a bug with how stemming is working? Please advise.

    1. Nov 11, 2009

      Hi,

      I believe you are encountering the same problem as the person above. I would suggest you to add yourself as a watcher for this bug report and feel free to comment or address your concerns through it. Sorry for any inconveniences.

      As a workaround, would you be able to use the backslash after the search string as mentioned in the bug report?

      Cheers
      JSashi

      1. Nov 11, 2009

        Anonymous

        Unfortunately, the backslash workaround doesn't work in our environment. The backslash causes a security related error.

        I'm passing along the bug report to our technical team for further follow-up. Thanks much for the information.

        Margaret Ostrander

        Thomson Reuters

        1. Nov 11, 2009

          Hi Margaret,

          May I know what security error that you have encountered when using the backslash? If this is difficult to explain, I would suggest you to raise a support ticket to https://support.atlassian.com, so that your issue can be further investigated. Also provide the following:

          1. A copy of your Confluence log file located at <confluence-home>/logs/atlassian-confluence.log
          2. The system information page. You can obtain the page by accessing the http://<path-to-confluence>/500page.jsp
          3. Screenshots that illustrate the problem.

          Cheers
          JSashi

          1. Nov 11, 2009

            Thanks Sashi. We'll pursue through the methods you suggest -- I'm passing this along to our technical team who will be better able to article what the error is, as it is somewhat complicated. I really appreciate the quick information.

            1. Nov 12, 2009

              No worries, Margaret. We will wait for the support ticket for further investigation.

              Cheers
              JSashi

  10. Nov 11, 2009

    Anonymous

    Hi, same livesearch problems here. We have installed Confluence 3.02 and Themebuilder 3.3.5-M2-conf210. Workaround with Backslash works but is not really satisfying :(

    1. Nov 11, 2009

      Hi,

      I understand that the workaround might not be suitable in all cases. I have informed the developers regarding this issue and we are in the midst of investigating further on the issue. I would suggest you to add yourself as a watcher for the mentioned bug report and feel free to comment or address your concerns through it.

      For further details on how we include new features and improvements, you might want to read this page

      Cheers
      JSashi

  11. Jan 11, 2010

    Hi,

    is ist possible to use the macro in the velocity-context ( like #quicksearch() ) ?

    1. Jan 25, 2010

      If you would like to achieve this via the Admin Console->Layout screen, you can use the $helper context:

  12. Mar 12, 2010

    We are using livesearch within a theme builder site.  When the search is done with more that the default items and we click on the second page, we lose our theme and it goes to the default theme.  The first page of results is with our page.  Is there any way to express the number of results or make it so the second page does not go to the confluence search page

  13. Jun 14, 2010

    Hi,

    Would love to use the livesearch macro, but I have one quick question. Is there a way to limit the search only to pages, but not users, comments, etc. I used the type=page, but it did not work. Can you help? Thanks in advance...

    1. Jun 16, 2010

      Hi Basak,

      I am afraid that this is not currently possible. Feel free to raise a feature request at http://jira.atlassian.com and describe in detail how you require this feature to work. Please add yourself as a watcher, vote for this feature and add your own comments to this feature request. For further details on how we include new features and improvements, you might want to read this page

      Hope that helps.

      Cheers
      JSashi

      1. Jun 18, 2010

        Thank you very much for your reply Sashi. I, infact, saw one example at a knowledge base site:

        https://wiki.csuchico.edu/confluence/display/lms/Vista+Knowledge+Base

        See the search box in the middle. It acts like it is restricting user pages from the search results, no?

        Basak.

  14. Jul 26, 2010

    Anonymous

    Hi,

    Whenever I start typing a word in our livesearch (which only searches a certain space), the drop-down box displays the proper pages. However, as the word gets longer, the pages disappear as if none of them contain the word. Then, if I press "Go," the search results page doesn't have any results, and the search term I typed has an asterik added to the end. If I remove the asterik and press "Go" again, the search results are correct. Is there any way to fix that?

    Thanks!

    1. Aug 04, 2010

      Hi,

      If you are using Confluence version prior to 3.2, I believe you are encountering this bug in Livesearch Macro. This is fixed in Livesearch Macro version 2.11.1 which is bundled in Confluence 3.2 or higher. As for the best resolution, I would strongly suggest you to upgrade your Confluence instance to the latest version.

      If you are using Confluence 3.2 or higher, I would suggest you to raise a support ticket to https://support.atlassian.com, so that your issue can be further investigated.

      Cheers,
      Husein

  15. Sep 28, 2011

    Anonymous

    I am trying to make the livesearch macro wider but cannot find how to do this. Is there any way such as editing the macro file itself to make this happen?

  16. Oct 05, 2011

    Anonymous

    Situation:

    Whenever I tried to search a word/content in our confluence it is giving me only the result of the page which has its result on the body, but whenever I clicked it, it doesn't direct me to the exact word. 

     

    How I will be able to get this search feature in our confluence since I am using composition plugin with cloaking feature?

  17. Jan 06, 2012

    Anonymous

    When I try to search with multiple words (eg. "Buy some milk"), the dropdown list under the search box is no more updated after I typed the first space in my query. Is it possible to get a preview with multiple words in a query ?

     

    Thanks.