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:
This file contains information about your module.
key: example
title: Example Search Engine
author: John Doe
props:
firstExampleProperty: String
secondExampleProperty: Number
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 () {
}
}