Confluence Search Problem
Asked by xinan liu:

I want to search a confluence page which name contains API, but found no results.

image2015-6-26 15:20:47.png

image2015-6-26 15:21:0.png

What's the matter?

And one more question, how to set the page tree opend as a default value? Just like the pagetree macro.

image2015-6-26 15:22:43.png

Thanks very much!  
[](https://community.atlassian.com/t5/Confluence-questions/Confluence-Search-Problem/qaq-p/304487?attachment-id=7962){#link_1188454a443a95}  
[](/tnckb94959/attachments/tnckb94959/confluence-questions/51379/1/image2015-6-26%2015%3A21%3A0.png){#display_1188454a443a95_0}  
[](https://community.atlassian.com/t5/Confluence-questions/Confluence-Search-Problem/qaq-p/304487?attachment-id=7963){#link_1188454a443a95_0}  
[](/tnckb94959/attachments/tnckb94959/confluence-questions/51379/2/image2015-6-26%2015%3A22%3A43.png){#display_1188454a443a95_2}  
[](https://community.atlassian.com/t5/Confluence-questions/Confluence-Search-Problem/qaq-p/304487?attachment-id=7964){#link_1188454a443a95_1}  
[](/tnckb94959/attachments/tnckb94959/confluence-questions/51379/3/image2015-6-26%2015%3A20%3A47.png){#display_1188454a443a95_4}


Answers:
author: Stephen Deutsch
body: Using the search syntax, you should be able to search for something like \*API\* and find all words with API in the middle. Except that this is a longstanding bug in Confluence: <https://jira.atlassian.com/browse/CONF-37153>

As far as expanding the page tree view, that is possible using the documentation theme (which it looks like you are using from the screenshots). Just go to "Space Admin", "Themes", "Configure Theme" and then uncheck the "Page Tree" checkbox, and in the navigation box put something like:

```
{pagetree:root=Home|startDepth=2|searchBox=true}
```

Choose the right home page and whether you want the searchbox there. It seems you are already familiar with the pagetree macro so you shouldn't have any problem.

comments: author: Davin Studer
body: You can do a front wildcard search if you do a regex search like this. The first pat gets the wildcard front and back match. The second part for some reason I have found to be needed as well to get instances where API is at the beginning./.\*API.\*/ OR API


author: Stephen Deutsch
body: That's awesome! I wasn't aware you could use that syntax. I will have to keep that in mind from now on. Thanks a ton, Davin!


author: rrudnicki
body: Hi Xinan,

Try to look for the whole title of the page, like xxxxxxAPIxxxxxxxx. Also, this documentation might be useful for you: <https://confluence.atlassian.com/display/JIRA/Performing+Text+Searches>

Regards,

Renato Rudnicki


author: Nic Brough -Adaptavist-
body: I think the search stemming means that it needs API to be a separate "word" in the title of the document. The indexing is seeing the API as part of a bigger "word" because it is embedded in a string with other characters.

To the indexing functions, I think your page title looks something like xxxxxxAPIxxxxxxxx, so it's seen as one word. To test this, try (temporarily) changing the title to xxxxx API xxxxxxx. I suspect it will find it then.

My guess is that this down to the way native English speakers think - we use spaces between words and code our indexing systems to use it as a break, but most of us don't instinctively see that you don't need spaces in hanzi/kanji etc

I don't think you can default the page tree view


Tags: confluence-administration