Search for custom content property with c.a.c.search.v2.SearchManager

Hi,

I am trying to search by an extracted contentproperty when using the searchmanager.
Contentproperties are using custom SearchQuery implementations from the com.atlassian.confluence.plugins.contentproperty.search.query
But there does not seem to be a way of creating these.

I am looking for some service that exposes an interface like

SearchQuery getContentPropertyQuery(String extractorKey, String, extractorField, Object value);

c.a.c.plugins.contentproperty.search.query.ContentPropertySearchQueryFactory#create does something very similar but is a) not exposed b) needs argument that can’t be created as a user.

Searching via CQL is not really practical because it does not integrate with the other SearchManager features and it would require a lot of brittle string escaping logic.

Thanks

As a workaround I was able to extract the ContentPropertyIndexSchemaModuleDescriptor via the PluginAccessor.
From its pluginModule the relevant ContentPropertySchemaField can be extracted whose fieldName can be used to construct a com.atlassian.confluence.search.v2.query.TermQuery which can be used directly with the SearchManager

And don’t forget to work around https://jira.atlassian.com/browse/CONFSERVER-52489