WebSearch: optional refersto/citedby record limit
- Adds optional record limit to refersto/citedby and similar second order operators, preventing possible DoS kind of attacks (e.g. when refersto:year:0->9999). (PR #2711)
- Adds configuration variable CFG_WEBSEARCH_MAX_RECORDS_REFERSTO and CFG_WEBSEARCH_MAX_RECORDS_CITEDBY.
- Limits result used by 'refersto', 'referstoexcludingselfcites' to CFG_WEBSEARCH_MAX_RECORDS_REFERSTO.
- Limits result used by 'citedby', 'citedbyexcludingselfcites' to CFG_WEBSEARCH_MAX_RECORDS_CITEDBY.
- Adds classes 'InvenioWebSearchReferstoLimitError' and 'InvenioWebSearchCitedbyLimitError'.
- Adds warning messages when the limit CFG_WEBSEARCH_MAX_RECORDS_* is reached.
- In BibRank adds 'record_limit' parameter to 'get_refersto_by_list', 'get_refersto_hitset', 'get_cited_by_list', 'get_citedby_hitset' (default to None).
- Adds regression test for the query 'refersto:year:2000'.
Signed-off-by: Federico Poli <federico.poli@cern.ch>
Reviewed-by: Samuele Kaplun <samuele.kaplun@cern.ch>
Reviewed-by: Tibor Simko <tibor.simko@cern.ch>