-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Low
-
Affects Version/s: 9.0.0, 9.1.2, 9.2.1, 9.3.1, 9.2.2, 9.3.2
-
Component/s: Search - Indexing
-
1
-
Severity 3 - Minor
Version info
Confluence 9.x
Description
Issue Summary
Visiting http://<CONFLUENCE_URL>/explain.action?queryString=keywords will provide a formatted list of each search result, and what factors contribute to its overall score as outlined in the below document:
After introducing Configuring the Velocity method allowlist with Confluence 9.x, the below methods are blocked and prevent viewing the formatted list of each search result, and what factors contribute to its overall score.
com.atlassian.confluence.plugins.search.api.model.SearchResults#getSearchQuery() com.atlassian.confluence.plugins.search.api.model.SearchResult#getTitle() com.atlassian.confluence.plugins.search.api.model.SearchResults#getResults()
Steps to Reproduce
- Install Confluence 9.x
- Visit the URL http://<CONFLUENCE_URL>/explain.action?queryString=TEST
- Below message appears in the browser:
query: $action.searchResults.searchQuery
Expected Results
The query should return a list like below:
query: +(title:test^2.1 contentBody:test content-name-unstemmed:test) +ConstantScore(+filtered(*:*)->com.atlassian.confluence.impl.search.v2.lucene.filter.ContentPermissionsFilter@f20a14f7 +(-type:space -type:globaldescription +*:*) +(-isExternallyDeletedUser:true -isDeactivatedUser:true +*:*) +*:* +(-ConstantScore(+type:custom +(contentPluginKey:com.atlassian.confluence.plugins.confluence-content-property-storage:content-property contentPluginKey:com.atlassian.confluence.plugins.confluence-emoticons-plugin:custom-emoticon)) +*:*) +((contentStatus:current filtered(*:*)->FieldValueFilter [field=contentStatus, negate=true]) filtered(*:*)->FieldValueFilter [field=contentStatus, negate=true])) (1) @@@hl@@@TEST@@@endhl@@@: 16.433096 = (MATCH) sum of: 15.433096 = (MATCH) sum of: 10.438857 = (MATCH) weight(title:test^2.1 in 0) [BM25LSimilarity], result of: 10.438857 = score(doc=0,freq=1.0 = termFreq=1.0), product of: 2.1 = boost 3.912023 = idf(docFreq=1, maxDocs=74) 1.2706685 = tfNorm, computed from: 1.0 = termFreq=1.0 1.25 = parameter k1 0.3 = parameter b 1.5675676 = avgFieldLength 1.0 = fieldLength 4.9942393 = (MATCH) weight(content-name-unstemmed:test in 0) [BM25LSimilarity], result of: 4.9942393 = score(doc=0,freq=1.0 = termFreq=1.0), product of: 3.912023 = idf(docFreq=1, maxDocs=74) 1.2766385 = tfNorm, computed from: 1.0 = termFreq=1.0 1.25 = parameter k1 0.3 = parameter b 1.6891892 = avgFieldLength 1.0 = fieldLength 1.0 = (MATCH) ConstantScore(+ConstantScore(com.atlassian.confluence.impl.search.v2.lucene.filter.ContentPermissionsFilter@f20a14f7) +(-type:space -type:globaldescription +*:*) +(-isExternallyDeletedUser:true -isDeactivatedUser:true +*:*) +*:* +(-ConstantScore(+type:custom +(contentPluginKey:com.atlassian.confluence.plugins.confluence-content-property-storage:content-property contentPluginKey:com.atlassian.confluence.plugins.confluence-emoticons-plugin:custom-emoticon)) +*:*) +((contentStatus:current ConstantScore(FieldValueFilter [field=contentStatus, negate=true])) ConstantScore(FieldValueFilter [field=contentStatus, negate=true]))), product of: 1.0 = boost 1.0 = queryNorm
Actual Results
query: $action.searchResults.searchQuery
Workaround
The below system parameter should be set as explained here: Configuring System Properties
-Datlassian.velocity.method.allowlist.extra=com.atlassian.confluence.plugins.search.api.model.SearchResults#getSearchQuery\(\),com.atlassian.confluence.plugins.search.api.model.SearchResults#getResults\(\),com.atlassian.confluence.plugins.search.api.model.SearchResults#getResults\(\)