Extension:WikiSearch/usage

From mediawiki.org

The #WikiSearchConfig parser function is used to set several configuration variables that cannot be passed to the API for security reasons. It sets the list of facet properties as well as several optional parameters.

Parameters[edit]

Parameter Allowed value(s) Description Example
Semantic MediaWiki property name Sets facet properties, for which facet filters can be set up with WikiSearchFrontend |Tag|Title

|Version

?Semantic MediaWiki property name Sets result properties, for which results can be displayed with WikiSearchFrontend |?Tag|?Title

|?Version

base query Semantic MediaWiki query Adds a base query to the search. A page will only show up in search results if it matches both the base query and filters that are selected by the user. base query=[[Class::Documentation]]
highlighted properties comma-separated list of Semantic MediaWiki text property name(s) Sets properties in which search terms will be highlighted in the search results. Note that these can also be properties that are not included as facet properties. highlighted properties=Tag,Title,Summary
search term properties comma-separated list of Semantic MediaWiki text property name(s) Sets properties that will be searched through when doing a free-text search. These properties may also be chained properties. A weight can be added to each field in the search term properties by using the `^%d` syntax. For example, to give additional weight to the title, you can do the following:

|search term properties=Title^10,Content^2,Pdf.attachment-content

The weight determines the ranking when sorting on relevance. A match in a field with a higher weight will count more towards the relevance score than a match in a field with a lower weight. When no weight is given, the weight is set to 1.

search term properties=Content, Reference.Content
default operator and, or Default operator of the free-text search that is applied between multiple words in the search input. Default value is or. default operator=or
post filter properties comma-separated list of Semantic MediaWiki property name(s) Specifies which filters should be added as a post filter instead of a regular filter. The difference between post filters and regular filters is explained here. Use this for properties with #logic=or checkbox or combobox filters in WikiSearchFrontend. Tag,Organization,Author
aggregation size number Maximum number of values that are returned for each property (ordered by most results). This affects the number of facets displayed by Extension:WikiSearchFront. Default value is 10. aggregation size=25

Example[edit]

{{#WikiSearchConfig:
  |base query=[[Class::Documentation]]
  |highlighted properties=Title
  |search term properties=Title^10,Content, Reference.Content
  |default operator=and
  |post filter properties=Organization,Tag
  |Tag
  |Version
  |Organization
  |Author
  |?Title
  |?Description
}}