Add search bar to find text within a page
Asked by Meg:

Hello! Wanting to work out how to search for text within a page with multiple expandable areas. Not wanting to search outside of the page, just within that page.   

Pressing cmd+f won't solve as the details are 'hidden' in expandable accordions   

Adding 'live search' only seems to look around the space, rather than matching terms within that page.   

So for example - a user wants to find out about Maternity SMP, and would use the 'search' for finding 'SMP'. The result would take the user to that part of the page with expanded accordion. Is this possible?

SEARCH: \`SMP\`

- Maternity

- Lorem Maternity ipsum A

- Lorem**SMP** ipsum B

- Holidays

- Taking time off Lorem Ipsum

- Lorem ipsum bank holidays

Thanks!


Answers:
author: Andy Gladstone
body: [@Meg](/t5/user/viewprofilepage/user-id/5146698) welcome to the Atlassian Community.

Sorry to be the bearer of bad news, but you cannot do either. Let me explain.

1. There is no native search function within a page you are viewing. I imagine this is because:
   1. Pages should not be so text heavy that they require their own search dialog.
   2. Since Confluence is based in a browser the native browser search function should suffice.
2. Regarding searching for text in an Expand macro, this one has been an issue for a long time. Since the text exists in the macro, and not on the page, it is not searchable OR indexed for searching in Confluence at all. There are two related JAC tickets for this, with no movement. You can vote them up and watch them.
   1. <https://jira.atlassian.com/browse/CONFCLOUD-30038>
   2. <https://jira.atlassian.com/browse/CONFCLOUD-73920>

My suggestion is that content/text that is unique or meant to be found via search rather than browsing a page should not be placed in the Expand Macro.

comments: author: Andy Gladstone
body: [@Meg](/t5/user/viewprofilepage/user-id/5146698) sorry I was not able to help you, but the answer is a valid one. Can you please mark it as accepted?


author: Shavonne Tate
body: I was looking for the same solution as Meg. I am using a confluence space as a FAQ database and wanted to keep all of the searching in-page versus using the browser's search function.


author: Yatish Madhav
body: Hi all

I am also looking for an in page search feature. Any idea or workarounds?

I agree, pages should not be long but I am trying a glossary page of meanings and have around 500 words and internal definations that I want users to be able to search for on the page without the knowledge of Ctrl+f.

Any help will help :)

Thank you


author: robert SCOTT damery
body: ok upon further review I was able to find a work around. It appears that if you surround your search with double quotes "like this" then it will find just that in the pages content. which is what I was looking for....


author: robert SCOTT damery
body: I am searching for text that is part of a normal page content but the search is not pulling up the page that contains the specific text. I added a label and now the page pulls up but I have to then use the CTRL+F search to find it on the page....also search was pulling up result pages that did not have the search text in it....even more concerning....not sure how this is working but my results are not as expected.

I expect a search to pull up Page titles and pages with content that match the search text. Would be nice for it to position to that location in the page when clicked on instead of the top of the page.....just saying.


Tags: cloud

confluence-cloud