Wiki
Clone wikiinstant-search / Home
The Instant Search Confluence App/Macro/Plugin provides a highly customizable search-engine style "type-ahead" search box.
It is case-insensitive, supports multiple words and can be extensively filtered with trackable searches.
All Versions Show/Hide: space key, labels, date created, date last modified, excerpt, search button Customize: maximum search results, input field width, excerpt length, url (include /exclude), search button, watermark, search and result css, result width, tab order, focus on page load
Examples (Encoded)
If you are going to be using these from within a page you highlight the available options shown (and listed below).
With bread crumbs:
Markup
If you are encoding this using markup within a layout template or as a sidebar, you'll have to encode the macro as below:
{instantsearch} {instantsearch:spaceKey=DIC|showSpaceKey=true|showSearchButton=false} {instantsearch:spaceKey=DOC|type=page|limit:3|inputFieldWidth=200px|excerptLength=0|watermark=* Search Articles|showSearchButton=false} {instantsearch:spaceKey=DOC|type=page|limit:3|inputFieldWidth=200px|excerptLength=0|watermark=* Search Articles|showSearchButton=false|showSpaceKey=true|searchButtonHtml="Go to confluence Search"|tracking=true} {instantsearch:type=page|limit:3|inputFieldWidth=200px|excerptLength=0|watermark=* Search Articles} {instantsearch:spaceKey=KEY|type=page|limit=3|bodyContentLength=20|lastModified=3d|showDateLastModified=true} {instantsearch:spaceKey=KEY|label=+atlassian,+confluence,+content|bodyContentLength=0} {instantsearch:spaceKey=@self|label=+atlassian,+confluence,+content|filter=@self} {instantsearch:spaceKey=KEY|label=+atlassian,+confluence,+content|filter=-random_url,+other_url} {instantsearch:spaceKey=KEY|showLabels=true|showBreadCrumbs=true|hideExcerptMacro=true|inputFieldWidth=200px} {instantsearch:watermark=Searching in KEY ...|spaceKey=KEY|searchButtonHTML=<img src=/url/to/image>} {instantsearch:resultClass=mystyle|spaceKey=KEY1,KEY2|resultWidth=400px|focus=true|track=true}
If you are using the search track macro an example would be:
{instantsearch-log} {instantsearch-log:showFailedTable=false}
Usage Options
(please see preview for more precise options)
Tracking: track users search to improve content (default False) Filters: space key, type of content, contributor, label (include / exclude), content with regular expression (include / exclude), last modified date * Search box grabs focus on page load (Default false) Show/Hide: space key, labels, date created, date last modified, excerpt, search button Customize: maximum search results, input field width, excerpt length, url (include /exclude), search button, watermark, search and result css, result width, tab order, focus on page load
Full listing
Format
- someMarkdownKey: Name and description
UI Options:
- focus: Search box grabs focus on page load (Default false).
- track: Tracking (Default false). More information here.
- tabOrder: Tab order for search box.
- searchButtonHTML: Text for the search button. @self is replaced to refer to the space name.
- inputFieldWidth: Set the width of the input box using the width style attribute (e.g., 200px) (Default 300px).
- inputClass: CSS class for input .
- searchClass: CSS class for search box.
- searchDivClass: CSS class for the search button div.
- searchButtonClass: CSS class for the search button.
- watermarkClass: CSS class for watermark.
- watermark: Watermark. Text displayed in input field (watermark). @self is replaced to refer to the space name.
- showSearchButton: Show search button.
Result Visualiztion Options:
- showFavorites: Show the number of favorites / "save laters" selected for a particular page.
- showLabels: Show labels.
- showBreadCrumbs: Show bread crumbs.
- showDateCreated: Show date created.
- showDateLastModified: Show date last modified.
- showSpaceKey: Show space in results.
- showLikes: Show the number of likes for a given piece of content (default false).
- resultClass: CSS class for result box.
- hideText: Hide Text Expression. Hides text in result summary according to the related expression. Use Java Regex to hide multiple texts separate expressions with "," (underscore comma underscore).
- hideExcerptMacro: Hide {excerpt}. (Default false). More info here.
- replaceText: Hidden Text Replacement. Replaces hidden text with the following expression. If replacing multiple hidden texts use "," to separate expression (underscore comma underscore). (Default "").
- resultWidth: Width for search result (e.g., 300px).
- excerptLength: Rough length of each excerpt in characters (Default 40). Set to 0 to remove excerpts.
- sort: Sort all result hits by relevance (default), title, created, modified, and number of favorites.
- sortDescending: Sorts are returned in descending or ascending order excerpt for favorites and relevance which are always in descending order.
UI Option: * makeGlobal: Replace global search. Replace the global search with instant search for a particular page or add the global header for the space. This ignores a number of visualization options (resutWidth, etc.). Note: if putting it in a space template use this format.
{instantsearch:makeGlobal=true}
{instantsearch:makeGlobal=true}
- (deprecated) sortLikes: Sort by the number of likes (asc or desc).
Filter options:
- lastModified: Last modified. Specify a time period in which the content was last modified: (e.g. 3d = modified in the last 3 days, 1m3d = modified in the last month and three days)..
- spaceKey: Specify the key of the space you want to search in. Use comma for multiple spaces. @self key-word allowed.
- label: Search for content with these labels. Prefix a label with + to require a match or - to exclude any content with that label. By default, at least one of the labels will be present on any matched content. Separate labels with commas or single-spaces..
- spaceLabel: Space category labels. Specify the category labels of the spaces you want to search in. Use comma to include multiple.
- spaceCategory: Search spaces category types.
- type: Specify the content type. Multiple content-types can be comma-separated. Values are: "page", "comment", "blogpost", "attachment", "userinfo", "spacedesc", "personalspacedesc", "mail", "space", "draft", "custom".
- contributor: Specify the username of the contributor of the content to be retrieved.
- limit: Search result limit (Default 5).
- filter: Filter. Every returned url be included or excluded. Prefix with + (default) to require a match or - to exclude any content with that filter. Separate filters with commas or single-spaces. Also allows special keywords (by themselves): @none (default), @parent, @self, and @home.
- likesFilter: Likes Filter. Filters by number of likes. Prepend with > or < followed by a number. For example, >3 is greater than 3 likes required.
Note:
To remove the search result body excerpts from search results, set bodyContentLength to 0 or less.
Updated