Jump to content

Help:WSSearchFront

From mediawiki.org

The WSSearchFront extension is a front-end for WSSearch written in Vue.js

For installation instructions see the extension page

For full-text search and showing highlighted result snippets WSSemanticParsedText need to be installed and Semantic MediaWiki has to be configured to use elasticStore and store raw text in Elasticsearch with the following setting in LocalSettings.php
$smwgElasticsearchConfig["indexer"]["raw.text"] = true;

Configuration

[edit]

The WSSearchFront extension must be configured using the WSSearchFrontend parser function

There are 3 types of configuration:

  • Settings, without a prefix
  • Filter settings, prefixed with a @
  • Result settings, prefixed with a ?

Configurations can have setting options prefixed with a #

Example configuration:

{{#WSSearchFrontend:
|size=10
|title=Page Title
|@Tag
|@Year
    #display=range
    #max=20
    #type=date
    #label=Publication year
|?Users
    #display=link
|?Image
    #display=image
|?Rating
    #display=template
    #template=Rating icon
}}

Available configuration options

[edit]

Settings

[edit]

These are optional settings for the main interface

parameter parameter values settings setting values description default example
size defines how many results are shown per page 10 size=10
size options , if set a drop-down with the defined size options will be shown size options=10, 20, 50
title property that will be used for the search results title and link page title=Title

#highlight=true

#urlstring=search

#label sets a label for the title column in table layout
#highlight true highlights the search term in the title
#urlstring adds search terms as an url parameter named by the value to the links href
sort sets sorting alphabetically based on a property instead of the default relevance order score sort=Title
sort options , if set a drop-down with sort options will be shown, default results will be sorted by relevance, optional a label for the property to sort on can be set by adding text before the property devised by : sort options=Version, Title
:,: sort options=Version number:Version, Page name:Title
layout table changes the layout for the search results to a table layout=table
clear term if set, the 'clear all filters' button also clears the search term clear=term
facets how many facets to show before a 'show more' button is shown 5 facets=10

Search result settings

[edit]

These are optional settings for the search result output they are defined by adding a ? in front of the property name.

parameter settings setting values description example
? #display image displays an image, the property must be the full URL to the image ?Image#display=image
link creates a link from a property ?User#display=link
pill creates a pill, that can be used for filter selection ?Tag#display=pill
template parses a template, add #template=