Can I replace confluence seatch box with an external search engine?

Peter Kahn
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 28, 2013

How can I put my custom search engine in place of the confluence search engine?

I have an external search engine that indexes both confluence and external sites, such as my javadoc. I used refinedWiki to add an additional search box for my users. However, I'd like to replace the standard confluence search box with my search.

Is it possible to knock out the confluence search box and replace it with my own or redirect the confluence search box or augment it via an api?

Thanks

Peter

1 answer

1 accepted

0 votes
Answer accepted
Amalia
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 29, 2013

The simplest and easiest way I can think of is to replace the action attribute in the form tag of the search box using JavaScript:

<script>
AJS.toInit(function(){
    AJS.$('#quick-search').attr('action', 'test.jsp');
});
</script>

Another way is to remove the #quick-search and prepend your own search box

<script>
AJS.toInit(function(){
    AJS.$('#quick-search').remove();
    AJS.$('.aui-header-inner .aui-header-secondary .aui-nav li:first').prepend('add your searchbox here');
});
</script>

Kavitha February 12, 2024

Hi @Peter Kahn

and 

@Amalia 

We are also having similar requirement, is it possible to share the code to call the external search engine and format the search results in the confluence please.

Thanks in advance,

Kavitha

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events