Skip to content

Latest commit

 

History

History
75 lines (53 loc) · 1.59 KB

search.md

File metadata and controls

75 lines (53 loc) · 1.59 KB
title description published date tags
Search Engine
Developing search engine modules
true
2019-03-08 03:53:41 UTC

A search engine module connects Wiki.js with an external search engine to perform page search and word suggestion queries. It consists of properties that can be set by the user as well as methods that are called on certain events, such as to create, update and delete content.

Search engine modules are located in /server/modules/search.

A unique folder is created for each module. The folder contains two files:

  • definition.yml
  • storage.js

definition.yml

This file contains information about your module.

key: example
title: Example Search Engine
author: John Doe
props:
  firstExampleProperty: String
  secondExampleProperty: Number

Properties

  • key: A short, unique and camelCase-formatted name for this module. It must match exactly the module folder name!
  • title: The full name of the module.
  • author: The name of the author of the module.
  • props: An object of user editable properties. See Module Properties for more info.

engine.js

This file contains methods that will be called for a search query and when a new page is created, modified, deleted, etc.

module.exports = {
  async activated () {

  },
  async deactivated () {

  },
  async init () {
  
  },
  async suggest (q, opts) {
  
  },
  async query (q, opts) {
  
  },
  async created (page) {

  },
  async updated (page) {

  },
  async deleted (page) {

  },
  async renamed (page) {

  },
  async rebuild () {
  
  }
}