search exact word

Ewa Śliwińska January 4, 2018

I would like to search simply for word "logs". Unfortunately, that gives me a hundred of results, from which most are "logging", "logged", "log", which are very similar, but it's hard to shell from them.

I tried with single/double quotes and without them.

I seem like a duplicate of this topic, but answers from there haven't helped me. I'm using Confluence 6.4.1.

This and this topic also haven't helped me - I'm not using any special chars/regular expressions.
Besides, they are quite old. 
I also checked an error which is connected with search, but it is resolved.

I feel like I'm missing something because it seems that I can't use a very basic functionality (and quite important ;)).

Thanks in advance.

2 answers

1 accepted

3 votes
Answer accepted
Davin Studer
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.
January 5, 2018

Try this in your search. A little know feature is that Confluence can also do regular expression searches. Put it in the search box exactly as is below.

/.*logs.*/
Ewa Śliwińska January 5, 2018

Great, this works like a charm. Thanks a lot!
You're right, I didn't know that, even during searching (in this topic) I found excactly opposite information (I know that this is all topic) ;)
It's a shame that Attlasian team wasn't the one who respond with this solution.

Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 5, 2018

Hi Ewa,

This expression that Davin has sent you is a wildcard search, as documented here:

Leading wildcards

Lucene doesn't allow wildcards at the beginning of your search, but you can format your search as a regular expression as a workaround. For example, you can't search for *hum* or ?hum*, as they begin with a wildcard, but you can search for /.*hum.*/ and find things like hum, human, and inhumane.

Please be aware that it will return all results that include "logs" and not restrict to only "logs". Therefore it could potentially find things like analogs, epilogs, etc. and return more search results than intended.

If you do not like this behavior, then you can still vote on the feature request I sent you for exact text search.

I hope that clarifies things!

Regards,
Shannon

Ewa Śliwińska January 5, 2018

Dear Shannon,

thank you for this note.
However, this is you who could tell me what Davin told - cause in my case this is much better than just waiting for exact search to be exact search.
This is another thing - I already voted on this bug and filled the survey. That doesn't change the fact that this workaround is this particular case works like a charm for me. Actually, I didn't even notice any wider results.
So in both cases we have more results than we expect, we just need to pick which evil is less :)
Probably there is a way to write regular expression to exact word, I don't know that, but I also don't need it at the moment.

Davin Studer
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.
January 5, 2018

That is true that the above search could be a bit greedy and get more than just logs. It could be edited if you know more about your data. For instance if you know that the word logs will always have a space before and after you could change the search to this ...

/.* logs .*/

 Or if sometimes logs ends a sentence and sometimes it is inside a sentence you could do ...

/(.* logs .*)|(.* logs\..*)/

One things to keep in mind is that if you have a problem and you are trying to solve it with regular expressions ... now you have two problems. Sorry ... just a little programming humor there. Certainly regular expression searches are typically for more advanced programmer type users ... but it is there and if you know your data well you can get around some Confluences search limitations this way.

Ewa Śliwińska January 5, 2018

OK, thank you too :)
Funny ;>
I don't know that data at all, it's not my data, I'm just looking for a needle in a haystack ;)
But you're right, in most cases it will probably be like you wrote + maybe some bracet for "Logs" on the beginning of a sentence.

0 votes
Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 4, 2018

Ewa,

This is something we're indeed working on and you can track below:

It will help us if you can provide your feedback on the following survey:

In the meantime, I would recommend using a more specific search term to get exactly the result you need.

Thank you for your understanding.

Regards,

Shannon

Ewa Śliwińska January 4, 2018

Thank you. Can't use more specific search term because then I find nothing :) This was my last resort. But it's good to know that you are working on it, good luck and have a good day :)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events