MCPcopy Create free account
hub / github.com/alephdata/aleph / get_facet_size

Method get_facet_size

aleph/search/parser.py:157–163  ·  view source on GitHub ↗

Number of distinct values to be included (i.e. top N).

(self, name)

Source from the content-addressed store, hash-verified

155 )
156
157 def get_facet_size(self, name):
158 """Number of distinct values to be included (i.e. top N)."""
159 facet_size = self.getint("facet_size:%s" % name, 20)
160 # Added to mitigate a DDoS by scripted facet bots (2020-11-24):
161 if not self.authz.logged_in and name not in self.SMALL_FACETS:
162 facet_size = min(50, facet_size)
163 return facet_size
164
165 def get_facet_total(self, name):
166 """Flag to perform a count of the total number of distinct values."""

Callers 2

get_facet_valuesMethod · 0.95
get_aggregationsMethod · 0.80

Calls 1

getintMethod · 0.80

Tested by

no test coverage detected