Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to be compatible with java API for searching in Confluence 6.0.1 - 8.0.+ ?

aorlov September 28, 2022

Hi, Atlassian Community.

Our addon should search pages and blogs in Confluence and our use cases are:

1. Search pages and blogs (by labels, by spaces as AND, OR) for specific user with applying permission checks.
2. We should be compatible Confluence 6.0.1 - 8.0.+
3. We need to find all pages without permission checks for our AO-migration.


Before Confluence 8.0.0 we used these classes,

1.png

but Confluence 8.0.0 EAP shows some breaking changes in java API for searching:

1. Class com.atlassian.confluence.search.v2.ContentSearch was changed and old constructors were removed (we used them).

Was

Screenshot 2022-09-28 at 15.49.59.png

 

Confluence 8.0.0-m23

Screenshot 2022-09-28 at 15.50.33.png

 


2. Class com.atlassian.confluence.search.v2.searchfilter.SiteSearchPermissionsSearchFilter was deprecated and marked as @Internal. We used this class for permission checks.

There are com.atlassian.confluence.search.service.PredefinedSearchBuilder and com.atlassian.confluence.search.service.SearchQueryParameters in the docs, but they have some problems:

1. PredefinedSearchBuilder applies permission checks. It doesn't use permission checks only for admins (it can be found in the source code). How can we guarantee that all pages will be found during our AO-migration? Is it possible to do it without using ugly tricks?
2. SearchQueryParameters can't search by labels. I don't know why. Did somebody try to do it? I couldn't find any page even with one label.


So, how to be compatible with Confluence 6.0.1 - 8.0.+ ? I think there are many apps with the same problem. Any advice would be appreciated.

Kind regards

1 answer

0 votes
Dan Mercer
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 6, 2022

We also are running into this problem. About 2% of our customers are on the required 7.20+ that's needed to use the new ContentSearch constructors, so switching to those doesn't seem like a viable option.

Were you able to find a solution?

 

Dan Mercer
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 7, 2022

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events