thrownewWIKI.Error.Custom('SiteUpdateDuplicateCatchAll',`Site ${dupSite.config.title} with a catch-all hostname already exists! Cannot have 2 catch-all hostnames.`)
description:Amazon CloudSearch is a managed service in the AWS Cloud that makes it simple and cost-effective to set up, manage, and scale a search solution for your website or application.
hint:Should match the version of the Elasticsearch nodes you are connecting to
order:1
enum:
-'7.x'
-'6.x'
default:'6.x'
hosts:
type:String
title:Host(s)
hint:Comma-separated list of Elasticsearch hosts to connect to, including the port, username and password if necessary. (e.g. http://localhost:9200, https://user:pass@es1.example.com:9200)
constsuggestResults=awaitWIKI.models.knex.raw(`SELECT word, word <-> ? AS rank FROM "pagesWords" WHERE similarity(word, ?) > 0.2 ORDER BY rank LIMIT 5;`,[q,q])
suggestions=suggestResults.rows.map(r=>r.word)
}
return{
results:results.rows,
suggestions,
totalHits:results.rows.length
}
}catch(err){
WIKI.logger.warn('Search Engine Error:')
WIKI.logger.warn(err)
}
},
/**
* CREATE
*
* @param {Object} page Page to create
*/
asynccreated(page){
awaitWIKI.models.knex.raw(`
INSERT INTO "pagesVector" (path, locale, title, description, "tokens") VALUES (
description:Sphinx is an open source full text search server, designed from the ground up with performance, relevance and integration simplicity in mind.