Add schemas for all index settings
This commit is contained in:
parent
757039e4fe
commit
586d98ced1
1 changed files with 116 additions and 0 deletions
116
app/common.js
116
app/common.js
|
|
@ -4,6 +4,45 @@ import { languages } from 'monaco-editor/esm/vs/editor/editor.api.js';
|
|||
const urlSettingsPrefix = 'https://docs.meilisearch.com/reference/api/settings';
|
||||
|
||||
export const indexSettings = [
|
||||
{
|
||||
name: 'displayedAttributes',
|
||||
schema: {
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'string',
|
||||
},
|
||||
uniqueItems: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'distinctAttribute',
|
||||
schema: {
|
||||
type: ['string', 'null'],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'faceting',
|
||||
schema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
maxValuesPerFacet: {
|
||||
type: 'integer',
|
||||
},
|
||||
},
|
||||
required: ['maxValuesPerFacet'],
|
||||
additionalProperties: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'filterableAttributes',
|
||||
schema: {
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'string',
|
||||
},
|
||||
uniqueItems: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'pagination',
|
||||
schema: {
|
||||
|
|
@ -17,6 +56,36 @@ export const indexSettings = [
|
|||
additionalProperties: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'rankingRules',
|
||||
schema: {
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'string',
|
||||
},
|
||||
uniqueItems: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'searchableAttributes',
|
||||
schema: {
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'string',
|
||||
},
|
||||
uniqueItems: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'sortableAttributes',
|
||||
schema: {
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'string',
|
||||
},
|
||||
uniqueItems: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'stopWords',
|
||||
schema: {
|
||||
|
|
@ -27,6 +96,53 @@ export const indexSettings = [
|
|||
uniqueItems: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'synonyms',
|
||||
schema: {
|
||||
type: 'object',
|
||||
additionalProperties: {
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'string',
|
||||
},
|
||||
uniqueItems: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'typoTolerance',
|
||||
schema: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
enabled: {
|
||||
type: 'boolean',
|
||||
},
|
||||
minWordSizeForTypos: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
oneTypo: { type: 'integer' },
|
||||
twoTypos: { type: 'integer' },
|
||||
},
|
||||
additionalProperties: false,
|
||||
},
|
||||
disableOnWords: {
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'string',
|
||||
},
|
||||
uniqueItems: true,
|
||||
},
|
||||
disableOnAttributes: {
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'string',
|
||||
},
|
||||
uniqueItems: true,
|
||||
},
|
||||
},
|
||||
additionalProperties: false,
|
||||
},
|
||||
},
|
||||
].map((item) => {
|
||||
item.uri = item.schema.$id = `${urlSettingsPrefix}/${dasherize(item.name)}`;
|
||||
item.fileMatch = [item.uri];
|
||||
|
|
|
|||
Loading…
Reference in a new issue