Skip to content

Commit

Permalink
#527 Made request handler for statistics dynamic by adding /statistic…
Browse files Browse the repository at this point in the history
…s-all handler
  • Loading branch information
Possommi committed Mar 28, 2024
1 parent 00b17e5 commit 79e5ee2
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,4 @@ MCR.Cronjob.Jobs.UpdateSolrProjectCore.Command = thunibib update solr project c
MCR.Cronjob.Jobs.UpdateSolrProjectCore.Cron = 0 8 * * *

UBO.ORCID2.InfoURL = %MCR.baseurl%faq.xml
MCR.Solr.Proxy.WhiteList = %MCR.Solr.Proxy.WhiteList%,/search,/search-all
MCR.Solr.Proxy.WhiteList = %MCR.Solr.Proxy.WhiteList%,/search,/search-all,/statistics-all
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,45 @@
"defaults": {
"echoParams": "explicit",
"defType": "edismax",
"q.alt": "*:*",
"qs": "5",
"mm": "100%",
"q.op": "AND",
"df": "all",
"wt": "xml"
},
"appends": {
"facet.field": [
"year",
"subject",
"origin_exact",
"genre",
"oa",
"facet_person",
"connection_nid_text",
"nid_connection"
],
"json.facet": "{year:{type:terms,field:year,sort:{index:asc},facet:{oa:{type:terms,field:oa,sort:{index:asc}}}}}",
"fq": "+objectType:mods",
"fq": "status:unchecked OR status:confirmed"
},
"invariants": {
"fl": "",
"start": "0",
"rows": "0",
"facet": "true",
"facet.mincount": "1"
}
}
},
{
"add-requestHandler": {
"name": "/statistics-all",
"class": "solr.SearchHandler",
"defaults": {
"echoParams": "explicit",
"defType": "edismax",
"q.alt": "*:*",
"qs": "5",
"mm": "100%",
"q.op": "AND",
Expand All @@ -59,7 +98,8 @@
"connection_nid_text",
"nid_connection"
],
"json.facet": "{year:{type:terms,field:year,sort:{index:asc},facet:{oa:{type:terms,field:oa,sort:{index:asc}}}}}"
"json.facet": "{year:{type:terms,field:year,sort:{index:asc},facet:{oa:{type:terms,field:oa,sort:{index:asc}}}}}",
"fq": "+objectType:mods"
},
"invariants": {
"fl": "",
Expand Down Expand Up @@ -105,7 +145,7 @@
"wt": "xml"
},
"appends": {
"fq": "+objectType:mods "
"fq": "+objectType:mods"
}
}
},
Expand Down
11 changes: 11 additions & 0 deletions common/src/main/resources/xsl/response-get-handler.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,15 @@
</xsl:choose>
</xsl:variable>

<xsl:variable name="solrStatisticRequestHandler">
<xsl:choose>
<xsl:when test="mcrxsl:isCurrentUserInRole('admin')">
<xsl:value-of select="'statistics-all?'"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="'statistics?'"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>

</xsl:stylesheet>

0 comments on commit 79e5ee2

Please # to comment.