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

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

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>

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jul 10, 2018 in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

989 views 23 13
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you