Homec4science

WebSearch: add limit option for wildcard queries

Authored by Ludmila Marian <ludmila.marian@gmail.com> on Feb 23 2011, 16:20.

Description

WebSearch: add limit option for wildcard queries

  • Add CGF_WEBSEARCH_WILDCARD_LIMIT to invenio.conf that will optionally limit the number of terms a wildcard query would operate on. (closes #138)
  • Implemented run_sql_with_limit() with the scope of limiting some queries that might take a long time to execute; to be used for the wildcard queries.
  • All the search API supports now a wl (wilcard limit) argument; in case it is not set, the high level API uses as default the CFG_WEBSEARCH_WILDCARD_LIMIT value and the middle and low level API use as default wl = 0 (no limit).
  • wl can be set also in the search URL. The only users that can set higher values for wl then CGF_WEBSEARCH_WILDCARD_LIMIT in the search URL are the ones connected with the 'runbibedit' role. Other users do not have the right to set a higher wl value (if they try, they will get the exact same results as when wl = CFG_WEBSEARCH_WILDCARD_LIMIT).
  • Add regression tests for this feature.

Details

Event Timeline

Tibor Simko <tibor.simko@cern.ch> committed R3600:6dd4c720e12b: WebSearch: add limit option for wildcard queries (authored by Ludmila Marian <ludmila.marian@gmail.com>).Feb 28 2011, 14:22