Extension:WikiSearch/advanced

This page describes more advanced features of the WSSearch extension, such as how to use property chains and how to extend WSSearch.

Chained properties
WSSearch provides support for creating filters with chained properties. Chained properties can be used in any filter. They can also be used as a search term property.

For instance, the above filter matches any page for which the value of the property "Subpage" is a page that contains the property "Foobar".

Special properties
There are a number of special properties defined by Semantic MediaWiki that are worth pointing out. These properties act just like regular properties, but do not appear in Special:Browse.


 * : (from SemanticMediaWiki documentation) this mapping is used to enable wide proximity searches on textual annotated elements. The  field is a compound field for all strings to be searched when a specific property is unknown.
 * : this mapping contains unstructured, unprocessed raw text from an article.
 * : this mapping contains the title of a file attachment.
 * : this mapping contains the content of a file attachment.

For example, if you want to search through PDF files linked through the  property, you can use the chained property.

This hook is called right before the query is sent to ElasticSearch. It has the following signature:

The hook has access to and can alter the given. It can also add or remove hosts from the  array.

This hook is called right before returning the final results to the API. It can be used to alter the  array. This can be useful to filter any pages the user is not allowed to see or add additional data to the query result.

It has the following signature:

This hook must be implemented by any WSSearch frontend. It gets called when the  parser function is called. It has the following signature:


 * : The result of the call to the parser function. This is the text that will be transcluded on the page.
 * : The SearchEngineConfig object of the current page. The SearchEngineConfig object exposes the following methods:
 * : The Title associated with this SearchEngineConfig
 * : The PropertyInfo object associated with the property in the search condition (e.g.  for  )
 * The  class exposes the following methods:
 * : Returns the property ID
 * : Returns the property type (e.g.  or  )
 * : Returns the name of the property (e.g. )
 * : Returns the value in the condition (e.g.  in  )
 * : Returns the facet properties in the config (facet properties are the properties that are **not** prefixed with ). May be the name of a property (e.g. "Foobar") or a translation pair (e.g. "Foobar=Boofar")
 * : Returns a key-value pair list where the key is the ID of the facet property and the value the type of that property
 * : Returns the result properties in the config as PropertyInfo objects (result properties are the properties prefixed with )
 * : Returns a key-value pair list where the key is the name of the result property and the value the ID of that property
 * : Returns a key-value pair list of additional search parameters
 * : The current Parser object
 * : The parameters passed to the  call

Debug mode
To enable debug mode, set  to. With debug mode enabled, the raw ElasticSearch query will be returned with each API request.