From ce63104f50ac388ab4ab264958d0866494219be6 Mon Sep 17 00:00:00 2001 From: meili-bot <74670311+meili-bot@users.noreply.github.com> Date: Wed, 15 May 2024 12:06:01 +0000 Subject: [PATCH] update the website according to the specs --- docs/404.html | 8 ++++---- .../css/{0.styles.e3743cd1.css => 0.styles.172d2b38.css} | 2 +- docs/assets/js/{10.4bb9eeac.js => 10.7104dc1c.js} | 2 +- docs/assets/js/{11.07634795.js => 11.7b4d52ff.js} | 2 +- docs/assets/js/{13.5ee4202d.js => 13.167021d3.js} | 2 +- docs/assets/js/{14.9305fa09.js => 14.acdd32fb.js} | 2 +- docs/assets/js/{15.095125b3.js => 15.3f1414b9.js} | 2 +- docs/assets/js/{20.fb03e236.js => 20.fe442e43.js} | 2 +- docs/assets/js/{21.5d4e271d.js => 21.01b56736.js} | 2 +- docs/assets/js/{22.9d7baf38.js => 22.a9f2f84c.js} | 2 +- docs/assets/js/{23.06e68601.js => 23.582f3200.js} | 2 +- docs/assets/js/{24.95542534.js => 24.2234005f.js} | 2 +- docs/assets/js/{25.96849fe5.js => 25.c49340ab.js} | 2 +- docs/assets/js/{28.41999e7c.js => 28.d2c2cee7.js} | 2 +- docs/assets/js/{29.a05f4317.js => 29.239d404a.js} | 2 +- docs/assets/js/{32.88319e61.js => 32.bac37d5d.js} | 2 +- docs/assets/js/{33.91d80bc8.js => 33.63b5ee32.js} | 2 +- docs/assets/js/{38.de46d18d.js => 38.651ab4ec.js} | 2 +- docs/assets/js/{39.c0e59772.js => 39.3ffdfa45.js} | 2 +- docs/assets/js/{4.f57bbccf.js => 4.aaee11b0.js} | 2 +- docs/assets/js/{43.af7cbf45.js => 43.1901f806.js} | 2 +- docs/assets/js/{44.97d19d44.js => 44.437489b6.js} | 2 +- docs/assets/js/{46.9f9d4a1b.js => 46.7f495a96.js} | 2 +- docs/assets/js/{47.49c151b7.js => 47.bf881f32.js} | 2 +- docs/assets/js/{5.2065d417.js => 5.689b79cc.js} | 2 +- docs/assets/js/{50.e4b54756.js => 50.dcf47d3d.js} | 2 +- docs/assets/js/{52.c36008c5.js => 52.55ac3382.js} | 2 +- docs/assets/js/{56.a3d19c35.js => 56.dfe45e94.js} | 2 +- docs/assets/js/{57.4dbfa071.js => 57.6e1d5d7b.js} | 2 +- docs/assets/js/{59.79acfddd.js => 59.a3757b9e.js} | 2 +- docs/assets/js/{6.87f02c74.js => 6.96405132.js} | 2 +- docs/assets/js/{62.057cf3e0.js => 62.3ac8f506.js} | 2 +- docs/assets/js/{63.d21ecbad.js => 63.39c14cc1.js} | 2 +- docs/assets/js/{9.0c014273.js => 9.0238d3e6.js} | 2 +- docs/assets/js/{app.6fb12f44.js => app.dedba9e9.js} | 4 ++-- docs/index.html | 6 +++--- docs/specifications/LICENSE.html | 6 +++--- docs/specifications/index.html | 6 +++--- docs/specifications/pull_request_template.html | 6 +++--- docs/specifications/text/0000-specification-template.html | 6 +++--- docs/specifications/text/0001-frontend-disable-prod.html | 6 +++--- docs/specifications/text/0001-script-based-tokenizer.html | 6 +++--- docs/specifications/text/0028-indexing-csv.html | 6 +++--- docs/specifications/text/0029-indexing-ndjson.html | 6 +++--- docs/specifications/text/0032-distinct-attribute.html | 6 +++--- docs/specifications/text/0033-logging.html | 6 +++--- docs/specifications/text/0034-telemetry-policies.html | 6 +++--- .../text/0038-rename-attributes-for-faceting.html | 6 +++--- docs/specifications/text/0043-phrase-query.html | 6 +++--- ...0047-reset-stop-words-synonyms-settings-with-null.html | 6 +++--- .../specifications/text/0048-rename-max-mdb-size-var.html | 6 +++--- docs/specifications/text/0055-sort.html | 6 +++--- docs/specifications/text/0059-geo-search.html | 6 +++--- docs/specifications/text/0060-tasks-api.html | 6 +++--- .../text/0061-error-format-and-definitions.html | 6 +++--- docs/specifications/text/0077-words-position-limit.html | 6 +++--- docs/specifications/text/0085-api-keys.html | 6 +++--- docs/specifications/text/0089-tenant-tokens.html | 6 +++--- docs/specifications/text/0096-auto-batching.html | 6 +++--- docs/specifications/text/0105-dumps-api.html | 6 +++--- .../text/0117-typo-tolerance-setting-api.html | 6 +++--- docs/specifications/text/0118-search-api.html | 6 +++--- docs/specifications/text/0119-instance-options.html | 6 +++--- docs/specifications/text/0121-data-types.html | 6 +++--- .../text/0123-displayed-attributes-setting-api.html | 6 +++--- .../text/0123-distinct-attribute-setting-api.html | 6 +++--- .../text/0123-filterable-attributes-setting-api.html | 6 +++--- docs/specifications/text/0123-proximity-precision.html | 6 +++--- .../text/0123-ranking-rules-setting-api.html | 6 +++--- .../text/0123-searchable-attributes-setting-api.html | 6 +++--- .../specifications/text/0123-separators-settings-api.html | 6 +++--- docs/specifications/text/0123-settings-api.html | 6 +++--- .../text/0123-sortable-attributes-setting-api.html | 6 +++--- docs/specifications/text/0123-stop-words-setting-api.html | 6 +++--- docs/specifications/text/0123-synonyms-setting-api.html | 6 +++--- .../text/0123-user-dictionary-settings-api.html | 6 +++--- docs/specifications/text/0124-documents-api.html | 6 +++--- docs/specifications/text/0132-indexes-api.html | 6 +++--- docs/specifications/text/0134-stats-api.html | 6 +++--- docs/specifications/text/0135-indexing-json.html | 6 +++--- .../specifications/text/0136-documents-soft-deletion.html | 6 +++--- docs/specifications/text/0171-version-api.html | 6 +++--- docs/specifications/text/0172-health-api.html | 6 +++--- docs/specifications/text/0174-metrics-api.html | 6 +++--- docs/specifications/text/0178-compression-headers.html | 6 +++--- docs/specifications/text/0185-configuration-file.html | 6 +++--- docs/specifications/text/0191-swap-indexes-api.html | 6 +++--- docs/specifications/text/0192-multi-search-api.html | 6 +++--- docs/specifications/text/0193-experimental-features.html | 6 +++--- .../text/0194-experimental-feature-api.html | 6 +++--- docs/specifications/text/0195-ranking-score.html | 6 +++--- docs/specifications/text/0246-facet-search-api.html | 6 +++--- docs/specifications/text/0258-snapshots-api.html | 6 +++--- docs/specifications/text/0262-task-queue-webhook.html | 6 +++--- docs/specifications/text/157-faceting-setting-api.html | 6 +++--- docs/specifications/text/157-pagination-setting-api.html | 6 +++--- 96 files changed, 222 insertions(+), 222 deletions(-) rename docs/assets/css/{0.styles.e3743cd1.css => 0.styles.172d2b38.css} (97%) rename docs/assets/js/{10.4bb9eeac.js => 10.7104dc1c.js} (98%) rename docs/assets/js/{11.07634795.js => 11.7b4d52ff.js} (96%) rename docs/assets/js/{13.5ee4202d.js => 13.167021d3.js} (98%) rename docs/assets/js/{14.9305fa09.js => 14.acdd32fb.js} (99%) rename docs/assets/js/{15.095125b3.js => 15.3f1414b9.js} (99%) rename docs/assets/js/{20.fb03e236.js => 20.fe442e43.js} (98%) rename docs/assets/js/{21.5d4e271d.js => 21.01b56736.js} (99%) rename docs/assets/js/{22.9d7baf38.js => 22.a9f2f84c.js} (98%) rename docs/assets/js/{23.06e68601.js => 23.582f3200.js} (97%) rename docs/assets/js/{24.95542534.js => 24.2234005f.js} (99%) rename docs/assets/js/{25.96849fe5.js => 25.c49340ab.js} (99%) rename docs/assets/js/{28.41999e7c.js => 28.d2c2cee7.js} (97%) rename docs/assets/js/{29.a05f4317.js => 29.239d404a.js} (99%) rename docs/assets/js/{32.88319e61.js => 32.bac37d5d.js} (99%) rename docs/assets/js/{33.91d80bc8.js => 33.63b5ee32.js} (99%) rename docs/assets/js/{38.de46d18d.js => 38.651ab4ec.js} (99%) rename docs/assets/js/{39.c0e59772.js => 39.3ffdfa45.js} (99%) rename docs/assets/js/{4.f57bbccf.js => 4.aaee11b0.js} (50%) rename docs/assets/js/{43.af7cbf45.js => 43.1901f806.js} (99%) rename docs/assets/js/{44.97d19d44.js => 44.437489b6.js} (99%) rename docs/assets/js/{46.9f9d4a1b.js => 46.7f495a96.js} (99%) rename docs/assets/js/{47.49c151b7.js => 47.bf881f32.js} (99%) rename docs/assets/js/{5.2065d417.js => 5.689b79cc.js} (64%) rename docs/assets/js/{50.e4b54756.js => 50.dcf47d3d.js} (99%) rename docs/assets/js/{52.c36008c5.js => 52.55ac3382.js} (99%) rename docs/assets/js/{56.a3d19c35.js => 56.dfe45e94.js} (99%) rename docs/assets/js/{57.4dbfa071.js => 57.6e1d5d7b.js} (97%) rename docs/assets/js/{59.79acfddd.js => 59.a3757b9e.js} (99%) rename docs/assets/js/{6.87f02c74.js => 6.96405132.js} (87%) rename docs/assets/js/{62.057cf3e0.js => 62.3ac8f506.js} (98%) rename docs/assets/js/{63.d21ecbad.js => 63.39c14cc1.js} (99%) rename docs/assets/js/{9.0c014273.js => 9.0238d3e6.js} (93%) rename docs/assets/js/{app.6fb12f44.js => app.dedba9e9.js} (80%) diff --git a/docs/404.html b/docs/404.html index d5e33dd39..3e45fb724 100644 --- a/docs/404.html +++ b/docs/404.html @@ -8,13 +8,13 @@ - - + + -

404

Looks like we've got some broken links.
+ - + diff --git a/docs/assets/css/0.styles.e3743cd1.css b/docs/assets/css/0.styles.172d2b38.css similarity index 97% rename from docs/assets/css/0.styles.e3743cd1.css rename to docs/assets/css/0.styles.172d2b38.css index 9a14e5f3c..3181c3690 100644 --- a/docs/assets/css/0.styles.e3743cd1.css +++ b/docs/assets/css/0.styles.172d2b38.css @@ -1 +1 @@ -code[class*=language-],pre[class*=language-]{color:#ccc;background:none;font-family:Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-ms-hyphens:none;hyphens:none}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#2d2d2d}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.block-comment,.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#999}.token.punctuation{color:#ccc}.token.attr-name,.token.deleted,.token.namespace,.token.tag{color:#e2777a}.token.function-name{color:#6196cc}.token.boolean,.token.function,.token.number{color:#f08d49}.token.class-name,.token.constant,.token.property,.token.symbol{color:#f8c555}.token.atrule,.token.builtin,.token.important,.token.keyword,.token.selector{color:#cc99cd}.token.attr-value,.token.char,.token.regex,.token.string,.token.variable{color:#7ec699}.token.entity,.token.operator,.token.url{color:#67cdcc}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.token.inserted{color:green}.theme-default-content code{color:#476582;padding:.25rem .5rem;margin:0;font-size:.85em;background-color:rgba(27,31,35,.05);border-radius:3px}.theme-default-content code .token.deleted{color:#ec5975}.theme-default-content code .token.inserted{color:#3eaf7c}.theme-default-content pre,.theme-default-content pre[class*=language-]{line-height:1.4;padding:1.25rem 1.5rem;margin:.85rem 0;background-color:#282c34;border-radius:6px;overflow:auto}.theme-default-content pre[class*=language-] code,.theme-default-content pre code{color:#fff;padding:0;background-color:transparent;border-radius:0}div[class*=language-]{position:relative;background-color:#282c34;border-radius:6px}div[class*=language-] .highlight-lines{-webkit-user-select:none;user-select:none;padding-top:1.3rem;position:absolute;top:0;left:0;width:100%;line-height:1.4}div[class*=language-] .highlight-lines .highlighted{background-color:rgba(0,0,0,.66)}div[class*=language-] pre,div[class*=language-] pre[class*=language-]{background:transparent;position:relative;z-index:1}div[class*=language-]:before{position:absolute;z-index:3;top:.8em;right:1em;font-size:.75rem;color:hsla(0,0%,100%,.4)}div[class*=language-]:not(.line-numbers-mode) .line-numbers-wrapper{display:none}div[class*=language-].line-numbers-mode .highlight-lines .highlighted{position:relative}div[class*=language-].line-numbers-mode .highlight-lines .highlighted:before{content:" ";position:absolute;z-index:3;left:0;top:0;display:block;width:3.5rem;height:100%;background-color:rgba(0,0,0,.66)}div[class*=language-].line-numbers-mode pre{padding-left:4.5rem;vertical-align:middle}div[class*=language-].line-numbers-mode .line-numbers-wrapper{position:absolute;top:0;width:3.5rem;text-align:center;color:hsla(0,0%,100%,.3);padding:1.25rem 0;line-height:1.4}div[class*=language-].line-numbers-mode .line-numbers-wrapper br{-webkit-user-select:none;user-select:none}div[class*=language-].line-numbers-mode .line-numbers-wrapper .line-number{position:relative;z-index:4;-webkit-user-select:none;user-select:none;font-size:.85em}div[class*=language-].line-numbers-mode:after{content:"";position:absolute;z-index:2;top:0;left:0;width:3.5rem;height:100%;border-radius:6px 0 0 6px;border-right:1px solid rgba(0,0,0,.66);background-color:#282c34}div[class~=language-js]:before{content:"js"}div[class~=language-ts]:before{content:"ts"}div[class~=language-html]:before{content:"html"}div[class~=language-md]:before{content:"md"}div[class~=language-vue]:before{content:"vue"}div[class~=language-css]:before{content:"css"}div[class~=language-sass]:before{content:"sass"}div[class~=language-scss]:before{content:"scss"}div[class~=language-less]:before{content:"less"}div[class~=language-stylus]:before{content:"stylus"}div[class~=language-go]:before{content:"go"}div[class~=language-java]:before{content:"java"}div[class~=language-c]:before{content:"c"}div[class~=language-sh]:before{content:"sh"}div[class~=language-yaml]:before{content:"yaml"}div[class~=language-py]:before{content:"py"}div[class~=language-docker]:before{content:"docker"}div[class~=language-dockerfile]:before{content:"dockerfile"}div[class~=language-makefile]:before{content:"makefile"}div[class~=language-javascript]:before{content:"js"}div[class~=language-typescript]:before{content:"ts"}div[class~=language-markup]:before{content:"html"}div[class~=language-markdown]:before{content:"md"}div[class~=language-json]:before{content:"json"}div[class~=language-ruby]:before{content:"rb"}div[class~=language-python]:before{content:"py"}div[class~=language-bash]:before{content:"sh"}div[class~=language-php]:before{content:"php"}.custom-block .custom-block-title{font-weight:600;margin-bottom:-.4rem}.custom-block.danger,.custom-block.tip,.custom-block.warning{padding:.1rem 1.5rem;border-left-width:.5rem;border-left-style:solid;margin:1rem 0}.custom-block.tip{background-color:#f3f5f7;border-color:#42b983}.custom-block.warning{background-color:rgba(255,229,100,.3);border-color:#e7c000;color:#6b5900}.custom-block.warning .custom-block-title{color:#b29400}.custom-block.warning a{color:#2c3e50}.custom-block.danger{background-color:#ffe6e6;border-color:#c00;color:#4d0000}.custom-block.danger .custom-block-title{color:#900}.custom-block.danger a{color:#2c3e50}.custom-block.details{display:block;position:relative;border-radius:2px;margin:1.6em 0;padding:1.6em;background-color:#eee}.custom-block.details h4{margin-top:0}.custom-block.details figure:last-child,.custom-block.details p:last-child{margin-bottom:0;padding-bottom:0}.custom-block.details summary{outline:none;cursor:pointer}.arrow{display:inline-block;width:0;height:0}.arrow.up{border-bottom:6px solid #ccc}.arrow.down,.arrow.up{border-left:4px solid transparent;border-right:4px solid transparent}.arrow.down{border-top:6px solid #ccc}.arrow.right{border-left:6px solid #ccc}.arrow.left,.arrow.right{border-top:4px solid transparent;border-bottom:4px solid transparent}.arrow.left{border-right:6px solid #ccc}.theme-default-content:not(.custom){max-width:740px;margin:0 auto;padding:2rem 2.5rem}@media (max-width:959px){.theme-default-content:not(.custom){padding:2rem}}@media (max-width:419px){.theme-default-content:not(.custom){padding:1.5rem}}.table-of-contents .badge{vertical-align:middle}body,html{padding:0;margin:0;background-color:#fff}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:16px;color:#2c3e50}.page{padding-left:20rem}.navbar{z-index:20;right:0;height:3.6rem;background-color:#fff;box-sizing:border-box;border-bottom:1px solid #eaecef}.navbar,.sidebar-mask{position:fixed;top:0;left:0}.sidebar-mask{z-index:9;width:100vw;height:100vh;display:none}.sidebar{font-size:16px;background-color:#fff;width:20rem;position:fixed;z-index:10;margin:0;top:3.6rem;left:0;bottom:0;box-sizing:border-box;border-right:1px solid #eaecef;overflow-y:auto}.theme-default-content:not(.custom)>:first-child{margin-top:3.6rem}.theme-default-content:not(.custom) a:hover{text-decoration:underline}.theme-default-content:not(.custom) p.demo{padding:1rem 1.5rem;border:1px solid #ddd;border-radius:4px}.theme-default-content:not(.custom) img{max-width:100%}.theme-default-content.custom{padding:0;margin:0}.theme-default-content.custom img{max-width:100%}a{font-weight:500;text-decoration:none}a,p a code{color:#3eaf7c}p a code{font-weight:400}kbd{background:#eee;border:.15rem solid #ddd;border-bottom:.25rem solid #ddd;border-radius:.15rem;padding:0 .15em}blockquote{font-size:1rem;color:#999;border-left:.2rem solid #dfe2e5;margin:1rem 0;padding:.25rem 0 .25rem 1rem}blockquote>p{margin:0}ol,ul{padding-left:1.2em}strong{font-weight:600}h1,h2,h3,h4,h5,h6{font-weight:600;line-height:1.25}.theme-default-content:not(.custom)>h1,.theme-default-content:not(.custom)>h2,.theme-default-content:not(.custom)>h3,.theme-default-content:not(.custom)>h4,.theme-default-content:not(.custom)>h5,.theme-default-content:not(.custom)>h6{margin-top:-3.1rem;padding-top:4.6rem;margin-bottom:0}.theme-default-content:not(.custom)>h1:first-child,.theme-default-content:not(.custom)>h2:first-child,.theme-default-content:not(.custom)>h3:first-child,.theme-default-content:not(.custom)>h4:first-child,.theme-default-content:not(.custom)>h5:first-child,.theme-default-content:not(.custom)>h6:first-child{margin-top:-1.5rem;margin-bottom:1rem}.theme-default-content:not(.custom)>h1:first-child+.custom-block,.theme-default-content:not(.custom)>h1:first-child+p,.theme-default-content:not(.custom)>h1:first-child+pre,.theme-default-content:not(.custom)>h2:first-child+.custom-block,.theme-default-content:not(.custom)>h2:first-child+p,.theme-default-content:not(.custom)>h2:first-child+pre,.theme-default-content:not(.custom)>h3:first-child+.custom-block,.theme-default-content:not(.custom)>h3:first-child+p,.theme-default-content:not(.custom)>h3:first-child+pre,.theme-default-content:not(.custom)>h4:first-child+.custom-block,.theme-default-content:not(.custom)>h4:first-child+p,.theme-default-content:not(.custom)>h4:first-child+pre,.theme-default-content:not(.custom)>h5:first-child+.custom-block,.theme-default-content:not(.custom)>h5:first-child+p,.theme-default-content:not(.custom)>h5:first-child+pre,.theme-default-content:not(.custom)>h6:first-child+.custom-block,.theme-default-content:not(.custom)>h6:first-child+p,.theme-default-content:not(.custom)>h6:first-child+pre{margin-top:2rem}h1:focus .header-anchor,h1:hover .header-anchor,h2:focus .header-anchor,h2:hover .header-anchor,h3:focus .header-anchor,h3:hover .header-anchor,h4:focus .header-anchor,h4:hover .header-anchor,h5:focus .header-anchor,h5:hover .header-anchor,h6:focus .header-anchor,h6:hover .header-anchor{opacity:1}h1{font-size:2.2rem}h2{font-size:1.65rem;padding-bottom:.3rem;border-bottom:1px solid #eaecef}h3{font-size:1.35rem}a.header-anchor{font-size:.85em;float:left;margin-left:-.87em;padding-right:.23em;margin-top:.125em;opacity:0}a.header-anchor:focus,a.header-anchor:hover{text-decoration:none}.line-number,code,kbd{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace}ol,p,ul{line-height:1.7}hr{border:0;border-top:1px solid #eaecef}table{border-collapse:collapse;margin:1rem 0;display:block;overflow-x:auto}tr{border-top:1px solid #dfe2e5}tr:nth-child(2n){background-color:#f6f8fa}td,th{border:1px solid #dfe2e5;padding:.6em 1em}.theme-container.sidebar-open .sidebar-mask{display:block}.theme-container.no-navbar .theme-default-content:not(.custom)>h1,.theme-container.no-navbar h2,.theme-container.no-navbar h3,.theme-container.no-navbar h4,.theme-container.no-navbar h5,.theme-container.no-navbar h6{margin-top:1.5rem;padding-top:0}.theme-container.no-navbar .sidebar{top:0}@media (min-width:720px){.theme-container.no-sidebar .sidebar{display:none}.theme-container.no-sidebar .page{padding-left:0}}@media (max-width:959px){.sidebar{font-size:15px;width:16.4rem}.page{padding-left:16.4rem}}@media (max-width:719px){.sidebar{top:0;padding-top:3.6rem;transform:translateX(-100%);transition:transform .2s ease}.page{padding-left:0}.theme-container.sidebar-open .sidebar{transform:translateX(0)}.theme-container.no-navbar .sidebar{padding-top:0}}@media (max-width:419px){h1{font-size:1.9rem}.theme-default-content div[class*=language-]{margin:.85rem -1.5rem;border-radius:0}}:root{--accentColor:#3eaf7c;--textColor:#2c3e50;--borderColor:#eaecef;--codeBgColor:#282c34;--arrowBgColor:#ccc;--badgeTipColor:#42b983;--badgeWarningColor:#e7c000;--badgeErrorColor:#da5961;--bgColor:#fff;--kbdBgColor:#eee;--blockquoteTextColor:#999;--blockquoteBorderColor:#dfe2e5;--tableBorderColor:#dfe2e5;--tableStripeBgColor:#f6f8fa;--preTextColor:#fff;--highlightedBgColor:rgba(0,0,0,0.66);--languageTextColor:hsla(0,0%,100%,0.4);--lineNumbersColor:hsla(0,0%,100%,0.3);--tipColor:#2c3e50;--tipBgColor:#f3f5f7;--warningColor:#e7c000;--warningBgColor:rgba(255,229,100,0.3);--dangerColor:#c00;--dangerBgColor:#ffe6e6;--miniCodeBgColor:rgba(27,31,35,0.05);--searchBorderColor:#999;--lighten10AccentColor:#4abf8a;--lighten10TextColor:#3a5169;--lighten20TextColor:#476582;--lighten25TextColor:#4e6e8e;--lighten35TextColor:#5d82a6;--lighten40TextColor:#6a8bad;--darken10AccentColor:#389d70;--darken10BgColor:#f2f2f2;--darken10BorderColor:#cfd4db}@media (prefers-color-scheme:light){:root{--codeBgColor:#f8f8f8;--preTextColor:#4d4d4d;--highlightedBgColor:hsla(0,0%,87.8%,0.5);--languageTextColor:rgba(0,0,0,0.4);--lineNumbersColor:rgba(0,0,0,0.3)}}@media (prefers-color-scheme:dark){:root{--accentColor:#a29bfe;--textColor:#eaeaea;--borderColor:#545f66;--arrowBgColor:#ccc;--badgeTipColor:#42b983;--badgeWarningColor:#e7c000;--badgeErrorColor:#da5961;--bgColor:#25272a;--kbdBgColor:#444;--blockquoteTextColor:#eee;--blockquoteBorderColor:#666b6f;--tableBorderColor:#4e4e4e;--tableStripeBgColor:#444;--tipColor:#e2e2e2;--tipBgColor:#3e3b3b;--warningColor:#e7c000;--warningBgColor:rgba(185,174,119,0.3);--dangerColor:#c00;--dangerBgColor:rgba(72,56,57,0.3);--miniCodeBgColor:hsla(0,0%,100%,0.1);--searchBorderColor:#eee;--lighten10AccentColor:#aba5fe;--lighten10TextColor:#ececec;--lighten20TextColor:#eee;--lighten25TextColor:#efefef;--lighten35TextColor:#f1f1f1;--lighten40TextColor:#f2f2f2;--darken10AccentColor:#7c73fe;--darken10BgColor:#2f3235;--darken10BorderColor:#4c565c}}html[theme=light]{--accentColor:#3eaf7c;--textColor:#2c3e50;--borderColor:#eaecef;--codeBgColor:#f8f8f8;--bgColor:#fff;--kbdBgColor:#eee;--blockquoteTextColor:#999;--blockquoteBorderColor:#dfe2e5;--tableBorderColor:#dfe2e5;--tableStripeBgColor:#f6f8fa;--preTextColor:#4d4d4d;--highlightedBgColor:hsla(0,0%,87.8%,0.5);--languageTextColor:rgba(0,0,0,0.4);--lineNumbersColor:rgba(0,0,0,0.3);--tipColor:#2c3e50;--tipBgColor:#f3f5f7;--warningBgColor:rgba(255,229,100,0.3);--dangerBgColor:#ffe6e6;--miniCodeBgColor:rgba(27,31,35,0.05);--searchBorderColor:#999;--lighten10AccentColor:#4abf8a;--lighten10TextColor:#3a5169;--lighten20TextColor:#476582;--lighten25TextColor:#4e6e8e;--lighten35TextColor:#5d82a6;--lighten40TextColor:#6a8bad;--darken10AccentColor:#389d70;--darken10BgColor:#f2f2f2;--darken10BorderColor:#cfd4db}html[theme=dark],html[theme=light]{--arrowBgColor:#ccc;--badgeTipColor:#42b983;--badgeWarningColor:#e7c000;--badgeErrorColor:#da5961;--warningColor:#e7c000;--dangerColor:#c00}html[theme=dark]{--accentColor:#a29bfe;--textColor:#eaeaea;--borderColor:#545f66;--codeBgColor:#282c34;--bgColor:#25272a;--kbdBgColor:#444;--blockquoteTextColor:#eee;--blockquoteBorderColor:#666b6f;--tableBorderColor:#4e4e4e;--tableStripeBgColor:#444;--preTextColor:#fff;--highlightedBgColor:rgba(0,0,0,0.66);--languageTextColor:hsla(0,0%,100%,0.4);--lineNumbersColor:hsla(0,0%,100%,0.3);--tipColor:#e2e2e2;--tipBgColor:#3e3b3b;--warningBgColor:rgba(185,174,119,0.3);--dangerBgColor:rgba(72,56,57,0.3);--miniCodeBgColor:hsla(0,0%,100%,0.1);--searchBorderColor:#eee;--lighten10AccentColor:#aba5fe;--lighten10TextColor:#ececec;--lighten20TextColor:#eee;--lighten25TextColor:#efefef;--lighten35TextColor:#f1f1f1;--lighten40TextColor:#f2f2f2;--darken10AccentColor:#7c73fe;--darken10BgColor:#232528;--darken10BorderColor:#4c565c}.navbar,.sidebar,body,html{background-color:var(--bgColor)}body{color:var(--textColor)}.navbar,h2{border-bottom-color:var(--borderColor)}.sidebar{border-right-color:var(--borderColor)}.theme-default-content:not(.custom) p.demo,kbd{border-color:var(--borderColor)}kbd{background:var(--kbdBgColor)}blockquote{color:var(--blockquoteTextColor);border-left-color:var(--blockquoteBorderColor)}a,p a code{color:var(--accentColor)}hr{border-top-color:var(--borderColor)}tr{border-top-color:var(--tableBorderColor)}tr:nth-child(2n){background-color:var(--tableStripeBgColor)}td,th{border-color:var(--tableBorderColor)}.arrow.up{border-bottom-color:var(--arrowBgColor)}.arrow.down{border-top-color:var(--arrowBgColor)}.arrow.left,.arrow.right,border-left-color var(--arrowBgColor){border-right-color:var(--arrowBgColor)}.theme-default-content code{color:var(--lighten20TextColor);background-color:var(--miniCodeBgColor)}.theme-default-content code .token.inserted{color:var(--accentColor)}.theme-default-content code .token.punctuation{color:var(--preTextColor)}.theme-default-content pre[class*=language-],div[class*=language-],div[class*=language-].line-numbers-mode:after{background-color:var(--codeBgColor)}.theme-default-content pre[class*=language-] code,.theme-default-content pre code{color:var(--preTextColor)}div[class*=language-] .highlight-lines .highlighted,div[class*=language-].line-numbers-mode .highlight-lines .highlighted:before{background-color:var(--highlightedBgColor)}div[class*=language-].line-numbers-mode:after{background-color:var(--codeBgColor);border-right-color:var(--highlightedBgColor)}div[class*=language-]:before{color:var(--languageTextColor)}div[class*=language-].line-numbers-mode .line-numbers-wrapper{color:var(--lineNumbersColor)}.theme-code-block>pre,.theme-code-group .theme-code-group__nav{background-color:var(--codeBgColor)!important}.theme-code-group .theme-code-group__nav .theme-code-group__nav-tab{color:var(--textColor)!important}.theme-code-group .theme-code-group__nav .theme-code-group__nav-tab-active{border-color:var(--accentColor)!important}.custom-block.tip{border-color:var(--badgeTipColor);background-color:var(--tipBgColor)}.custom-block.tip .custom-block-title,.custom-block.tip a{color:var(--tipColor)}.custom-block.warning{border-color:var(--badgeWarningColor);background-color:var(--warningBgColor)}.custom-block.warning .custom-block-title,.custom-block.warning a{color:var(--warningColor)}.custom-block.danger{border-color:var(--badgeErrorColor);background-color:var(--dangerBgColor)}.custom-block.danger .custom-block-title,.custom-block.danger a{color:var(--dangerColor)}.custom-block.danger,.custom-block.warning{color:var(--textColor)}.custom-block.details{background-color:var(--tipBgColor)}.badge,.badge.green,.badge.tip{background-color:var(--badgeTipColor)!important}.badge.error{background-color:var(--badgeErrorColor)!important}.badge.warn,.badge.warning,.badge.yellow{background-color:var(--badgeWarningColor)!important}.global-ui .sw-update-popup{border-color:var(--accentColor)!important;background-color:var(--bgColor)!important;color:var(--textColor)!important}.global-ui .sw-update-popup button{border-color:var(--darken10AccentColor)!important;background-color:var(--accentColor)!important;color:#fff!important}.global-ui .sw-update-popup button:hover{background-color:var(--lighten10AccentColor)!important}@media (min-width:719px){::-webkit-scrollbar{max-width:6px;max-height:12px}::-webkit-scrollbar-thumb{background-color:var(--languageTextColor);border-radius:6px}}#nprogress{pointer-events:none}#nprogress .bar{background:#3eaf7c;position:fixed;z-index:1031;top:0;left:0;width:100%;height:2px}#nprogress .peg{display:block;position:absolute;right:0;width:100px;height:100%;box-shadow:0 0 10px #3eaf7c,0 0 5px #3eaf7c;opacity:1;transform:rotate(3deg) translateY(-4px)}#nprogress .spinner{display:block;position:fixed;z-index:1031;top:15px;right:15px}#nprogress .spinner-icon{width:18px;height:18px;box-sizing:border-box;border-color:#3eaf7c transparent transparent #3eaf7c;border-style:solid;border-width:2px;border-radius:50%;-webkit-animation:nprogress-spinner .4s linear infinite;animation:nprogress-spinner .4s linear infinite}.nprogress-custom-parent{overflow:hidden;position:relative}.nprogress-custom-parent #nprogress .bar,.nprogress-custom-parent #nprogress .spinner{position:absolute}@-webkit-keyframes nprogress-spinner{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes nprogress-spinner{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.icon.outbound{color:#aaa;display:inline-block;vertical-align:middle;position:relative;top:-1px}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.home{padding:3.6rem 2rem 0;max-width:960px;margin:0 auto;display:block}.home .hero{text-align:center}.home .hero img{max-width:100%;max-height:280px;display:block;margin:3rem auto 1.5rem}.home .hero h1{font-size:3rem}.home .hero .action,.home .hero .description,.home .hero h1{margin:1.8rem auto}.home .hero .description{max-width:35rem;font-size:1.6rem;line-height:1.3;color:#6a8bad}.home .hero .action-button{display:inline-block;font-size:1.2rem;color:#fff;background-color:#3eaf7c;padding:.8rem 1.6rem;border-radius:4px;transition:background-color .1s ease;box-sizing:border-box;border-bottom:1px solid #389d70}.home .hero .action-button:hover{background-color:#4abf8a}.home .features{border-top:1px solid #eaecef;padding:1.2rem 0;margin-top:2.5rem;display:flex;flex-wrap:wrap;align-items:flex-start;align-content:stretch;justify-content:space-between}.home .feature{flex-grow:1;flex-basis:30%;max-width:30%}.home .feature h2{font-size:1.4rem;font-weight:500;border-bottom:none;padding-bottom:0;color:#3a5169}.home .feature p{color:#4e6e8e}.home .footer{padding:2.5rem;border-top:1px solid #eaecef;text-align:center;color:#4e6e8e}@media (max-width:719px){.home .features{flex-direction:column}.home .feature{max-width:100%;padding:0 2.5rem}}@media (max-width:419px){.home{padding-left:1.5rem;padding-right:1.5rem}.home .hero img{max-height:210px;margin:2rem auto 1.2rem}.home .hero h1{font-size:2rem}.home .hero .action,.home .hero .description,.home .hero h1{margin:1.2rem auto}.home .hero .description{font-size:1.2rem}.home .hero .action-button{font-size:1rem;padding:.6rem 1.2rem}.home .feature h2{font-size:1.25rem}}.meilisearch-search-wrapper{display:inline-block;position:relative;margin-right:1rem}.meilisearch-search-wrapper>div>span{vertical-align:middle}.meilisearch-search-wrapper .dsb-cursor{background:rgba(62,175,124,.05)}.meilisearch-search-wrapper .meilisearch-autocomplete{line-height:2}.meilisearch-search-wrapper .meilisearch-autocomplete input{cursor:text;width:10rem;height:2rem;color:#4e6e8e;display:inline-block;border:1px solid #cfd4db;border-radius:2rem;font-size:.9rem;line-height:2rem;padding:0 .5rem 0 2rem;outline:none;transition:all .2s ease;background:#fff url(/assets/img/search.83621669.svg) .6rem .5rem no-repeat;background-size:1rem}.meilisearch-search-wrapper .meilisearch-autocomplete input:focus{cursor:auto;border-color:#3eaf7c}.meilisearch-search-wrapper .meilisearch-autocomplete .docs-searchbar-suggestion:not(.suggestion-layout-simple){border-color:#eaecef}.meilisearch-search-wrapper .meilisearch-autocomplete .docs-searchbar-suggestion:not(.suggestion-layout-simple) .docs-searchbar-suggestion--category-header{background:#f1f3f5;padding:5px 10px;border-radius:4px;background:#5ec697;font-weight:600;color:#fff}.meilisearch-search-wrapper .meilisearch-autocomplete .docs-searchbar-suggestion:not(.suggestion-layout-simple) .docs-searchbar-suggestion--category-header .docs-searchbar-suggestion--highlight{box-shadow:none;background:#c3ead8}.meilisearch-search-wrapper .meilisearch-autocomplete .docs-searchbar-suggestion:not(.suggestion-layout-simple) .docs-searchbar-suggestion--wrapper{display:flex;padding:0}.meilisearch-search-wrapper .meilisearch-autocomplete .docs-searchbar-suggestion:not(.suggestion-layout-simple) .docs-searchbar-suggestion--wrapper .docs-searchbar-suggestion--highlight{color:#328c63}.meilisearch-search-wrapper .meilisearch-autocomplete .docs-searchbar-suggestion:not(.suggestion-layout-simple) .docs-searchbar-suggestion--title{margin-bottom:0;color:#2c3e50}.meilisearch-search-wrapper .meilisearch-autocomplete .docs-searchbar-suggestion:not(.suggestion-layout-simple) .docs-searchbar-suggestion--subcategory-column{border-color:#eaecef}.meilisearch-search-wrapper .meilisearch-autocomplete .docs-searchbar-suggestion:not(.suggestion-layout-simple) .docs-searchbar-suggestion--subcategory-column-text{color:#555}.meilisearch-search-wrapper .meilisearch-autocomplete .docs-searchbar-suggestion:not(.suggestion-layout-simple) .docs-searchbar-suggestion--text .docs-searchbar-suggestion--highlight{box-shadow:inset 0 -2px 0 0 #5ec697;color:inherit}.meilisearch-search-wrapper .meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--title{color:#3eaf7c}.meilisearch-search-wrapper .meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--title:before{color:#328c63}.meilisearch-search-wrapper .meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--category-header .docs-searchbar-suggestion--highlight{box-shadow:unset;color:#328c63;background-color:rgba(62,175,124,.05)}.meilisearch-search-wrapper .meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--category-header-lvl0 .docs-searchbar-suggestion--highlight,.meilisearch-search-wrapper .meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--category-header-lvl1 .docs-searchbar-suggestion--highlight{background-color:transparent;box-shadow:inset 0 -2px 0 0 #5ec697;color:inherit}.meilisearch-search-wrapper .meilisearch-autocomplete .docs-searchbar-footer{display:flex!important;justify-content:space-between!important;align-items:center!important}.meilisearch-search-wrapper .meilisearch-autocomplete .docs-searchbar-footer .docs-searchbar-footer-logo{margin-bottom:-4px}.meilisearch-search-wrapper .meilisearch-autocomplete .dsb-cursor .docs-searchbar-suggestion--content{background-color:#e7edf3;color:#2c3e50}.meilisearch-search-wrapper div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion,.meilisearch-search-wrapper div[data-ds-theme=dark] .meilisearch-autocomplete .dsb-dropdown-menu [class^=dsb-dataset-]{background:#333a3e}.meilisearch-search-wrapper div[data-ds-theme=dark] .meilisearch-autocomplete input{color:#eaeaea;border:1px solid #545f66;background-color:#444d52}.meilisearch-search-wrapper div[data-ds-theme=dark] .meilisearch-autocomplete input:focus{border-color:#a29bfe}.meilisearch-search-wrapper div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion:not(.suggestion-layout-simple){border-color:#545f66}.meilisearch-search-wrapper div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion:not(.suggestion-layout-simple) .docs-searchbar-suggestion--wrapper .docs-searchbar-suggestion--highlight{color:#a29bfe}.meilisearch-search-wrapper div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion:not(.suggestion-layout-simple) .docs-searchbar-suggestion--category-header{background:#a29bfe}.meilisearch-search-wrapper div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion:not(.suggestion-layout-simple) .docs-searchbar-suggestion--category-header .docs-searchbar-suggestion--highlight{background:#b5affe}.meilisearch-search-wrapper div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion:not(.suggestion-layout-simple) .docs-searchbar-suggestion--title{color:#eaeaea}.meilisearch-search-wrapper div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion:not(.suggestion-layout-simple) .docs-searchbar-suggestion--subcategory-column{border-color:#545f66}.meilisearch-search-wrapper div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion:not(.suggestion-layout-simple) .docs-searchbar-suggestion--subcategory-column-text{color:#eaeaea}.meilisearch-search-wrapper div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion:not(.suggestion-layout-simple) .docs-searchbar-suggestion--text .docs-searchbar-suggestion--highlight{box-shadow:inset 0 -2px 0 0 #b5affe}.meilisearch-search-wrapper div[data-ds-theme=dark] .meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--category-header .docs-searchbar-suggestion--category-header-lvl0 .docs-searchbar-suggestion--highlight,.meilisearch-search-wrapper div[data-ds-theme=dark] .meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--category-header .docs-searchbar-suggestion--category-header-lvl1 .docs-searchbar-suggestion--highlight{box-shadow:inset 0 -2px 0 0 #7c73fe}.meilisearch-search-wrapper div[data-ds-theme=dark] .meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--category-header .docs-searchbar-suggestion--title .docs-searchbar-suggestion--highlight{color:#b5affe;background:rgba(162,155,254,.1)}.meilisearch-search-wrapper div[data-ds-theme=dark] .meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--category-header-lvl0 .docs-searchbar-suggestion--highlight,.meilisearch-search-wrapper div[data-ds-theme=dark] .meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--category-header-lvl1 .docs-searchbar-suggestion--highlight{color:inherit}.meilisearch-search-wrapper div[data-ds-theme=dark] .meilisearch-autocomplete .dsb-dropdown-menu .dsb-suggestions .dsb-cursor .docs-searchbar-suggestion.suggestion-layout-simple,.meilisearch-search-wrapper div[data-ds-theme=dark] .meilisearch-autocomplete .dsb-dropdown-menu .dsb-suggestions .dsb-cursor .docs-searchbar-suggestion:not(.suggestion-layout-simple) .docs-searchbar-suggestion--content{background-color:rgba(162,155,254,.3)}@media (min-width:719px){.meilisearch-search-wrapper .meilisearch-autocomplete .docs-searchbar-suggestion .docs-searchbar-suggestion--subcategory-column{float:none;width:150px;min-width:150px;display:table-cell}.meilisearch-search-wrapper .meilisearch-autocomplete .docs-searchbar-suggestion .docs-searchbar-suggestion--content{float:none;display:table-cell;width:100%;vertical-align:top}.meilisearch-search-wrapper .meilisearch-autocomplete .docs-searchbar-suggestion .dsb-dropdown-menu{min-width:515px!important}}@media (max-width:719px){.meilisearch-search-wrapper .dsb-dropdown-menu{min-width:calc(100vw - 4rem)!important;max-width:calc(100vw - 4rem)!important}.meilisearch-search-wrapper .docs-searchbar-suggestion--wrapper{padding:5px 7px 5px 5px!important}.meilisearch-search-wrapper .docs-searchbar-suggestion--subcategory-column{padding:0!important;background:#fff!important}.meilisearch-search-wrapper .docs-searchbar-suggestion--subcategory-column-text:after{content:" > ";font-size:10px;line-height:14.4px;display:inline-block;width:5px;margin:-3px 3px 0;vertical-align:middle}.meilisearch-search-wrapper div[data-ds-theme=dark] .docs-searchbar-suggestion--subcategory-column{background:transparent!important}}.sidebar-button{cursor:pointer;display:none;width:1.25rem;height:1.25rem;position:absolute;padding:.6rem;top:.6rem;left:1rem}.sidebar-button .icon{display:block;width:1.25rem;height:1.25rem}@media (max-width:719px){.sidebar-button{display:block}}.dropdown-enter,.dropdown-leave-to{height:0!important}.dropdown-wrapper{cursor:pointer}.dropdown-wrapper .dropdown-title,.dropdown-wrapper .mobile-dropdown-title{display:block;font-size:.9rem;font-family:inherit;cursor:inherit;padding:inherit;line-height:1.4rem;background:transparent;border:none;font-weight:500;color:#2c3e50}.dropdown-wrapper .dropdown-title:hover,.dropdown-wrapper .mobile-dropdown-title:hover{border-color:transparent}.dropdown-wrapper .dropdown-title .arrow,.dropdown-wrapper .mobile-dropdown-title .arrow{vertical-align:middle;margin-top:-1px;margin-left:.4rem}.dropdown-wrapper .mobile-dropdown-title{display:none;font-weight:600}.dropdown-wrapper .mobile-dropdown-title font-size inherit:hover{color:#3eaf7c}.dropdown-wrapper .nav-dropdown .dropdown-item{color:inherit;line-height:1.7rem}.dropdown-wrapper .nav-dropdown .dropdown-item h4{margin:.45rem 0 0;border-top:1px solid #eee;padding:1rem 1.5rem .45rem 1.25rem}.dropdown-wrapper .nav-dropdown .dropdown-item .dropdown-subitem-wrapper{padding:0;list-style:none}.dropdown-wrapper .nav-dropdown .dropdown-item .dropdown-subitem-wrapper .dropdown-subitem{font-size:.9em}.dropdown-wrapper .nav-dropdown .dropdown-item a{display:block;line-height:1.7rem;position:relative;border-bottom:none;font-weight:400;margin-bottom:0;padding:0 1.5rem 0 1.25rem}.dropdown-wrapper .nav-dropdown .dropdown-item a.router-link-active,.dropdown-wrapper .nav-dropdown .dropdown-item a:hover{color:#3eaf7c}.dropdown-wrapper .nav-dropdown .dropdown-item a.router-link-active:after{content:"";width:0;height:0;border-left:5px solid #3eaf7c;border-top:3px solid transparent;border-bottom:3px solid transparent;position:absolute;top:calc(50% - 2px);left:9px}.dropdown-wrapper .nav-dropdown .dropdown-item:first-child h4{margin-top:0;padding-top:0;border-top:0}@media (max-width:719px){.dropdown-wrapper.open .dropdown-title{margin-bottom:.5rem}.dropdown-wrapper .dropdown-title{display:none}.dropdown-wrapper .mobile-dropdown-title{display:block}.dropdown-wrapper .nav-dropdown{transition:height .1s ease-out;overflow:hidden}.dropdown-wrapper .nav-dropdown .dropdown-item h4{border-top:0;margin-top:0;padding-top:0}.dropdown-wrapper .nav-dropdown .dropdown-item>a,.dropdown-wrapper .nav-dropdown .dropdown-item h4{font-size:15px;line-height:2rem}.dropdown-wrapper .nav-dropdown .dropdown-item .dropdown-subitem{font-size:14px;padding-left:1rem}}@media (min-width:719px){.dropdown-wrapper{height:1.8rem}.dropdown-wrapper.open .nav-dropdown,.dropdown-wrapper:hover .nav-dropdown{display:block!important}.dropdown-wrapper.open:blur{display:none}.dropdown-wrapper .nav-dropdown{display:none;height:auto!important;box-sizing:border-box;max-height:calc(100vh - 2.7rem);overflow-y:auto;position:absolute;top:100%;right:0;background-color:#fff;padding:.6rem 0;border:1px solid;border-color:#ddd #ddd #ccc;text-align:left;border-radius:.25rem;white-space:nowrap;margin:0}}.nav-links{display:inline-block}.nav-links a{line-height:1.4rem;color:inherit}.nav-links a.router-link-active,.nav-links a:hover{color:#3eaf7c}.nav-links .nav-item{position:relative;display:inline-block;margin-left:1.5rem;line-height:2rem}.nav-links .nav-item:first-child{margin-left:0}.nav-links .repo-link{margin-left:1.5rem}@media (max-width:719px){.nav-links .nav-item,.nav-links .repo-link{margin-left:0}}@media (min-width:719px){.nav-links a.router-link-active,.nav-links a:hover{color:#2c3e50}.nav-item>a:not(.external).router-link-active,.nav-item>a:not(.external):hover{margin-bottom:-2px;border-bottom:2px solid #46bd87}}.navbar{padding:.7rem 1.5rem;line-height:2.2rem}.navbar a,.navbar img,.navbar span{display:inline-block}.navbar .logo{height:2.2rem;min-width:2.2rem;margin-right:.8rem;vertical-align:top}.navbar .site-name{font-size:1.3rem;font-weight:600;color:#2c3e50;position:relative}.navbar .links{padding-left:1.5rem;box-sizing:border-box;background-color:#fff;white-space:nowrap;font-size:.9rem;position:absolute;right:1.5rem;top:.7rem;display:flex}.navbar .links .search-box{flex:0 0 auto;vertical-align:top}@media (max-width:719px){.navbar{padding-left:4rem}.navbar .can-hide{display:none}.navbar .links{padding-left:1.5rem}.navbar .site-name{width:calc(100vw - 9.4rem);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}}.page-edit{max-width:740px;margin:0 auto;padding:2rem 2.5rem}@media (max-width:959px){.page-edit{padding:2rem}}@media (max-width:419px){.page-edit{padding:1.5rem}}.page-edit{padding-top:1rem;padding-bottom:1rem;overflow:auto}.page-edit .edit-link{display:inline-block}.page-edit .edit-link a{color:#4e6e8e;margin-right:.25rem}.page-edit .last-updated{float:right;font-size:.9em}.page-edit .last-updated .prefix{font-weight:500;color:#4e6e8e}.page-edit .last-updated .time{font-weight:400;color:#767676}@media (max-width:719px){.page-edit .edit-link{margin-bottom:.5rem}.page-edit .last-updated{font-size:.8em;float:none;text-align:left}}.page-nav{max-width:740px;margin:0 auto;padding:2rem 2.5rem}@media (max-width:959px){.page-nav{padding:2rem}}@media (max-width:419px){.page-nav{padding:1.5rem}}.page-nav{padding-top:1rem;padding-bottom:0}.page-nav .inner{min-height:2rem;margin-top:0;border-top:1px solid #eaecef;padding-top:1rem;overflow:auto}.page-nav .next{float:right}.page{padding-bottom:2rem;display:block}.sidebar-group .sidebar-group{padding-left:.5em}.sidebar-group:not(.collapsable) .sidebar-heading:not(.clickable){cursor:auto;color:inherit}.sidebar-group.is-sub-group{padding-left:0}.sidebar-group.is-sub-group>.sidebar-heading{font-size:.95em;line-height:1.4;font-weight:400;padding-left:2rem}.sidebar-group.is-sub-group>.sidebar-heading:not(.clickable){opacity:.5}.sidebar-group.is-sub-group>.sidebar-group-items{padding-left:1rem}.sidebar-group.is-sub-group>.sidebar-group-items>li>.sidebar-link{font-size:.95em;border-left:none}.sidebar-group.depth-2>.sidebar-heading{border-left:none}.sidebar-heading{color:#2c3e50;transition:color .15s ease;cursor:pointer;font-size:1.1em;font-weight:700;padding:.35rem 1.5rem .35rem 1.25rem;width:100%;box-sizing:border-box;margin:0;border-left:.25rem solid transparent}.sidebar-heading.open,.sidebar-heading:hover{color:inherit}.sidebar-heading .arrow{position:relative;top:-.12em;left:.5em}.sidebar-heading.clickable.active{font-weight:600;color:#3eaf7c;border-left-color:#3eaf7c}.sidebar-heading.clickable:hover{color:#3eaf7c}.sidebar-group-items{transition:height .1s ease-out;font-size:.95em;overflow:hidden}.sidebar .sidebar-sub-headers{padding-left:1rem;font-size:.95em}a.sidebar-link{font-size:1em;font-weight:400;display:inline-block;color:#2c3e50;border-left:.25rem solid transparent;padding:.35rem 1rem .35rem 1.25rem;line-height:1.4;width:100%;box-sizing:border-box}a.sidebar-link:hover{color:#3eaf7c}a.sidebar-link.active{font-weight:600;color:#3eaf7c;border-left-color:#3eaf7c}.sidebar-group a.sidebar-link{padding-left:2rem}.sidebar-sub-headers a.sidebar-link{padding-top:.25rem;padding-bottom:.25rem;border-left:none}.sidebar-sub-headers a.sidebar-link.active{font-weight:500}.sidebar ul{padding:0;margin:0;list-style-type:none}.sidebar a{display:inline-block}.sidebar .nav-links{display:none;border-bottom:1px solid #eaecef;padding:.5rem 0 .75rem}.sidebar .nav-links a{font-weight:600}.sidebar .nav-links .nav-item,.sidebar .nav-links .repo-link{display:block;line-height:1.25rem;font-size:1.1em;padding:.5rem 0 .5rem 1.5rem}.sidebar>.sidebar-links{padding:1.5rem 0}.sidebar>.sidebar-links>li>a.sidebar-link{font-size:1.1em;line-height:1.7;font-weight:700}.sidebar>.sidebar-links>li:not(:first-child){margin-top:.75rem}@media (max-width:719px){.sidebar .nav-links{display:block}.sidebar .nav-links .dropdown-wrapper .nav-dropdown .dropdown-item a.router-link-active:after{top:calc(1rem - 2px)}.sidebar>.sidebar-links{padding:1rem 0}}.search-box input{color:var(--lighten25TextColor);border-color:var(--darken10BorderColor);background-color:var(--bgColor)}.search-box input:focus{border-color:var(--accentColor)}.search-box .suggestions{background:var(--bgColor);border-color:var(--darken10BorderColor)}.search-box .suggestion a{color:var(--lighten35TextColor)}.search-box .suggestion.focused{background-color:var(--darken10BgColor)}.search-box .suggestion.focused a{color:var(--accentColor)}.algolia-search-wrapper .algolia-autocomplete .ds-dropdown-menu{background:var(--bgColor);border-color:var(--searchBorderColor)}.algolia-search-wrapper .algolia-autocomplete .ds-dropdown-menu:before{border-color:var(--searchBorderColor)}.algolia-search-wrapper .algolia-autocomplete .ds-dropdown-menu .ds-suggestion{border-bottom-color:var(--borderColor)}.algolia-search-wrapper .algolia-autocomplete .algolia-docsearch-suggestion{border-color:var(--borderColor)}.algolia-search-wrapper .algolia-autocomplete .algolia-docsearch-suggestion .algolia-docsearch-suggestion--category-header{background:var(--accentColor)}.algolia-search-wrapper .algolia-autocomplete .algolia-docsearch-suggestion .algolia-docsearch-suggestion--title{color:var(--textColor)}.algolia-search-wrapper .algolia-autocomplete .algolia-docsearch-footer,.algolia-search-wrapper .algolia-autocomplete .algolia-docsearch-suggestion .algolia-docsearch-suggestion--subcategory-column{border-color:var(--borderColor)}.algolia-search-wrapper .algolia-autocomplete .ds-cursor .algolia-docsearch-suggestion--content,.dropdown-wrapper .dropdown-title,.dropdown-wrapper .mobile-dropdown-title{color:var(--textColor)}.dropdown-wrapper .nav-dropdown .dropdown-item h4{border-top-color:var(--kbdBgColor)}.dropdown-wrapper .nav-dropdown .dropdown-item a.router-link-active,.dropdown-wrapper .nav-dropdown .dropdown-item a:hover{color:var(--accentColor)}.dropdown-wrapper .nav-dropdown .dropdown-item a.router-link-active:after{border-left-color:var(--accentColor)}@media (max-width:719px){.dropdown-wrapper .dropdown-title:hover{color:var(--accentColor)}}@media (min-width:719px){.dropdown-wrapper .dropdown-title .arrow{border-top-color:var(--arrowBgColor)}.dropdown-wrapper .nav-dropdown{background-color:var(--bgColor);border-color:var(--borderColor)}}.home .hero .description{color:var(--lighten40TextColor)}.home .hero .action-button{background-color:var(--accentColor);border-bottom-color:var(--darken10AccentColor)}.home .hero .action-button:hover{background-color:var(--lighten10AccentColor)}.home .features{border-top-color:var(--borderColor)}.home .feature h2{color:var(--lighten10TextColor)}.home .feature p,.home .footer{color:var(--lighten25TextColor)}.home .footer{border-top-color:var(--borderColor)}.navbar .site-name{color:var(--textColor);white-space:nowrap}.navbar .links{background:var(--bgColor)}.nav-links a.router-link-active,.nav-links a:hover{color:var(--accentColor)}@media (min-width:719px){.nav-links a.router-link-active,.nav-links a:hover{color:var(--textColor)}}@media (min-width:719px){.nav-item>a:not(.external).router-link-active,.nav-item>a:not(.external):hover{border-bottom-color:var(--accentColor)}}.page-edit .edit-link a,.page-edit .last-updated .prefix{color:var(--lighten25TextColor)}.page-edit .last-updated .time{color:var(--lighten40TextColor)}.page-nav .inner,.sidebar .nav-links{border-color:var(--borderColor)}.sidebar-heading{color:var(--textColor)}.sidebar-heading.clickable.active{color:var(--accentColor);border-left-color:var(--accentColor)}.sidebar-heading.clickable:hover{color:var(--accentColor)}a.sidebar-link{color:var(--textColor)}a.sidebar-link.active,a.sidebar-link:hover{color:var(--accentColor)}a.sidebar-link.active{border-left-color:var(--accentColor)}.theme-code-block[data-v-759a7d02]{display:none}.theme-code-block__active[data-v-759a7d02]{display:block}.theme-code-block>pre[data-v-759a7d02]{background-color:orange}.badge[data-v-15b7b770]{display:inline-block;font-size:14px;height:18px;line-height:18px;border-radius:3px;padding:0 6px;color:#fff}.badge.green[data-v-15b7b770],.badge.tip[data-v-15b7b770],.badge[data-v-15b7b770]{background-color:#42b983}.badge.error[data-v-15b7b770]{background-color:#da5961}.badge.warn[data-v-15b7b770],.badge.warning[data-v-15b7b770],.badge.yellow[data-v-15b7b770]{background-color:#e7c000}.badge+.badge[data-v-15b7b770]{margin-left:5px}.theme-code-group__nav[data-v-deefee04]{margin-bottom:-35px;background-color:#282c34;padding-bottom:22px;border-top-left-radius:6px;border-top-right-radius:6px;padding-left:10px;padding-top:10px}.theme-code-group__ul[data-v-deefee04]{margin:auto 0;padding-left:0;display:inline-flex;list-style:none}.theme-code-group__nav-tab[data-v-deefee04]{border:0;padding:5px;cursor:pointer;background-color:transparent;font-size:.85em;line-height:1.4;color:hsla(0,0%,100%,.9);font-weight:600}.theme-code-group__nav-tab-active[data-v-deefee04]{border-bottom:1px solid #42b983}.pre-blank[data-v-deefee04]{color:#42b983}.searchbox{display:inline-block;position:relative;width:200px;height:32px;white-space:nowrap;box-sizing:border-box;visibility:visible}.searchbox .meilisearch-autocomplete{display:block;width:100%;height:100%}.searchbox__wrapper{width:100%;height:100%;z-index:999;position:relative}.searchbox input{color:#555;display:inline-block;box-sizing:border-box;transition:box-shadow .4s ease,background .4s ease;border:0;border-radius:16px;box-shadow:inset 0 0 0 1px #ccc;background:#fff;padding:0 26px 0 32px;width:100%;height:100%;vertical-align:middle;white-space:normal;font-size:12px;-webkit-appearance:none;-moz-appearance:none;appearance:none}.searchbox input::-webkit-search-cancel-button,.searchbox input::-webkit-search-decoration,.searchbox input::-webkit-search-results-button,.searchbox input::-webkit-search-results-decoration{display:none}.searchbox input:hover{box-shadow:inset 0 0 0 1px #b3b3b3}.searchbox input:active,.searchbox input:focus{outline:0;box-shadow:inset 0 0 0 1px #aaa;background:#fff}.searchbox input::-moz-placeholder{color:#aaa}.searchbox input:-ms-input-placeholder{color:#aaa}.searchbox input::placeholder{color:#aaa}.searchbox__submit{position:absolute;top:0;margin:0;border:0;border-radius:16px 0 0 16px;background-color:rgba(69,142,225,0);padding:0;width:32px;height:100%;vertical-align:middle;text-align:center;font-size:inherit;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;right:inherit;left:0}.searchbox__submit:before{display:inline-block;margin-right:-4px;height:100%;vertical-align:middle;content:""}.searchbox__submit:active,.searchbox__submit:hover{cursor:pointer}.searchbox__submit:focus{outline:0}.searchbox__submit svg{width:14px;height:14px;vertical-align:middle;fill:#6d7e96}.searchbox__reset{display:block;position:absolute;top:8px;right:8px;margin:0;border:0;background:none;cursor:pointer;padding:0;font-size:inherit;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;fill:rgba(0,0,0,.5)}.searchbox__reset.hide{display:none}.searchbox__reset:focus{outline:0}.searchbox__reset svg{display:block;margin:4px;width:8px;height:8px}.searchbox__input:valid~.searchbox__reset{display:block;-webkit-animation-name:sbx-reset-in;animation-name:sbx-reset-in;-webkit-animation-duration:.15s;animation-duration:.15s}@-webkit-keyframes sbx-reset-in{0%{transform:translate3d(-20%,0,0);opacity:0}to{transform:none;opacity:1}}.meilisearch-autocomplete.meilisearch-autocomplete-right .dsb-dropdown-menu{right:0;left:inherit}.meilisearch-autocomplete.meilisearch-autocomplete-right .dsb-dropdown-menu:before{right:48px}.meilisearch-autocomplete.meilisearch-autocomplete-left .dsb-dropdown-menu{left:0;right:inherit}.meilisearch-autocomplete.meilisearch-autocomplete-left .dsb-dropdown-menu:before{left:48px}.meilisearch-autocomplete .dsb-dropdown-menu{position:relative;top:-6px;border-radius:4px;margin:6px 0 0;padding:0;text-align:left;height:auto;background:transparent;border:none;z-index:999;max-width:600px;min-width:500px;box-shadow:0 1px 0 0 rgba(0,0,0,.2),0 2px 3px 0 rgba(0,0,0,.1)}.meilisearch-autocomplete .dsb-dropdown-menu:before{display:block;position:absolute;content:"";width:14px;height:14px;background:#fff;z-index:1000;top:-7px;border-top:1px solid #d9d9d9;border-right:1px solid #d9d9d9;transform:rotate(-45deg);border-radius:2px}.meilisearch-autocomplete .dsb-dropdown-menu .dsb-suggestions{position:relative;z-index:1000;margin-top:8px}.meilisearch-autocomplete .dsb-dropdown-menu .dsb-suggestions a:hover{text-decoration:none}.meilisearch-autocomplete .dsb-dropdown-menu .dsb-suggestion{cursor:pointer}.meilisearch-autocomplete .dsb-dropdown-menu .dsb-suggestion.dsb-cursor .docs-searchbar-suggestion.suggestion-layout-simple,.meilisearch-autocomplete .dsb-dropdown-menu .dsb-suggestion.dsb-cursor .docs-searchbar-suggestion:not(.suggestion-layout-simple) .docs-searchbar-suggestion--content{background-color:rgba(69,142,225,.05)}.meilisearch-autocomplete .dsb-dropdown-menu [class^=dsb-dataset-]{position:relative;border:1px solid #d9d9d9;background:#fff;border-radius:4px;overflow:auto;padding:0 8px 8px}.meilisearch-autocomplete .dsb-dropdown-menu *{box-sizing:border-box}.meilisearch-autocomplete .docs-searchbar-suggestion{display:block;position:relative;padding:0 8px;background:#fff;color:#02060c;overflow:hidden}.meilisearch-autocomplete .docs-searchbar-suggestion--highlight{color:#174d8c;background:rgba(143,187,237,.1);padding:0 .05em}.meilisearch-autocomplete .docs-searchbar-suggestion--category-header .docs-searchbar-suggestion--category-header-lvl0 .docs-searchbar-suggestion--highlight,.meilisearch-autocomplete .docs-searchbar-suggestion--category-header .docs-searchbar-suggestion--category-header-lvl1 .docs-searchbar-suggestion--highlight,.meilisearch-autocomplete .docs-searchbar-suggestion--text .docs-searchbar-suggestion--highlight{padding:0 0 1px;background:inherit;box-shadow:inset 0 -2px 0 0 rgba(69,142,225,.8);color:inherit}.meilisearch-autocomplete .docs-searchbar-suggestion--content{display:block;width:70%;position:relative;padding:5.3333333333px 0 5.3333333333px 10.6666666667px;cursor:pointer}.meilisearch-autocomplete .docs-searchbar-suggestion--content:before{content:"";position:absolute;display:block;top:0;height:100%;width:1px;background:#ddd;left:-1px}.meilisearch-autocomplete .docs-searchbar-suggestion--category-header{position:relative;border-bottom:1px solid #ddd;display:none;margin-top:8px;padding:4px 0;font-size:1em;color:#33363d}.meilisearch-autocomplete .docs-searchbar-suggestion--wrapper{width:100%;display:flex;align-items:flex-start;padding:8px 0 0}.meilisearch-autocomplete .docs-searchbar-suggestion--subcategory-column{width:30%;text-align:right;position:relative;padding:5.3333333333px 10.6666666667px;color:#a4a7ae;font-size:.9em;word-wrap:break-word}.meilisearch-autocomplete .docs-searchbar-suggestion--subcategory-column:before{content:"";position:absolute;display:block;top:0;height:100%;width:1px;background:#ddd;right:0}.meilisearch-autocomplete .docs-searchbar-suggestion--subcategory-inline{display:none}.meilisearch-autocomplete .docs-searchbar-suggestion--title{margin-bottom:4px;color:#02060c;font-size:.9em;font-weight:700}.meilisearch-autocomplete .docs-searchbar-suggestion--text{display:block;line-height:1.2em;font-size:.85em;color:#63676d}.meilisearch-autocomplete .docs-searchbar-suggestion--no-results{width:100%;padding:8px 0;text-align:center;font-size:1.2em}.meilisearch-autocomplete .docs-searchbar-suggestion--no-results:before{display:none}.meilisearch-autocomplete .docs-searchbar-suggestion code{padding:1px 5px;font-size:90%;border:none;color:#222;background-color:#ebebeb;border-radius:3px;font-family:Menlo,Monaco,Consolas,Courier New,monospace}.meilisearch-autocomplete .docs-searchbar-suggestion code .docs-searchbar-suggestion--highlight{background:none}.meilisearch-autocomplete .docs-searchbar-suggestion.docs-searchbar-suggestion__main .docs-searchbar-suggestion--category-header,.meilisearch-autocomplete .docs-searchbar-suggestion.docs-searchbar-suggestion__secondary{display:block}@media (min-width:768px){.meilisearch-autocomplete .docs-searchbar-suggestion .docs-searchbar-suggestion--subcategory-column{display:block}}@media (max-width:768px){.meilisearch-autocomplete .docs-searchbar-suggestion .docs-searchbar-suggestion--subcategory-column{display:inline-block;width:auto;text-align:left;padding:0;font-size:.9em;font-weight:700;opacity:.5;color:#02060c}.meilisearch-autocomplete .docs-searchbar-suggestion .docs-searchbar-suggestion--subcategory-column:before{display:none}.meilisearch-autocomplete .docs-searchbar-suggestion .docs-searchbar-suggestion--subcategory-column:after{content:"|"}.meilisearch-autocomplete .docs-searchbar-suggestion .docs-searchbar-suggestion--content{display:inline-block;width:auto;text-align:left;padding:0}.meilisearch-autocomplete .docs-searchbar-suggestion .docs-searchbar-suggestion--content:before{display:none}}.meilisearch-autocomplete .suggestion-layout-simple.docs-searchbar-suggestion{border-bottom:1px solid #eee;padding:8px;margin:0}.meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--content{width:100%;padding:0}.meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--content:before{display:none}.meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--category-header{margin:0;padding:0;display:block;width:100%;border:none}.meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--category-header-lvl0,.meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--category-header-lvl1{opacity:.6;font-size:.85em}.meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--category-header-lvl1:before{background-image:url('data:image/svg+xml;utf8,');content:"";width:10px;height:10px;display:inline-block}.meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--wrapper{width:100%;margin:0;padding:0}.meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--duplicate-content,.meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--subcategory-inline{display:none}.meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--title{margin:0;color:#458ee1;font-size:.9em;font-weight:400}.meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--title:before{content:"#";font-weight:700;color:#458ee1;display:inline-block}.meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--text{margin:4px 0 0;display:block;line-height:1.4em;padding:5.3333333333px 8px;background:#f8f8f8;font-size:.85em;opacity:.8}.meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--text .docs-searchbar-suggestion--highlight{color:#3f4145;font-weight:700;box-shadow:none}.meilisearch-autocomplete .docs-searchbar-footer{width:100%;text-align:right;height:20px;z-index:2000;margin-top:10.6666666667px;color:#63676d;margin-left:auto}.meilisearch-autocomplete .docs-searchbar-footer-logo{margin-bottom:4px}div[data-ds-theme=dark] .searchbox{display:inline-block;position:relative;width:350px;height:32px;white-space:nowrap;box-sizing:border-box;visibility:visible}div[data-ds-theme=dark] .searchbox .meilisearch-autocomplete{display:block;width:100%;height:100%}div[data-ds-theme=dark] .searchbox__wrapper{width:100%;height:100%;z-index:999;position:relative}div[data-ds-theme=dark] .searchbox input{color:#eaeaea;display:inline-block;box-sizing:border-box;transition:box-shadow .4s ease,background .4s ease;border:0;border-radius:16px;box-shadow:inset 0 0 0 1px #686d71;background:#444d52;padding:0 26px 0 32px;width:100%;height:100%;vertical-align:middle;white-space:normal;font-size:90%;-webkit-appearance:none;-moz-appearance:none;appearance:none}div[data-ds-theme=dark] .searchbox input::-webkit-search-cancel-button,div[data-ds-theme=dark] .searchbox input::-webkit-search-decoration,div[data-ds-theme=dark] .searchbox input::-webkit-search-results-button,div[data-ds-theme=dark] .searchbox input::-webkit-search-results-decoration{display:none}div[data-ds-theme=dark] .searchbox input:hover{box-shadow:inset 0 0 0 1px #505356;box-shadow:inset 0 0 0 1px #747a7e}div[data-ds-theme=dark] .searchbox input:active,div[data-ds-theme=dark] .searchbox input:focus{outline:0;box-shadow:inset 0 0 0 1px #919598;background:#444d52}div[data-ds-theme=dark] .searchbox input::-moz-placeholder{color:#bbb}div[data-ds-theme=dark] .searchbox input:-ms-input-placeholder{color:#bbb}div[data-ds-theme=dark] .searchbox input::placeholder{color:#bbb}div[data-ds-theme=dark] .searchbox__submit{position:absolute;top:0;margin:0;border:0;border-radius:16px 0 0 16px;background-color:rgba(69,142,225,0);padding:0;width:32px;height:100%;vertical-align:middle;text-align:center;font-size:inherit;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;right:inherit;left:0}div[data-ds-theme=dark] .searchbox__submit:before{display:inline-block;margin-right:-4px;height:100%;vertical-align:middle;content:""}div[data-ds-theme=dark] .searchbox__submit:active,div[data-ds-theme=dark] .searchbox__submit:hover{cursor:pointer}div[data-ds-theme=dark] .searchbox__submit:focus{outline:0}div[data-ds-theme=dark] .searchbox__submit svg{width:14px;height:14px;vertical-align:middle;fill:#6d7e96}div[data-ds-theme=dark] .searchbox__reset{display:block;position:absolute;top:5px;right:5px;margin:0;border:0;background:none;cursor:pointer;padding:0;font-size:inherit;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;fill:rgba(0,0,0,.5)}div[data-ds-theme=dark] .searchbox__reset.hide{display:none}div[data-ds-theme=dark] .searchbox__reset:focus{outline:0}div[data-ds-theme=dark] .searchbox__reset svg{display:block;margin:4px;width:14px;height:14px}div[data-ds-theme=dark] .searchbox__input:valid~div[data-ds-theme=dark] .searchbox__reset{display:block;-webkit-animation-name:sbx-reset-in;animation-name:sbx-reset-in;-webkit-animation-duration:.15s;animation-duration:.15s}@keyframes sbx-reset-in{0%{transform:translate3d(-20%,0,0);opacity:0}to{transform:none;opacity:1}}div[data-ds-theme=dark] .meilisearch-autocomplete.meilisearch-autocomplete-right .dsb-dropdown-menu{right:0;left:inherit}div[data-ds-theme=dark] .meilisearch-autocomplete.meilisearch-autocomplete-right .dsb-dropdown-menu:before{right:48px}div[data-ds-theme=dark] .meilisearch-autocomplete.meilisearch-autocomplete-left .dsb-dropdown-menu{left:0;right:inherit}div[data-ds-theme=dark] .meilisearch-autocomplete.meilisearch-autocomplete-left .dsb-dropdown-menu:before{left:48px}div[data-ds-theme=dark] .meilisearch-autocomplete .dsb-dropdown-menu{position:relative;top:-6px;border-radius:4px;margin:6px 0 0;padding:0;text-align:left;height:auto;background:transparent;border:none;z-index:999;max-width:600px;min-width:500px;box-shadow:0 1px 0 0 rgba(0,0,0,.2),0 2px 3px 0 rgba(0,0,0,.1)}div[data-ds-theme=dark] .meilisearch-autocomplete .dsb-dropdown-menu:before{display:block;position:absolute;content:"";width:14px;height:14px;background:#2c363e;z-index:1000;top:-7px;border-top:1px solid #5b6369;border-right:1px solid #5b6369;transform:rotate(-45deg);border-radius:2px}div[data-ds-theme=dark] .meilisearch-autocomplete .dsb-dropdown-menu .dsb-suggestions{position:relative;z-index:1000;margin-top:8px}div[data-ds-theme=dark] .meilisearch-autocomplete .dsb-dropdown-menu .dsb-suggestions a:hover{text-decoration:none}div[data-ds-theme=dark] .meilisearch-autocomplete .dsb-dropdown-menu .dsb-suggestion{cursor:pointer}div[data-ds-theme=dark] .meilisearch-autocomplete .dsb-dropdown-menu .dsb-suggestion.dsb-cursor .docs-searchbar-suggestion.suggestion-layout-simple,div[data-ds-theme=dark] .meilisearch-autocomplete .dsb-dropdown-menu .dsb-suggestion.dsb-cursor .docs-searchbar-suggestion:not(.suggestion-layout-simple) .docs-searchbar-suggestion--content{background-color:rgba(69,142,225,.5)}div[data-ds-theme=dark] .meilisearch-autocomplete .dsb-dropdown-menu [class^=dsb-dataset-]{position:relative;border:1px solid #5b6369;background:#2c363e;border-radius:4px;overflow:auto;padding:0 8px 8px}div[data-ds-theme=dark] .meilisearch-autocomplete .dsb-dropdown-menu *{box-sizing:border-box}div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion{display:block;position:relative;padding:0 8px;background:#2c363e;color:#eaeaea;overflow:hidden}div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion--highlight{color:#174d8c;background:rgba(143,187,237,.1);padding:0 .05em;color:#9dc3ef}div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion--category-header .docs-searchbar-suggestion--category-header-lvl0 .docs-searchbar-suggestion--highlight,div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion--category-header .docs-searchbar-suggestion--category-header-lvl1 .docs-searchbar-suggestion--highlight,div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion--text .docs-searchbar-suggestion--highlight{padding:0 0 1px;background:inherit;box-shadow:inset 0 -2px 0 0 rgba(69,142,225,.8);color:inherit}div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion--content{display:block;width:70%;position:relative;padding:5.3333333333px 0 5.3333333333px 10.6666666667px;cursor:pointer}div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion--content:before{content:"";position:absolute;display:block;top:0;height:100%;width:1px;background:#ddd;left:-1px}div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion--category-header{position:relative;border-bottom:1px solid #ddd;display:none;margin-top:8px;padding:4px 0;font-size:1em;color:#7db0ea;color:#d5d5d5}div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion--wrapper{width:100%;display:flex;align-items:flex-start;padding:8px 0 0}div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion--subcategory-column{width:30%;text-align:right;position:relative;padding:5.3333333333px 10.6666666667px;color:#bbb;font-size:.9em;word-wrap:break-word}div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion--subcategory-column:before{content:"";position:absolute;display:block;top:0;height:100%;width:1px;background:#ddd;right:0}div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion--subcategory-inline{display:none}div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion--title{margin-bottom:4px;color:#eaeaea;font-size:.9em;font-weight:700}div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion--text{display:block;line-height:1.2em;font-size:.85em;color:#eaeaea}div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion--no-results{width:100%;padding:8px 0;text-align:center;font-size:1.2em}div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion--no-results:before{display:none}div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion code{padding:1px 5px;font-size:90%;border:none;color:#222;background-color:#ebebeb;border-radius:3px;font-family:Menlo,Monaco,Consolas,Courier New,monospace}div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion code .docs-searchbar-suggestion--highlight{background:none}div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion.docs-searchbar-suggestion__main .docs-searchbar-suggestion--category-header,div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion.docs-searchbar-suggestion__secondary{display:block}@media (min-width:768px){div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion .docs-searchbar-suggestion--subcategory-column{display:block}}@media (max-width:768px){div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion .docs-searchbar-suggestion--subcategory-column{display:inline-block;width:auto;text-align:left;padding:0;font-size:.9em;font-weight:700;opacity:.5;color:#02060c;color:#bbb;opacity:unset}div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion .docs-searchbar-suggestion--subcategory-column:before{display:none}div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion .docs-searchbar-suggestion--subcategory-column:after{content:"|"}div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion .docs-searchbar-suggestion--content{display:inline-block;width:auto;text-align:left;padding:0}div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion .docs-searchbar-suggestion--content:before{display:none}}div[data-ds-theme=dark] .meilisearch-autocomplete .suggestion-layout-simple.docs-searchbar-suggestion{padding:8px;margin:0;border-bottom:1px solid #737d84}div[data-ds-theme=dark] .meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--content{width:100%;padding:0}div[data-ds-theme=dark] .meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--content:before{display:none}div[data-ds-theme=dark] .meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--category-header{margin:0;padding:0;display:block;width:100%;border:none}div[data-ds-theme=dark] .meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--category-header-lvl0,div[data-ds-theme=dark] .meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--category-header-lvl1{opacity:.6;font-size:.85em;opacity:unset;color:#d5d5d5}div[data-ds-theme=dark] .meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--category-header-lvl1:before{background-image:url('data:image/svg+xml;utf8,');content:"";width:10px;height:10px;display:inline-block;filter:invert(1)}div[data-ds-theme=dark] .meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--wrapper{width:100%;margin:0;padding:0}div[data-ds-theme=dark] .meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--duplicate-content,div[data-ds-theme=dark] .meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--subcategory-inline{display:none}div[data-ds-theme=dark] .meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--title{margin:0;color:#458ee1;font-size:.9em;font-weight:400;color:#eaeaea}div[data-ds-theme=dark] .meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--title:before{content:"#";font-weight:700;color:#458ee1;display:inline-block;color:#eaeaea}div[data-ds-theme=dark] .meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--text{margin:4px 0 0;display:block;line-height:1.4em;padding:5.3333333333px 8px;background:#6b7278;font-size:.85em;opacity:.8}div[data-ds-theme=dark] .meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--text .docs-searchbar-suggestion--highlight{color:#c4c4c4;font-weight:700;box-shadow:none;color:#fff}div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-footer{width:100%;text-align:right;height:20px;z-index:2000;margin-top:10.6666666667px;color:#eaeaea;margin-left:auto}div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-footer-logo{margin-bottom:4px;filter:invert(1)} \ No newline at end of file +code[class*=language-],pre[class*=language-]{color:#ccc;background:none;font-family:Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-ms-hyphens:none;hyphens:none}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#2d2d2d}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.block-comment,.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#999}.token.punctuation{color:#ccc}.token.attr-name,.token.deleted,.token.namespace,.token.tag{color:#e2777a}.token.function-name{color:#6196cc}.token.boolean,.token.function,.token.number{color:#f08d49}.token.class-name,.token.constant,.token.property,.token.symbol{color:#f8c555}.token.atrule,.token.builtin,.token.important,.token.keyword,.token.selector{color:#cc99cd}.token.attr-value,.token.char,.token.regex,.token.string,.token.variable{color:#7ec699}.token.entity,.token.operator,.token.url{color:#67cdcc}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.token.inserted{color:green}.theme-default-content code{color:#476582;padding:.25rem .5rem;margin:0;font-size:.85em;background-color:rgba(27,31,35,.05);border-radius:3px}.theme-default-content code .token.deleted{color:#ec5975}.theme-default-content code .token.inserted{color:#3eaf7c}.theme-default-content pre,.theme-default-content pre[class*=language-]{line-height:1.4;padding:1.25rem 1.5rem;margin:.85rem 0;background-color:#282c34;border-radius:6px;overflow:auto}.theme-default-content pre[class*=language-] code,.theme-default-content pre code{color:#fff;padding:0;background-color:transparent;border-radius:0}div[class*=language-]{position:relative;background-color:#282c34;border-radius:6px}div[class*=language-] .highlight-lines{-webkit-user-select:none;user-select:none;padding-top:1.3rem;position:absolute;top:0;left:0;width:100%;line-height:1.4}div[class*=language-] .highlight-lines .highlighted{background-color:rgba(0,0,0,.66)}div[class*=language-] pre,div[class*=language-] pre[class*=language-]{background:transparent;position:relative;z-index:1}div[class*=language-]:before{position:absolute;z-index:3;top:.8em;right:1em;font-size:.75rem;color:hsla(0,0%,100%,.4)}div[class*=language-]:not(.line-numbers-mode) .line-numbers-wrapper{display:none}div[class*=language-].line-numbers-mode .highlight-lines .highlighted{position:relative}div[class*=language-].line-numbers-mode .highlight-lines .highlighted:before{content:" ";position:absolute;z-index:3;left:0;top:0;display:block;width:3.5rem;height:100%;background-color:rgba(0,0,0,.66)}div[class*=language-].line-numbers-mode pre{padding-left:4.5rem;vertical-align:middle}div[class*=language-].line-numbers-mode .line-numbers-wrapper{position:absolute;top:0;width:3.5rem;text-align:center;color:hsla(0,0%,100%,.3);padding:1.25rem 0;line-height:1.4}div[class*=language-].line-numbers-mode .line-numbers-wrapper br{-webkit-user-select:none;user-select:none}div[class*=language-].line-numbers-mode .line-numbers-wrapper .line-number{position:relative;z-index:4;-webkit-user-select:none;user-select:none;font-size:.85em}div[class*=language-].line-numbers-mode:after{content:"";position:absolute;z-index:2;top:0;left:0;width:3.5rem;height:100%;border-radius:6px 0 0 6px;border-right:1px solid rgba(0,0,0,.66);background-color:#282c34}div[class~=language-js]:before{content:"js"}div[class~=language-ts]:before{content:"ts"}div[class~=language-html]:before{content:"html"}div[class~=language-md]:before{content:"md"}div[class~=language-vue]:before{content:"vue"}div[class~=language-css]:before{content:"css"}div[class~=language-sass]:before{content:"sass"}div[class~=language-scss]:before{content:"scss"}div[class~=language-less]:before{content:"less"}div[class~=language-stylus]:before{content:"stylus"}div[class~=language-go]:before{content:"go"}div[class~=language-java]:before{content:"java"}div[class~=language-c]:before{content:"c"}div[class~=language-sh]:before{content:"sh"}div[class~=language-yaml]:before{content:"yaml"}div[class~=language-py]:before{content:"py"}div[class~=language-docker]:before{content:"docker"}div[class~=language-dockerfile]:before{content:"dockerfile"}div[class~=language-makefile]:before{content:"makefile"}div[class~=language-javascript]:before{content:"js"}div[class~=language-typescript]:before{content:"ts"}div[class~=language-markup]:before{content:"html"}div[class~=language-markdown]:before{content:"md"}div[class~=language-json]:before{content:"json"}div[class~=language-ruby]:before{content:"rb"}div[class~=language-python]:before{content:"py"}div[class~=language-bash]:before{content:"sh"}div[class~=language-php]:before{content:"php"}.custom-block .custom-block-title{font-weight:600;margin-bottom:-.4rem}.custom-block.danger,.custom-block.tip,.custom-block.warning{padding:.1rem 1.5rem;border-left-width:.5rem;border-left-style:solid;margin:1rem 0}.custom-block.tip{background-color:#f3f5f7;border-color:#42b983}.custom-block.warning{background-color:rgba(255,229,100,.3);border-color:#e7c000;color:#6b5900}.custom-block.warning .custom-block-title{color:#b29400}.custom-block.warning a{color:#2c3e50}.custom-block.danger{background-color:#ffe6e6;border-color:#c00;color:#4d0000}.custom-block.danger .custom-block-title{color:#900}.custom-block.danger a{color:#2c3e50}.custom-block.details{display:block;position:relative;border-radius:2px;margin:1.6em 0;padding:1.6em;background-color:#eee}.custom-block.details h4{margin-top:0}.custom-block.details figure:last-child,.custom-block.details p:last-child{margin-bottom:0;padding-bottom:0}.custom-block.details summary{outline:none;cursor:pointer}.arrow{display:inline-block;width:0;height:0}.arrow.up{border-bottom:6px solid #ccc}.arrow.down,.arrow.up{border-left:4px solid transparent;border-right:4px solid transparent}.arrow.down{border-top:6px solid #ccc}.arrow.right{border-left:6px solid #ccc}.arrow.left,.arrow.right{border-top:4px solid transparent;border-bottom:4px solid transparent}.arrow.left{border-right:6px solid #ccc}.theme-default-content:not(.custom){max-width:740px;margin:0 auto;padding:2rem 2.5rem}@media (max-width:959px){.theme-default-content:not(.custom){padding:2rem}}@media (max-width:419px){.theme-default-content:not(.custom){padding:1.5rem}}.table-of-contents .badge{vertical-align:middle}body,html{padding:0;margin:0;background-color:#fff}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:16px;color:#2c3e50}.page{padding-left:20rem}.navbar{z-index:20;right:0;height:3.6rem;background-color:#fff;box-sizing:border-box;border-bottom:1px solid #eaecef}.navbar,.sidebar-mask{position:fixed;top:0;left:0}.sidebar-mask{z-index:9;width:100vw;height:100vh;display:none}.sidebar{font-size:16px;background-color:#fff;width:20rem;position:fixed;z-index:10;margin:0;top:3.6rem;left:0;bottom:0;box-sizing:border-box;border-right:1px solid #eaecef;overflow-y:auto}.theme-default-content:not(.custom)>:first-child{margin-top:3.6rem}.theme-default-content:not(.custom) a:hover{text-decoration:underline}.theme-default-content:not(.custom) p.demo{padding:1rem 1.5rem;border:1px solid #ddd;border-radius:4px}.theme-default-content:not(.custom) img{max-width:100%}.theme-default-content.custom{padding:0;margin:0}.theme-default-content.custom img{max-width:100%}a{font-weight:500;text-decoration:none}a,p a code{color:#3eaf7c}p a code{font-weight:400}kbd{background:#eee;border:.15rem solid #ddd;border-bottom:.25rem solid #ddd;border-radius:.15rem;padding:0 .15em}blockquote{font-size:1rem;color:#999;border-left:.2rem solid #dfe2e5;margin:1rem 0;padding:.25rem 0 .25rem 1rem}blockquote>p{margin:0}ol,ul{padding-left:1.2em}strong{font-weight:600}h1,h2,h3,h4,h5,h6{font-weight:600;line-height:1.25}.theme-default-content:not(.custom)>h1,.theme-default-content:not(.custom)>h2,.theme-default-content:not(.custom)>h3,.theme-default-content:not(.custom)>h4,.theme-default-content:not(.custom)>h5,.theme-default-content:not(.custom)>h6{margin-top:-3.1rem;padding-top:4.6rem;margin-bottom:0}.theme-default-content:not(.custom)>h1:first-child,.theme-default-content:not(.custom)>h2:first-child,.theme-default-content:not(.custom)>h3:first-child,.theme-default-content:not(.custom)>h4:first-child,.theme-default-content:not(.custom)>h5:first-child,.theme-default-content:not(.custom)>h6:first-child{margin-top:-1.5rem;margin-bottom:1rem}.theme-default-content:not(.custom)>h1:first-child+.custom-block,.theme-default-content:not(.custom)>h1:first-child+p,.theme-default-content:not(.custom)>h1:first-child+pre,.theme-default-content:not(.custom)>h2:first-child+.custom-block,.theme-default-content:not(.custom)>h2:first-child+p,.theme-default-content:not(.custom)>h2:first-child+pre,.theme-default-content:not(.custom)>h3:first-child+.custom-block,.theme-default-content:not(.custom)>h3:first-child+p,.theme-default-content:not(.custom)>h3:first-child+pre,.theme-default-content:not(.custom)>h4:first-child+.custom-block,.theme-default-content:not(.custom)>h4:first-child+p,.theme-default-content:not(.custom)>h4:first-child+pre,.theme-default-content:not(.custom)>h5:first-child+.custom-block,.theme-default-content:not(.custom)>h5:first-child+p,.theme-default-content:not(.custom)>h5:first-child+pre,.theme-default-content:not(.custom)>h6:first-child+.custom-block,.theme-default-content:not(.custom)>h6:first-child+p,.theme-default-content:not(.custom)>h6:first-child+pre{margin-top:2rem}h1:focus .header-anchor,h1:hover .header-anchor,h2:focus .header-anchor,h2:hover .header-anchor,h3:focus .header-anchor,h3:hover .header-anchor,h4:focus .header-anchor,h4:hover .header-anchor,h5:focus .header-anchor,h5:hover .header-anchor,h6:focus .header-anchor,h6:hover .header-anchor{opacity:1}h1{font-size:2.2rem}h2{font-size:1.65rem;padding-bottom:.3rem;border-bottom:1px solid #eaecef}h3{font-size:1.35rem}a.header-anchor{font-size:.85em;float:left;margin-left:-.87em;padding-right:.23em;margin-top:.125em;opacity:0}a.header-anchor:focus,a.header-anchor:hover{text-decoration:none}.line-number,code,kbd{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace}ol,p,ul{line-height:1.7}hr{border:0;border-top:1px solid #eaecef}table{border-collapse:collapse;margin:1rem 0;display:block;overflow-x:auto}tr{border-top:1px solid #dfe2e5}tr:nth-child(2n){background-color:#f6f8fa}td,th{border:1px solid #dfe2e5;padding:.6em 1em}.theme-container.sidebar-open .sidebar-mask{display:block}.theme-container.no-navbar .theme-default-content:not(.custom)>h1,.theme-container.no-navbar h2,.theme-container.no-navbar h3,.theme-container.no-navbar h4,.theme-container.no-navbar h5,.theme-container.no-navbar h6{margin-top:1.5rem;padding-top:0}.theme-container.no-navbar .sidebar{top:0}@media (min-width:720px){.theme-container.no-sidebar .sidebar{display:none}.theme-container.no-sidebar .page{padding-left:0}}@media (max-width:959px){.sidebar{font-size:15px;width:16.4rem}.page{padding-left:16.4rem}}@media (max-width:719px){.sidebar{top:0;padding-top:3.6rem;transform:translateX(-100%);transition:transform .2s ease}.page{padding-left:0}.theme-container.sidebar-open .sidebar{transform:translateX(0)}.theme-container.no-navbar .sidebar{padding-top:0}}@media (max-width:419px){h1{font-size:1.9rem}.theme-default-content div[class*=language-]{margin:.85rem -1.5rem;border-radius:0}}:root{--accentColor:#3eaf7c;--textColor:#2c3e50;--borderColor:#eaecef;--codeBgColor:#282c34;--arrowBgColor:#ccc;--badgeTipColor:#42b983;--badgeWarningColor:#e7c000;--badgeErrorColor:#da5961;--bgColor:#fff;--kbdBgColor:#eee;--blockquoteTextColor:#999;--blockquoteBorderColor:#dfe2e5;--tableBorderColor:#dfe2e5;--tableStripeBgColor:#f6f8fa;--preTextColor:#fff;--highlightedBgColor:rgba(0,0,0,0.66);--languageTextColor:hsla(0,0%,100%,0.4);--lineNumbersColor:hsla(0,0%,100%,0.3);--tipColor:#2c3e50;--tipBgColor:#f3f5f7;--warningColor:#e7c000;--warningBgColor:rgba(255,229,100,0.3);--dangerColor:#c00;--dangerBgColor:#ffe6e6;--miniCodeBgColor:rgba(27,31,35,0.05);--searchBorderColor:#999;--lighten10AccentColor:#4abf8a;--lighten10TextColor:#3a5169;--lighten20TextColor:#476582;--lighten25TextColor:#4e6e8e;--lighten35TextColor:#5d82a6;--lighten40TextColor:#6a8bad;--darken10AccentColor:#389d70;--darken10BgColor:#f2f2f2;--darken10BorderColor:#cfd4db}@media (prefers-color-scheme:light){:root{--codeBgColor:#f8f8f8;--preTextColor:#4d4d4d;--highlightedBgColor:hsla(0,0%,87.8%,0.5);--languageTextColor:rgba(0,0,0,0.4);--lineNumbersColor:rgba(0,0,0,0.3)}}@media (prefers-color-scheme:dark){:root{--accentColor:#a29bfe;--textColor:#eaeaea;--borderColor:#545f66;--arrowBgColor:#ccc;--badgeTipColor:#42b983;--badgeWarningColor:#e7c000;--badgeErrorColor:#da5961;--bgColor:#25272a;--kbdBgColor:#444;--blockquoteTextColor:#eee;--blockquoteBorderColor:#666b6f;--tableBorderColor:#4e4e4e;--tableStripeBgColor:#444;--tipColor:#e2e2e2;--tipBgColor:#3e3b3b;--warningColor:#e7c000;--warningBgColor:rgba(185,174,119,0.3);--dangerColor:#c00;--dangerBgColor:rgba(72,56,57,0.3);--miniCodeBgColor:hsla(0,0%,100%,0.1);--searchBorderColor:#eee;--lighten10AccentColor:#aba5fe;--lighten10TextColor:#ececec;--lighten20TextColor:#eee;--lighten25TextColor:#efefef;--lighten35TextColor:#f1f1f1;--lighten40TextColor:#f2f2f2;--darken10AccentColor:#7c73fe;--darken10BgColor:#2f3235;--darken10BorderColor:#4c565c}}html[theme=light]{--accentColor:#3eaf7c;--textColor:#2c3e50;--borderColor:#eaecef;--codeBgColor:#f8f8f8;--bgColor:#fff;--kbdBgColor:#eee;--blockquoteTextColor:#999;--blockquoteBorderColor:#dfe2e5;--tableBorderColor:#dfe2e5;--tableStripeBgColor:#f6f8fa;--preTextColor:#4d4d4d;--highlightedBgColor:hsla(0,0%,87.8%,0.5);--languageTextColor:rgba(0,0,0,0.4);--lineNumbersColor:rgba(0,0,0,0.3);--tipColor:#2c3e50;--tipBgColor:#f3f5f7;--warningBgColor:rgba(255,229,100,0.3);--dangerBgColor:#ffe6e6;--miniCodeBgColor:rgba(27,31,35,0.05);--searchBorderColor:#999;--lighten10AccentColor:#4abf8a;--lighten10TextColor:#3a5169;--lighten20TextColor:#476582;--lighten25TextColor:#4e6e8e;--lighten35TextColor:#5d82a6;--lighten40TextColor:#6a8bad;--darken10AccentColor:#389d70;--darken10BgColor:#f2f2f2;--darken10BorderColor:#cfd4db}html[theme=dark],html[theme=light]{--arrowBgColor:#ccc;--badgeTipColor:#42b983;--badgeWarningColor:#e7c000;--badgeErrorColor:#da5961;--warningColor:#e7c000;--dangerColor:#c00}html[theme=dark]{--accentColor:#a29bfe;--textColor:#eaeaea;--borderColor:#545f66;--codeBgColor:#282c34;--bgColor:#25272a;--kbdBgColor:#444;--blockquoteTextColor:#eee;--blockquoteBorderColor:#666b6f;--tableBorderColor:#4e4e4e;--tableStripeBgColor:#444;--preTextColor:#fff;--highlightedBgColor:rgba(0,0,0,0.66);--languageTextColor:hsla(0,0%,100%,0.4);--lineNumbersColor:hsla(0,0%,100%,0.3);--tipColor:#e2e2e2;--tipBgColor:#3e3b3b;--warningBgColor:rgba(185,174,119,0.3);--dangerBgColor:rgba(72,56,57,0.3);--miniCodeBgColor:hsla(0,0%,100%,0.1);--searchBorderColor:#eee;--lighten10AccentColor:#aba5fe;--lighten10TextColor:#ececec;--lighten20TextColor:#eee;--lighten25TextColor:#efefef;--lighten35TextColor:#f1f1f1;--lighten40TextColor:#f2f2f2;--darken10AccentColor:#7c73fe;--darken10BgColor:#232528;--darken10BorderColor:#4c565c}.navbar,.sidebar,body,html{background-color:var(--bgColor)}body{color:var(--textColor)}.navbar,h2{border-bottom-color:var(--borderColor)}.sidebar{border-right-color:var(--borderColor)}.theme-default-content:not(.custom) p.demo,kbd{border-color:var(--borderColor)}kbd{background:var(--kbdBgColor)}blockquote{color:var(--blockquoteTextColor);border-left-color:var(--blockquoteBorderColor)}a,p a code{color:var(--accentColor)}hr{border-top-color:var(--borderColor)}tr{border-top-color:var(--tableBorderColor)}tr:nth-child(2n){background-color:var(--tableStripeBgColor)}td,th{border-color:var(--tableBorderColor)}.arrow.up{border-bottom-color:var(--arrowBgColor)}.arrow.down{border-top-color:var(--arrowBgColor)}.arrow.left,.arrow.right,border-left-color var(--arrowBgColor){border-right-color:var(--arrowBgColor)}.theme-default-content code{color:var(--lighten20TextColor);background-color:var(--miniCodeBgColor)}.theme-default-content code .token.inserted{color:var(--accentColor)}.theme-default-content code .token.punctuation{color:var(--preTextColor)}.theme-default-content pre[class*=language-],div[class*=language-],div[class*=language-].line-numbers-mode:after{background-color:var(--codeBgColor)}.theme-default-content pre[class*=language-] code,.theme-default-content pre code{color:var(--preTextColor)}div[class*=language-] .highlight-lines .highlighted,div[class*=language-].line-numbers-mode .highlight-lines .highlighted:before{background-color:var(--highlightedBgColor)}div[class*=language-].line-numbers-mode:after{background-color:var(--codeBgColor);border-right-color:var(--highlightedBgColor)}div[class*=language-]:before{color:var(--languageTextColor)}div[class*=language-].line-numbers-mode .line-numbers-wrapper{color:var(--lineNumbersColor)}.theme-code-block>pre,.theme-code-group .theme-code-group__nav{background-color:var(--codeBgColor)!important}.theme-code-group .theme-code-group__nav .theme-code-group__nav-tab{color:var(--textColor)!important}.theme-code-group .theme-code-group__nav .theme-code-group__nav-tab-active{border-color:var(--accentColor)!important}.custom-block.tip{border-color:var(--badgeTipColor);background-color:var(--tipBgColor)}.custom-block.tip .custom-block-title,.custom-block.tip a{color:var(--tipColor)}.custom-block.warning{border-color:var(--badgeWarningColor);background-color:var(--warningBgColor)}.custom-block.warning .custom-block-title,.custom-block.warning a{color:var(--warningColor)}.custom-block.danger{border-color:var(--badgeErrorColor);background-color:var(--dangerBgColor)}.custom-block.danger .custom-block-title,.custom-block.danger a{color:var(--dangerColor)}.custom-block.danger,.custom-block.warning{color:var(--textColor)}.custom-block.details{background-color:var(--tipBgColor)}.badge,.badge.green,.badge.tip{background-color:var(--badgeTipColor)!important}.badge.error{background-color:var(--badgeErrorColor)!important}.badge.warn,.badge.warning,.badge.yellow{background-color:var(--badgeWarningColor)!important}.global-ui .sw-update-popup{border-color:var(--accentColor)!important;background-color:var(--bgColor)!important;color:var(--textColor)!important}.global-ui .sw-update-popup button{border-color:var(--darken10AccentColor)!important;background-color:var(--accentColor)!important;color:#fff!important}.global-ui .sw-update-popup button:hover{background-color:var(--lighten10AccentColor)!important}@media (min-width:719px){::-webkit-scrollbar{max-width:6px;max-height:12px}::-webkit-scrollbar-thumb{background-color:var(--languageTextColor);border-radius:6px}}#nprogress{pointer-events:none}#nprogress .bar{background:#3eaf7c;position:fixed;z-index:1031;top:0;left:0;width:100%;height:2px}#nprogress .peg{display:block;position:absolute;right:0;width:100px;height:100%;box-shadow:0 0 10px #3eaf7c,0 0 5px #3eaf7c;opacity:1;transform:rotate(3deg) translateY(-4px)}#nprogress .spinner{display:block;position:fixed;z-index:1031;top:15px;right:15px}#nprogress .spinner-icon{width:18px;height:18px;box-sizing:border-box;border-color:#3eaf7c transparent transparent #3eaf7c;border-style:solid;border-width:2px;border-radius:50%;-webkit-animation:nprogress-spinner .4s linear infinite;animation:nprogress-spinner .4s linear infinite}.nprogress-custom-parent{overflow:hidden;position:relative}.nprogress-custom-parent #nprogress .bar,.nprogress-custom-parent #nprogress .spinner{position:absolute}@-webkit-keyframes nprogress-spinner{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes nprogress-spinner{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.icon.outbound{color:#aaa;display:inline-block;vertical-align:middle;position:relative;top:-1px}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.home{padding:3.6rem 2rem 0;max-width:960px;margin:0 auto;display:block}.home .hero{text-align:center}.home .hero img{max-width:100%;max-height:280px;display:block;margin:3rem auto 1.5rem}.home .hero h1{font-size:3rem}.home .hero .action,.home .hero .description,.home .hero h1{margin:1.8rem auto}.home .hero .description{max-width:35rem;font-size:1.6rem;line-height:1.3;color:#6a8bad}.home .hero .action-button{display:inline-block;font-size:1.2rem;color:#fff;background-color:#3eaf7c;padding:.8rem 1.6rem;border-radius:4px;transition:background-color .1s ease;box-sizing:border-box;border-bottom:1px solid #389d70}.home .hero .action-button:hover{background-color:#4abf8a}.home .features{border-top:1px solid #eaecef;padding:1.2rem 0;margin-top:2.5rem;display:flex;flex-wrap:wrap;align-items:flex-start;align-content:stretch;justify-content:space-between}.home .feature{flex-grow:1;flex-basis:30%;max-width:30%}.home .feature h2{font-size:1.4rem;font-weight:500;border-bottom:none;padding-bottom:0;color:#3a5169}.home .feature p{color:#4e6e8e}.home .footer{padding:2.5rem;border-top:1px solid #eaecef;text-align:center;color:#4e6e8e}@media (max-width:719px){.home .features{flex-direction:column}.home .feature{max-width:100%;padding:0 2.5rem}}@media (max-width:419px){.home{padding-left:1.5rem;padding-right:1.5rem}.home .hero img{max-height:210px;margin:2rem auto 1.2rem}.home .hero h1{font-size:2rem}.home .hero .action,.home .hero .description,.home .hero h1{margin:1.2rem auto}.home .hero .description{font-size:1.2rem}.home .hero .action-button{font-size:1rem;padding:.6rem 1.2rem}.home .feature h2{font-size:1.25rem}}.meilisearch-search-wrapper{display:inline-block;position:relative;margin-right:1rem}.meilisearch-search-wrapper>div>span{vertical-align:middle}.meilisearch-search-wrapper .dsb-cursor{background:rgba(62,175,124,.05)}.meilisearch-search-wrapper .meilisearch-autocomplete{line-height:2}.meilisearch-search-wrapper .meilisearch-autocomplete input{cursor:text;width:10rem;height:2rem;color:#4e6e8e;display:inline-block;border:1px solid #cfd4db;border-radius:2rem;font-size:.9rem;line-height:2rem;padding:0 .5rem 0 2rem;outline:none;transition:all .2s ease;background:#fff url(/assets/img/search.83621669.svg) .6rem .5rem no-repeat;background-size:1rem}.meilisearch-search-wrapper .meilisearch-autocomplete input:focus{cursor:auto;border-color:#3eaf7c}.meilisearch-search-wrapper .meilisearch-autocomplete .docs-searchbar-suggestion:not(.suggestion-layout-simple){border-color:#eaecef}.meilisearch-search-wrapper .meilisearch-autocomplete .docs-searchbar-suggestion:not(.suggestion-layout-simple) .docs-searchbar-suggestion--category-header{background:#f1f3f5;padding:5px 10px;border-radius:4px;background:#5ec697;font-weight:600;color:#fff}.meilisearch-search-wrapper .meilisearch-autocomplete .docs-searchbar-suggestion:not(.suggestion-layout-simple) .docs-searchbar-suggestion--category-header .docs-searchbar-suggestion--highlight{box-shadow:none;background:#c3ead8}.meilisearch-search-wrapper .meilisearch-autocomplete .docs-searchbar-suggestion:not(.suggestion-layout-simple) .docs-searchbar-suggestion--wrapper{display:flex;padding:0}.meilisearch-search-wrapper .meilisearch-autocomplete .docs-searchbar-suggestion:not(.suggestion-layout-simple) .docs-searchbar-suggestion--wrapper .docs-searchbar-suggestion--highlight{color:#328c63}.meilisearch-search-wrapper .meilisearch-autocomplete .docs-searchbar-suggestion:not(.suggestion-layout-simple) .docs-searchbar-suggestion--title{margin-bottom:0;color:#2c3e50}.meilisearch-search-wrapper .meilisearch-autocomplete .docs-searchbar-suggestion:not(.suggestion-layout-simple) .docs-searchbar-suggestion--subcategory-column{border-color:#eaecef}.meilisearch-search-wrapper .meilisearch-autocomplete .docs-searchbar-suggestion:not(.suggestion-layout-simple) .docs-searchbar-suggestion--subcategory-column-text{color:#555}.meilisearch-search-wrapper .meilisearch-autocomplete .docs-searchbar-suggestion:not(.suggestion-layout-simple) .docs-searchbar-suggestion--text .docs-searchbar-suggestion--highlight{box-shadow:inset 0 -2px 0 0 #5ec697;color:inherit}.meilisearch-search-wrapper .meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--title{color:#3eaf7c}.meilisearch-search-wrapper .meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--title:before{color:#328c63}.meilisearch-search-wrapper .meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--category-header .docs-searchbar-suggestion--highlight{box-shadow:unset;color:#328c63;background-color:rgba(62,175,124,.05)}.meilisearch-search-wrapper .meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--category-header-lvl0 .docs-searchbar-suggestion--highlight,.meilisearch-search-wrapper .meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--category-header-lvl1 .docs-searchbar-suggestion--highlight{background-color:transparent;box-shadow:inset 0 -2px 0 0 #5ec697;color:inherit}.meilisearch-search-wrapper .meilisearch-autocomplete .docs-searchbar-footer{display:flex!important;justify-content:space-between!important;align-items:center!important}.meilisearch-search-wrapper .meilisearch-autocomplete .docs-searchbar-footer .docs-searchbar-footer-logo{margin-bottom:-4px}.meilisearch-search-wrapper .meilisearch-autocomplete .dsb-cursor .docs-searchbar-suggestion--content{background-color:#e7edf3;color:#2c3e50}.meilisearch-search-wrapper div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion,.meilisearch-search-wrapper div[data-ds-theme=dark] .meilisearch-autocomplete .dsb-dropdown-menu [class^=dsb-dataset-]{background:#333a3e}.meilisearch-search-wrapper div[data-ds-theme=dark] .meilisearch-autocomplete input{color:#eaeaea;border:1px solid #545f66;background-color:#444d52}.meilisearch-search-wrapper div[data-ds-theme=dark] .meilisearch-autocomplete input:focus{border-color:#a29bfe}.meilisearch-search-wrapper div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion:not(.suggestion-layout-simple){border-color:#545f66}.meilisearch-search-wrapper div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion:not(.suggestion-layout-simple) .docs-searchbar-suggestion--wrapper .docs-searchbar-suggestion--highlight{color:#a29bfe}.meilisearch-search-wrapper div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion:not(.suggestion-layout-simple) .docs-searchbar-suggestion--category-header{background:#a29bfe}.meilisearch-search-wrapper div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion:not(.suggestion-layout-simple) .docs-searchbar-suggestion--category-header .docs-searchbar-suggestion--highlight{background:#b5affe}.meilisearch-search-wrapper div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion:not(.suggestion-layout-simple) .docs-searchbar-suggestion--title{color:#eaeaea}.meilisearch-search-wrapper div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion:not(.suggestion-layout-simple) .docs-searchbar-suggestion--subcategory-column{border-color:#545f66}.meilisearch-search-wrapper div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion:not(.suggestion-layout-simple) .docs-searchbar-suggestion--subcategory-column-text{color:#eaeaea}.meilisearch-search-wrapper div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion:not(.suggestion-layout-simple) .docs-searchbar-suggestion--text .docs-searchbar-suggestion--highlight{box-shadow:inset 0 -2px 0 0 #b5affe}.meilisearch-search-wrapper div[data-ds-theme=dark] .meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--category-header .docs-searchbar-suggestion--category-header-lvl0 .docs-searchbar-suggestion--highlight,.meilisearch-search-wrapper div[data-ds-theme=dark] .meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--category-header .docs-searchbar-suggestion--category-header-lvl1 .docs-searchbar-suggestion--highlight{box-shadow:inset 0 -2px 0 0 #7c73fe}.meilisearch-search-wrapper div[data-ds-theme=dark] .meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--category-header .docs-searchbar-suggestion--title .docs-searchbar-suggestion--highlight{color:#b5affe;background:rgba(162,155,254,.1)}.meilisearch-search-wrapper div[data-ds-theme=dark] .meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--category-header-lvl0 .docs-searchbar-suggestion--highlight,.meilisearch-search-wrapper div[data-ds-theme=dark] .meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--category-header-lvl1 .docs-searchbar-suggestion--highlight{color:inherit}.meilisearch-search-wrapper div[data-ds-theme=dark] .meilisearch-autocomplete .dsb-dropdown-menu .dsb-suggestions .dsb-cursor .docs-searchbar-suggestion.suggestion-layout-simple,.meilisearch-search-wrapper div[data-ds-theme=dark] .meilisearch-autocomplete .dsb-dropdown-menu .dsb-suggestions .dsb-cursor .docs-searchbar-suggestion:not(.suggestion-layout-simple) .docs-searchbar-suggestion--content{background-color:rgba(162,155,254,.3)}@media (min-width:719px){.meilisearch-search-wrapper .meilisearch-autocomplete .docs-searchbar-suggestion .docs-searchbar-suggestion--subcategory-column{float:none;width:150px;min-width:150px;display:table-cell}.meilisearch-search-wrapper .meilisearch-autocomplete .docs-searchbar-suggestion .docs-searchbar-suggestion--content{float:none;display:table-cell;width:100%;vertical-align:top}.meilisearch-search-wrapper .meilisearch-autocomplete .docs-searchbar-suggestion .dsb-dropdown-menu{min-width:515px!important}}@media (max-width:719px){.meilisearch-search-wrapper .dsb-dropdown-menu{min-width:calc(100vw - 4rem)!important;max-width:calc(100vw - 4rem)!important}.meilisearch-search-wrapper .docs-searchbar-suggestion--wrapper{padding:5px 7px 5px 5px!important}.meilisearch-search-wrapper .docs-searchbar-suggestion--subcategory-column{padding:0!important;background:#fff!important}.meilisearch-search-wrapper .docs-searchbar-suggestion--subcategory-column-text:after{content:" > ";font-size:10px;line-height:14.4px;display:inline-block;width:5px;margin:-3px 3px 0;vertical-align:middle}.meilisearch-search-wrapper div[data-ds-theme=dark] .docs-searchbar-suggestion--subcategory-column{background:transparent!important}}.sidebar-button{cursor:pointer;display:none;width:1.25rem;height:1.25rem;position:absolute;padding:.6rem;top:.6rem;left:1rem}.sidebar-button .icon{display:block;width:1.25rem;height:1.25rem}@media (max-width:719px){.sidebar-button{display:block}}.dropdown-enter,.dropdown-leave-to{height:0!important}.dropdown-wrapper{cursor:pointer}.dropdown-wrapper .dropdown-title,.dropdown-wrapper .mobile-dropdown-title{display:block;font-size:.9rem;font-family:inherit;cursor:inherit;padding:inherit;line-height:1.4rem;background:transparent;border:none;font-weight:500;color:#2c3e50}.dropdown-wrapper .dropdown-title:hover,.dropdown-wrapper .mobile-dropdown-title:hover{border-color:transparent}.dropdown-wrapper .dropdown-title .arrow,.dropdown-wrapper .mobile-dropdown-title .arrow{vertical-align:middle;margin-top:-1px;margin-left:.4rem}.dropdown-wrapper .mobile-dropdown-title{display:none;font-weight:600}.dropdown-wrapper .mobile-dropdown-title font-size inherit:hover{color:#3eaf7c}.dropdown-wrapper .nav-dropdown .dropdown-item{color:inherit;line-height:1.7rem}.dropdown-wrapper .nav-dropdown .dropdown-item h4{margin:.45rem 0 0;border-top:1px solid #eee;padding:1rem 1.5rem .45rem 1.25rem}.dropdown-wrapper .nav-dropdown .dropdown-item .dropdown-subitem-wrapper{padding:0;list-style:none}.dropdown-wrapper .nav-dropdown .dropdown-item .dropdown-subitem-wrapper .dropdown-subitem{font-size:.9em}.dropdown-wrapper .nav-dropdown .dropdown-item a{display:block;line-height:1.7rem;position:relative;border-bottom:none;font-weight:400;margin-bottom:0;padding:0 1.5rem 0 1.25rem}.dropdown-wrapper .nav-dropdown .dropdown-item a.router-link-active,.dropdown-wrapper .nav-dropdown .dropdown-item a:hover{color:#3eaf7c}.dropdown-wrapper .nav-dropdown .dropdown-item a.router-link-active:after{content:"";width:0;height:0;border-left:5px solid #3eaf7c;border-top:3px solid transparent;border-bottom:3px solid transparent;position:absolute;top:calc(50% - 2px);left:9px}.dropdown-wrapper .nav-dropdown .dropdown-item:first-child h4{margin-top:0;padding-top:0;border-top:0}@media (max-width:719px){.dropdown-wrapper.open .dropdown-title{margin-bottom:.5rem}.dropdown-wrapper .dropdown-title{display:none}.dropdown-wrapper .mobile-dropdown-title{display:block}.dropdown-wrapper .nav-dropdown{transition:height .1s ease-out;overflow:hidden}.dropdown-wrapper .nav-dropdown .dropdown-item h4{border-top:0;margin-top:0;padding-top:0}.dropdown-wrapper .nav-dropdown .dropdown-item>a,.dropdown-wrapper .nav-dropdown .dropdown-item h4{font-size:15px;line-height:2rem}.dropdown-wrapper .nav-dropdown .dropdown-item .dropdown-subitem{font-size:14px;padding-left:1rem}}@media (min-width:719px){.dropdown-wrapper{height:1.8rem}.dropdown-wrapper.open .nav-dropdown,.dropdown-wrapper:hover .nav-dropdown{display:block!important}.dropdown-wrapper.open:blur{display:none}.dropdown-wrapper .nav-dropdown{display:none;height:auto!important;box-sizing:border-box;max-height:calc(100vh - 2.7rem);overflow-y:auto;position:absolute;top:100%;right:0;background-color:#fff;padding:.6rem 0;border:1px solid;border-color:#ddd #ddd #ccc;text-align:left;border-radius:.25rem;white-space:nowrap;margin:0}}.nav-links{display:inline-block}.nav-links a{line-height:1.4rem;color:inherit}.nav-links a.router-link-active,.nav-links a:hover{color:#3eaf7c}.nav-links .nav-item{position:relative;display:inline-block;margin-left:1.5rem;line-height:2rem}.nav-links .nav-item:first-child{margin-left:0}.nav-links .repo-link{margin-left:1.5rem}@media (max-width:719px){.nav-links .nav-item,.nav-links .repo-link{margin-left:0}}@media (min-width:719px){.nav-links a.router-link-active,.nav-links a:hover{color:#2c3e50}.nav-item>a:not(.external).router-link-active,.nav-item>a:not(.external):hover{margin-bottom:-2px;border-bottom:2px solid #46bd87}}.navbar{padding:.7rem 1.5rem;line-height:2.2rem}.navbar a,.navbar img,.navbar span{display:inline-block}.navbar .logo{height:2.2rem;min-width:2.2rem;margin-right:.8rem;vertical-align:top}.navbar .site-name{font-size:1.3rem;font-weight:600;color:#2c3e50;position:relative}.navbar .links{padding-left:1.5rem;box-sizing:border-box;background-color:#fff;white-space:nowrap;font-size:.9rem;position:absolute;right:1.5rem;top:.7rem;display:flex}.navbar .links .search-box{flex:0 0 auto;vertical-align:top}@media (max-width:719px){.navbar{padding-left:4rem}.navbar .can-hide{display:none}.navbar .links{padding-left:1.5rem}.navbar .site-name{width:calc(100vw - 9.4rem);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}}.page-edit{max-width:740px;margin:0 auto;padding:2rem 2.5rem}@media (max-width:959px){.page-edit{padding:2rem}}@media (max-width:419px){.page-edit{padding:1.5rem}}.page-edit{padding-top:1rem;padding-bottom:1rem;overflow:auto}.page-edit .edit-link{display:inline-block}.page-edit .edit-link a{color:#4e6e8e;margin-right:.25rem}.page-edit .last-updated{float:right;font-size:.9em}.page-edit .last-updated .prefix{font-weight:500;color:#4e6e8e}.page-edit .last-updated .time{font-weight:400;color:#767676}@media (max-width:719px){.page-edit .edit-link{margin-bottom:.5rem}.page-edit .last-updated{font-size:.8em;float:none;text-align:left}}.page-nav{max-width:740px;margin:0 auto;padding:2rem 2.5rem}@media (max-width:959px){.page-nav{padding:2rem}}@media (max-width:419px){.page-nav{padding:1.5rem}}.page-nav{padding-top:1rem;padding-bottom:0}.page-nav .inner{min-height:2rem;margin-top:0;border-top:1px solid #eaecef;padding-top:1rem;overflow:auto}.page-nav .next{float:right}.page{padding-bottom:2rem;display:block}.sidebar-group .sidebar-group{padding-left:.5em}.sidebar-group:not(.collapsable) .sidebar-heading:not(.clickable){cursor:auto;color:inherit}.sidebar-group.is-sub-group{padding-left:0}.sidebar-group.is-sub-group>.sidebar-heading{font-size:.95em;line-height:1.4;font-weight:400;padding-left:2rem}.sidebar-group.is-sub-group>.sidebar-heading:not(.clickable){opacity:.5}.sidebar-group.is-sub-group>.sidebar-group-items{padding-left:1rem}.sidebar-group.is-sub-group>.sidebar-group-items>li>.sidebar-link{font-size:.95em;border-left:none}.sidebar-group.depth-2>.sidebar-heading{border-left:none}.sidebar-heading{color:#2c3e50;transition:color .15s ease;cursor:pointer;font-size:1.1em;font-weight:700;padding:.35rem 1.5rem .35rem 1.25rem;width:100%;box-sizing:border-box;margin:0;border-left:.25rem solid transparent}.sidebar-heading.open,.sidebar-heading:hover{color:inherit}.sidebar-heading .arrow{position:relative;top:-.12em;left:.5em}.sidebar-heading.clickable.active{font-weight:600;color:#3eaf7c;border-left-color:#3eaf7c}.sidebar-heading.clickable:hover{color:#3eaf7c}.sidebar-group-items{transition:height .1s ease-out;font-size:.95em;overflow:hidden}.sidebar .sidebar-sub-headers{padding-left:1rem;font-size:.95em}a.sidebar-link{font-size:1em;font-weight:400;display:inline-block;color:#2c3e50;border-left:.25rem solid transparent;padding:.35rem 1rem .35rem 1.25rem;line-height:1.4;width:100%;box-sizing:border-box}a.sidebar-link:hover{color:#3eaf7c}a.sidebar-link.active{font-weight:600;color:#3eaf7c;border-left-color:#3eaf7c}.sidebar-group a.sidebar-link{padding-left:2rem}.sidebar-sub-headers a.sidebar-link{padding-top:.25rem;padding-bottom:.25rem;border-left:none}.sidebar-sub-headers a.sidebar-link.active{font-weight:500}.sidebar ul{padding:0;margin:0;list-style-type:none}.sidebar a{display:inline-block}.sidebar .nav-links{display:none;border-bottom:1px solid #eaecef;padding:.5rem 0 .75rem}.sidebar .nav-links a{font-weight:600}.sidebar .nav-links .nav-item,.sidebar .nav-links .repo-link{display:block;line-height:1.25rem;font-size:1.1em;padding:.5rem 0 .5rem 1.5rem}.sidebar>.sidebar-links{padding:1.5rem 0}.sidebar>.sidebar-links>li>a.sidebar-link{font-size:1.1em;line-height:1.7;font-weight:700}.sidebar>.sidebar-links>li:not(:first-child){margin-top:.75rem}@media (max-width:719px){.sidebar .nav-links{display:block}.sidebar .nav-links .dropdown-wrapper .nav-dropdown .dropdown-item a.router-link-active:after{top:calc(1rem - 2px)}.sidebar>.sidebar-links{padding:1rem 0}}.search-box input{color:var(--lighten25TextColor);border-color:var(--darken10BorderColor);background-color:var(--bgColor)}.search-box input:focus{border-color:var(--accentColor)}.search-box .suggestions{background:var(--bgColor);border-color:var(--darken10BorderColor)}.search-box .suggestion a{color:var(--lighten35TextColor)}.search-box .suggestion.focused{background-color:var(--darken10BgColor)}.search-box .suggestion.focused a{color:var(--accentColor)}.algolia-search-wrapper .algolia-autocomplete .ds-dropdown-menu{background:var(--bgColor);border-color:var(--searchBorderColor)}.algolia-search-wrapper .algolia-autocomplete .ds-dropdown-menu:before{border-color:var(--searchBorderColor)}.algolia-search-wrapper .algolia-autocomplete .ds-dropdown-menu .ds-suggestion{border-bottom-color:var(--borderColor)}.algolia-search-wrapper .algolia-autocomplete .algolia-docsearch-suggestion{border-color:var(--borderColor)}.algolia-search-wrapper .algolia-autocomplete .algolia-docsearch-suggestion .algolia-docsearch-suggestion--category-header{background:var(--accentColor)}.algolia-search-wrapper .algolia-autocomplete .algolia-docsearch-suggestion .algolia-docsearch-suggestion--title{color:var(--textColor)}.algolia-search-wrapper .algolia-autocomplete .algolia-docsearch-footer,.algolia-search-wrapper .algolia-autocomplete .algolia-docsearch-suggestion .algolia-docsearch-suggestion--subcategory-column{border-color:var(--borderColor)}.algolia-search-wrapper .algolia-autocomplete .ds-cursor .algolia-docsearch-suggestion--content,.dropdown-wrapper .dropdown-title,.dropdown-wrapper .mobile-dropdown-title{color:var(--textColor)}.dropdown-wrapper .nav-dropdown .dropdown-item h4{border-top-color:var(--kbdBgColor)}.dropdown-wrapper .nav-dropdown .dropdown-item a.router-link-active,.dropdown-wrapper .nav-dropdown .dropdown-item a:hover{color:var(--accentColor)}.dropdown-wrapper .nav-dropdown .dropdown-item a.router-link-active:after{border-left-color:var(--accentColor)}@media (max-width:719px){.dropdown-wrapper .dropdown-title:hover{color:var(--accentColor)}}@media (min-width:719px){.dropdown-wrapper .dropdown-title .arrow{border-top-color:var(--arrowBgColor)}.dropdown-wrapper .nav-dropdown{background-color:var(--bgColor);border-color:var(--borderColor)}}.home .hero .description{color:var(--lighten40TextColor)}.home .hero .action-button{background-color:var(--accentColor);border-bottom-color:var(--darken10AccentColor)}.home .hero .action-button:hover{background-color:var(--lighten10AccentColor)}.home .features{border-top-color:var(--borderColor)}.home .feature h2{color:var(--lighten10TextColor)}.home .feature p,.home .footer{color:var(--lighten25TextColor)}.home .footer{border-top-color:var(--borderColor)}.navbar .site-name{color:var(--textColor);white-space:nowrap}.navbar .links{background:var(--bgColor)}.nav-links a.router-link-active,.nav-links a:hover{color:var(--accentColor)}@media (min-width:719px){.nav-links a.router-link-active,.nav-links a:hover{color:var(--textColor)}}@media (min-width:719px){.nav-item>a:not(.external).router-link-active,.nav-item>a:not(.external):hover{border-bottom-color:var(--accentColor)}}.page-edit .edit-link a,.page-edit .last-updated .prefix{color:var(--lighten25TextColor)}.page-edit .last-updated .time{color:var(--lighten40TextColor)}.page-nav .inner,.sidebar .nav-links{border-color:var(--borderColor)}.sidebar-heading{color:var(--textColor)}.sidebar-heading.clickable.active{color:var(--accentColor);border-left-color:var(--accentColor)}.sidebar-heading.clickable:hover{color:var(--accentColor)}a.sidebar-link{color:var(--textColor)}a.sidebar-link.active,a.sidebar-link:hover{color:var(--accentColor)}a.sidebar-link.active{border-left-color:var(--accentColor)}.badge[data-v-15b7b770]{display:inline-block;font-size:14px;height:18px;line-height:18px;border-radius:3px;padding:0 6px;color:#fff}.badge.green[data-v-15b7b770],.badge.tip[data-v-15b7b770],.badge[data-v-15b7b770]{background-color:#42b983}.badge.error[data-v-15b7b770]{background-color:#da5961}.badge.warn[data-v-15b7b770],.badge.warning[data-v-15b7b770],.badge.yellow[data-v-15b7b770]{background-color:#e7c000}.badge+.badge[data-v-15b7b770]{margin-left:5px}.theme-code-group__nav[data-v-deefee04]{margin-bottom:-35px;background-color:#282c34;padding-bottom:22px;border-top-left-radius:6px;border-top-right-radius:6px;padding-left:10px;padding-top:10px}.theme-code-group__ul[data-v-deefee04]{margin:auto 0;padding-left:0;display:inline-flex;list-style:none}.theme-code-group__nav-tab[data-v-deefee04]{border:0;padding:5px;cursor:pointer;background-color:transparent;font-size:.85em;line-height:1.4;color:hsla(0,0%,100%,.9);font-weight:600}.theme-code-group__nav-tab-active[data-v-deefee04]{border-bottom:1px solid #42b983}.pre-blank[data-v-deefee04]{color:#42b983}.theme-code-block[data-v-759a7d02]{display:none}.theme-code-block__active[data-v-759a7d02]{display:block}.theme-code-block>pre[data-v-759a7d02]{background-color:orange}.searchbox{display:inline-block;position:relative;width:200px;height:32px;white-space:nowrap;box-sizing:border-box;visibility:visible}.searchbox .meilisearch-autocomplete{display:block;width:100%;height:100%}.searchbox__wrapper{width:100%;height:100%;z-index:999;position:relative}.searchbox input{color:#555;display:inline-block;box-sizing:border-box;transition:box-shadow .4s ease,background .4s ease;border:0;border-radius:16px;box-shadow:inset 0 0 0 1px #ccc;background:#fff;padding:0 26px 0 32px;width:100%;height:100%;vertical-align:middle;white-space:normal;font-size:12px;-webkit-appearance:none;-moz-appearance:none;appearance:none}.searchbox input::-webkit-search-cancel-button,.searchbox input::-webkit-search-decoration,.searchbox input::-webkit-search-results-button,.searchbox input::-webkit-search-results-decoration{display:none}.searchbox input:hover{box-shadow:inset 0 0 0 1px #b3b3b3}.searchbox input:active,.searchbox input:focus{outline:0;box-shadow:inset 0 0 0 1px #aaa;background:#fff}.searchbox input::-moz-placeholder{color:#aaa}.searchbox input:-ms-input-placeholder{color:#aaa}.searchbox input::placeholder{color:#aaa}.searchbox__submit{position:absolute;top:0;margin:0;border:0;border-radius:16px 0 0 16px;background-color:rgba(69,142,225,0);padding:0;width:32px;height:100%;vertical-align:middle;text-align:center;font-size:inherit;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;right:inherit;left:0}.searchbox__submit:before{display:inline-block;margin-right:-4px;height:100%;vertical-align:middle;content:""}.searchbox__submit:active,.searchbox__submit:hover{cursor:pointer}.searchbox__submit:focus{outline:0}.searchbox__submit svg{width:14px;height:14px;vertical-align:middle;fill:#6d7e96}.searchbox__reset{display:block;position:absolute;top:8px;right:8px;margin:0;border:0;background:none;cursor:pointer;padding:0;font-size:inherit;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;fill:rgba(0,0,0,.5)}.searchbox__reset.hide{display:none}.searchbox__reset:focus{outline:0}.searchbox__reset svg{display:block;margin:4px;width:8px;height:8px}.searchbox__input:valid~.searchbox__reset{display:block;-webkit-animation-name:sbx-reset-in;animation-name:sbx-reset-in;-webkit-animation-duration:.15s;animation-duration:.15s}@-webkit-keyframes sbx-reset-in{0%{transform:translate3d(-20%,0,0);opacity:0}to{transform:none;opacity:1}}.meilisearch-autocomplete.meilisearch-autocomplete-right .dsb-dropdown-menu{right:0;left:inherit}.meilisearch-autocomplete.meilisearch-autocomplete-right .dsb-dropdown-menu:before{right:48px}.meilisearch-autocomplete.meilisearch-autocomplete-left .dsb-dropdown-menu{left:0;right:inherit}.meilisearch-autocomplete.meilisearch-autocomplete-left .dsb-dropdown-menu:before{left:48px}.meilisearch-autocomplete .dsb-dropdown-menu{position:relative;top:-6px;border-radius:4px;margin:6px 0 0;padding:0;text-align:left;height:auto;background:transparent;border:none;z-index:999;max-width:600px;min-width:500px;box-shadow:0 1px 0 0 rgba(0,0,0,.2),0 2px 3px 0 rgba(0,0,0,.1)}.meilisearch-autocomplete .dsb-dropdown-menu:before{display:block;position:absolute;content:"";width:14px;height:14px;background:#fff;z-index:1000;top:-7px;border-top:1px solid #d9d9d9;border-right:1px solid #d9d9d9;transform:rotate(-45deg);border-radius:2px}.meilisearch-autocomplete .dsb-dropdown-menu .dsb-suggestions{position:relative;z-index:1000;margin-top:8px}.meilisearch-autocomplete .dsb-dropdown-menu .dsb-suggestions a:hover{text-decoration:none}.meilisearch-autocomplete .dsb-dropdown-menu .dsb-suggestion{cursor:pointer}.meilisearch-autocomplete .dsb-dropdown-menu .dsb-suggestion.dsb-cursor .docs-searchbar-suggestion.suggestion-layout-simple,.meilisearch-autocomplete .dsb-dropdown-menu .dsb-suggestion.dsb-cursor .docs-searchbar-suggestion:not(.suggestion-layout-simple) .docs-searchbar-suggestion--content{background-color:rgba(69,142,225,.05)}.meilisearch-autocomplete .dsb-dropdown-menu [class^=dsb-dataset-]{position:relative;border:1px solid #d9d9d9;background:#fff;border-radius:4px;overflow:auto;padding:0 8px 8px}.meilisearch-autocomplete .dsb-dropdown-menu *{box-sizing:border-box}.meilisearch-autocomplete .docs-searchbar-suggestion{display:block;position:relative;padding:0 8px;background:#fff;color:#02060c;overflow:hidden}.meilisearch-autocomplete .docs-searchbar-suggestion--highlight{color:#174d8c;background:rgba(143,187,237,.1);padding:0 .05em}.meilisearch-autocomplete .docs-searchbar-suggestion--category-header .docs-searchbar-suggestion--category-header-lvl0 .docs-searchbar-suggestion--highlight,.meilisearch-autocomplete .docs-searchbar-suggestion--category-header .docs-searchbar-suggestion--category-header-lvl1 .docs-searchbar-suggestion--highlight,.meilisearch-autocomplete .docs-searchbar-suggestion--text .docs-searchbar-suggestion--highlight{padding:0 0 1px;background:inherit;box-shadow:inset 0 -2px 0 0 rgba(69,142,225,.8);color:inherit}.meilisearch-autocomplete .docs-searchbar-suggestion--content{display:block;width:70%;position:relative;padding:5.3333333333px 0 5.3333333333px 10.6666666667px;cursor:pointer}.meilisearch-autocomplete .docs-searchbar-suggestion--content:before{content:"";position:absolute;display:block;top:0;height:100%;width:1px;background:#ddd;left:-1px}.meilisearch-autocomplete .docs-searchbar-suggestion--category-header{position:relative;border-bottom:1px solid #ddd;display:none;margin-top:8px;padding:4px 0;font-size:1em;color:#33363d}.meilisearch-autocomplete .docs-searchbar-suggestion--wrapper{width:100%;display:flex;align-items:flex-start;padding:8px 0 0}.meilisearch-autocomplete .docs-searchbar-suggestion--subcategory-column{width:30%;text-align:right;position:relative;padding:5.3333333333px 10.6666666667px;color:#a4a7ae;font-size:.9em;word-wrap:break-word}.meilisearch-autocomplete .docs-searchbar-suggestion--subcategory-column:before{content:"";position:absolute;display:block;top:0;height:100%;width:1px;background:#ddd;right:0}.meilisearch-autocomplete .docs-searchbar-suggestion--subcategory-inline{display:none}.meilisearch-autocomplete .docs-searchbar-suggestion--title{margin-bottom:4px;color:#02060c;font-size:.9em;font-weight:700}.meilisearch-autocomplete .docs-searchbar-suggestion--text{display:block;line-height:1.2em;font-size:.85em;color:#63676d}.meilisearch-autocomplete .docs-searchbar-suggestion--no-results{width:100%;padding:8px 0;text-align:center;font-size:1.2em}.meilisearch-autocomplete .docs-searchbar-suggestion--no-results:before{display:none}.meilisearch-autocomplete .docs-searchbar-suggestion code{padding:1px 5px;font-size:90%;border:none;color:#222;background-color:#ebebeb;border-radius:3px;font-family:Menlo,Monaco,Consolas,Courier New,monospace}.meilisearch-autocomplete .docs-searchbar-suggestion code .docs-searchbar-suggestion--highlight{background:none}.meilisearch-autocomplete .docs-searchbar-suggestion.docs-searchbar-suggestion__main .docs-searchbar-suggestion--category-header,.meilisearch-autocomplete .docs-searchbar-suggestion.docs-searchbar-suggestion__secondary{display:block}@media (min-width:768px){.meilisearch-autocomplete .docs-searchbar-suggestion .docs-searchbar-suggestion--subcategory-column{display:block}}@media (max-width:768px){.meilisearch-autocomplete .docs-searchbar-suggestion .docs-searchbar-suggestion--subcategory-column{display:inline-block;width:auto;text-align:left;padding:0;font-size:.9em;font-weight:700;opacity:.5;color:#02060c}.meilisearch-autocomplete .docs-searchbar-suggestion .docs-searchbar-suggestion--subcategory-column:before{display:none}.meilisearch-autocomplete .docs-searchbar-suggestion .docs-searchbar-suggestion--subcategory-column:after{content:"|"}.meilisearch-autocomplete .docs-searchbar-suggestion .docs-searchbar-suggestion--content{display:inline-block;width:auto;text-align:left;padding:0}.meilisearch-autocomplete .docs-searchbar-suggestion .docs-searchbar-suggestion--content:before{display:none}}.meilisearch-autocomplete .suggestion-layout-simple.docs-searchbar-suggestion{border-bottom:1px solid #eee;padding:8px;margin:0}.meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--content{width:100%;padding:0}.meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--content:before{display:none}.meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--category-header{margin:0;padding:0;display:block;width:100%;border:none}.meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--category-header-lvl0,.meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--category-header-lvl1{opacity:.6;font-size:.85em}.meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--category-header-lvl1:before{background-image:url('data:image/svg+xml;utf8,');content:"";width:10px;height:10px;display:inline-block}.meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--wrapper{width:100%;margin:0;padding:0}.meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--duplicate-content,.meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--subcategory-inline{display:none}.meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--title{margin:0;color:#458ee1;font-size:.9em;font-weight:400}.meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--title:before{content:"#";font-weight:700;color:#458ee1;display:inline-block}.meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--text{margin:4px 0 0;display:block;line-height:1.4em;padding:5.3333333333px 8px;background:#f8f8f8;font-size:.85em;opacity:.8}.meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--text .docs-searchbar-suggestion--highlight{color:#3f4145;font-weight:700;box-shadow:none}.meilisearch-autocomplete .docs-searchbar-footer{width:100%;text-align:right;height:20px;z-index:2000;margin-top:10.6666666667px;color:#63676d;margin-left:auto}.meilisearch-autocomplete .docs-searchbar-footer-logo{margin-bottom:4px}div[data-ds-theme=dark] .searchbox{display:inline-block;position:relative;width:350px;height:32px;white-space:nowrap;box-sizing:border-box;visibility:visible}div[data-ds-theme=dark] .searchbox .meilisearch-autocomplete{display:block;width:100%;height:100%}div[data-ds-theme=dark] .searchbox__wrapper{width:100%;height:100%;z-index:999;position:relative}div[data-ds-theme=dark] .searchbox input{color:#eaeaea;display:inline-block;box-sizing:border-box;transition:box-shadow .4s ease,background .4s ease;border:0;border-radius:16px;box-shadow:inset 0 0 0 1px #686d71;background:#444d52;padding:0 26px 0 32px;width:100%;height:100%;vertical-align:middle;white-space:normal;font-size:90%;-webkit-appearance:none;-moz-appearance:none;appearance:none}div[data-ds-theme=dark] .searchbox input::-webkit-search-cancel-button,div[data-ds-theme=dark] .searchbox input::-webkit-search-decoration,div[data-ds-theme=dark] .searchbox input::-webkit-search-results-button,div[data-ds-theme=dark] .searchbox input::-webkit-search-results-decoration{display:none}div[data-ds-theme=dark] .searchbox input:hover{box-shadow:inset 0 0 0 1px #505356;box-shadow:inset 0 0 0 1px #747a7e}div[data-ds-theme=dark] .searchbox input:active,div[data-ds-theme=dark] .searchbox input:focus{outline:0;box-shadow:inset 0 0 0 1px #919598;background:#444d52}div[data-ds-theme=dark] .searchbox input::-moz-placeholder{color:#bbb}div[data-ds-theme=dark] .searchbox input:-ms-input-placeholder{color:#bbb}div[data-ds-theme=dark] .searchbox input::placeholder{color:#bbb}div[data-ds-theme=dark] .searchbox__submit{position:absolute;top:0;margin:0;border:0;border-radius:16px 0 0 16px;background-color:rgba(69,142,225,0);padding:0;width:32px;height:100%;vertical-align:middle;text-align:center;font-size:inherit;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;right:inherit;left:0}div[data-ds-theme=dark] .searchbox__submit:before{display:inline-block;margin-right:-4px;height:100%;vertical-align:middle;content:""}div[data-ds-theme=dark] .searchbox__submit:active,div[data-ds-theme=dark] .searchbox__submit:hover{cursor:pointer}div[data-ds-theme=dark] .searchbox__submit:focus{outline:0}div[data-ds-theme=dark] .searchbox__submit svg{width:14px;height:14px;vertical-align:middle;fill:#6d7e96}div[data-ds-theme=dark] .searchbox__reset{display:block;position:absolute;top:5px;right:5px;margin:0;border:0;background:none;cursor:pointer;padding:0;font-size:inherit;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;fill:rgba(0,0,0,.5)}div[data-ds-theme=dark] .searchbox__reset.hide{display:none}div[data-ds-theme=dark] .searchbox__reset:focus{outline:0}div[data-ds-theme=dark] .searchbox__reset svg{display:block;margin:4px;width:14px;height:14px}div[data-ds-theme=dark] .searchbox__input:valid~div[data-ds-theme=dark] .searchbox__reset{display:block;-webkit-animation-name:sbx-reset-in;animation-name:sbx-reset-in;-webkit-animation-duration:.15s;animation-duration:.15s}@keyframes sbx-reset-in{0%{transform:translate3d(-20%,0,0);opacity:0}to{transform:none;opacity:1}}div[data-ds-theme=dark] .meilisearch-autocomplete.meilisearch-autocomplete-right .dsb-dropdown-menu{right:0;left:inherit}div[data-ds-theme=dark] .meilisearch-autocomplete.meilisearch-autocomplete-right .dsb-dropdown-menu:before{right:48px}div[data-ds-theme=dark] .meilisearch-autocomplete.meilisearch-autocomplete-left .dsb-dropdown-menu{left:0;right:inherit}div[data-ds-theme=dark] .meilisearch-autocomplete.meilisearch-autocomplete-left .dsb-dropdown-menu:before{left:48px}div[data-ds-theme=dark] .meilisearch-autocomplete .dsb-dropdown-menu{position:relative;top:-6px;border-radius:4px;margin:6px 0 0;padding:0;text-align:left;height:auto;background:transparent;border:none;z-index:999;max-width:600px;min-width:500px;box-shadow:0 1px 0 0 rgba(0,0,0,.2),0 2px 3px 0 rgba(0,0,0,.1)}div[data-ds-theme=dark] .meilisearch-autocomplete .dsb-dropdown-menu:before{display:block;position:absolute;content:"";width:14px;height:14px;background:#2c363e;z-index:1000;top:-7px;border-top:1px solid #5b6369;border-right:1px solid #5b6369;transform:rotate(-45deg);border-radius:2px}div[data-ds-theme=dark] .meilisearch-autocomplete .dsb-dropdown-menu .dsb-suggestions{position:relative;z-index:1000;margin-top:8px}div[data-ds-theme=dark] .meilisearch-autocomplete .dsb-dropdown-menu .dsb-suggestions a:hover{text-decoration:none}div[data-ds-theme=dark] .meilisearch-autocomplete .dsb-dropdown-menu .dsb-suggestion{cursor:pointer}div[data-ds-theme=dark] .meilisearch-autocomplete .dsb-dropdown-menu .dsb-suggestion.dsb-cursor .docs-searchbar-suggestion.suggestion-layout-simple,div[data-ds-theme=dark] .meilisearch-autocomplete .dsb-dropdown-menu .dsb-suggestion.dsb-cursor .docs-searchbar-suggestion:not(.suggestion-layout-simple) .docs-searchbar-suggestion--content{background-color:rgba(69,142,225,.5)}div[data-ds-theme=dark] .meilisearch-autocomplete .dsb-dropdown-menu [class^=dsb-dataset-]{position:relative;border:1px solid #5b6369;background:#2c363e;border-radius:4px;overflow:auto;padding:0 8px 8px}div[data-ds-theme=dark] .meilisearch-autocomplete .dsb-dropdown-menu *{box-sizing:border-box}div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion{display:block;position:relative;padding:0 8px;background:#2c363e;color:#eaeaea;overflow:hidden}div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion--highlight{color:#174d8c;background:rgba(143,187,237,.1);padding:0 .05em;color:#9dc3ef}div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion--category-header .docs-searchbar-suggestion--category-header-lvl0 .docs-searchbar-suggestion--highlight,div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion--category-header .docs-searchbar-suggestion--category-header-lvl1 .docs-searchbar-suggestion--highlight,div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion--text .docs-searchbar-suggestion--highlight{padding:0 0 1px;background:inherit;box-shadow:inset 0 -2px 0 0 rgba(69,142,225,.8);color:inherit}div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion--content{display:block;width:70%;position:relative;padding:5.3333333333px 0 5.3333333333px 10.6666666667px;cursor:pointer}div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion--content:before{content:"";position:absolute;display:block;top:0;height:100%;width:1px;background:#ddd;left:-1px}div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion--category-header{position:relative;border-bottom:1px solid #ddd;display:none;margin-top:8px;padding:4px 0;font-size:1em;color:#7db0ea;color:#d5d5d5}div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion--wrapper{width:100%;display:flex;align-items:flex-start;padding:8px 0 0}div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion--subcategory-column{width:30%;text-align:right;position:relative;padding:5.3333333333px 10.6666666667px;color:#bbb;font-size:.9em;word-wrap:break-word}div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion--subcategory-column:before{content:"";position:absolute;display:block;top:0;height:100%;width:1px;background:#ddd;right:0}div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion--subcategory-inline{display:none}div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion--title{margin-bottom:4px;color:#eaeaea;font-size:.9em;font-weight:700}div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion--text{display:block;line-height:1.2em;font-size:.85em;color:#eaeaea}div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion--no-results{width:100%;padding:8px 0;text-align:center;font-size:1.2em}div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion--no-results:before{display:none}div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion code{padding:1px 5px;font-size:90%;border:none;color:#222;background-color:#ebebeb;border-radius:3px;font-family:Menlo,Monaco,Consolas,Courier New,monospace}div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion code .docs-searchbar-suggestion--highlight{background:none}div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion.docs-searchbar-suggestion__main .docs-searchbar-suggestion--category-header,div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion.docs-searchbar-suggestion__secondary{display:block}@media (min-width:768px){div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion .docs-searchbar-suggestion--subcategory-column{display:block}}@media (max-width:768px){div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion .docs-searchbar-suggestion--subcategory-column{display:inline-block;width:auto;text-align:left;padding:0;font-size:.9em;font-weight:700;opacity:.5;color:#02060c;color:#bbb;opacity:unset}div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion .docs-searchbar-suggestion--subcategory-column:before{display:none}div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion .docs-searchbar-suggestion--subcategory-column:after{content:"|"}div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion .docs-searchbar-suggestion--content{display:inline-block;width:auto;text-align:left;padding:0}div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-suggestion .docs-searchbar-suggestion--content:before{display:none}}div[data-ds-theme=dark] .meilisearch-autocomplete .suggestion-layout-simple.docs-searchbar-suggestion{padding:8px;margin:0;border-bottom:1px solid #737d84}div[data-ds-theme=dark] .meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--content{width:100%;padding:0}div[data-ds-theme=dark] .meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--content:before{display:none}div[data-ds-theme=dark] .meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--category-header{margin:0;padding:0;display:block;width:100%;border:none}div[data-ds-theme=dark] .meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--category-header-lvl0,div[data-ds-theme=dark] .meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--category-header-lvl1{opacity:.6;font-size:.85em;opacity:unset;color:#d5d5d5}div[data-ds-theme=dark] .meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--category-header-lvl1:before{background-image:url('data:image/svg+xml;utf8,');content:"";width:10px;height:10px;display:inline-block;filter:invert(1)}div[data-ds-theme=dark] .meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--wrapper{width:100%;margin:0;padding:0}div[data-ds-theme=dark] .meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--duplicate-content,div[data-ds-theme=dark] .meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--subcategory-inline{display:none}div[data-ds-theme=dark] .meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--title{margin:0;color:#458ee1;font-size:.9em;font-weight:400;color:#eaeaea}div[data-ds-theme=dark] .meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--title:before{content:"#";font-weight:700;color:#458ee1;display:inline-block;color:#eaeaea}div[data-ds-theme=dark] .meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--text{margin:4px 0 0;display:block;line-height:1.4em;padding:5.3333333333px 8px;background:#6b7278;font-size:.85em;opacity:.8}div[data-ds-theme=dark] .meilisearch-autocomplete .suggestion-layout-simple .docs-searchbar-suggestion--text .docs-searchbar-suggestion--highlight{color:#c4c4c4;font-weight:700;box-shadow:none;color:#fff}div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-footer{width:100%;text-align:right;height:20px;z-index:2000;margin-top:10.6666666667px;color:#eaeaea;margin-left:auto}div[data-ds-theme=dark] .meilisearch-autocomplete .docs-searchbar-footer-logo{margin-bottom:4px;filter:invert(1)} \ No newline at end of file diff --git a/docs/assets/js/10.4bb9eeac.js b/docs/assets/js/10.7104dc1c.js similarity index 98% rename from docs/assets/js/10.4bb9eeac.js rename to docs/assets/js/10.7104dc1c.js index 503b653b1..4123383c0 100644 --- a/docs/assets/js/10.4bb9eeac.js +++ b/docs/assets/js/10.7104dc1c.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[10],{434:function(e,t,a){"use strict";a.r(t);var i=a(62),s=Object(i.a)({},(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[a("h1",{attrs:{id:"specifications-workflow"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#specifications-workflow"}},[e._v("#")]),e._v(" Specifications Workflow")]),e._v(" "),a("p",[e._v("This repository manages the specifications of the Meilisearch API. Specifications are meant to describe the expected behavior on a high level and point out identified corner cases.")]),e._v(" "),a("h2",{attrs:{id:"draft-state-create-a-new-pr"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#draft-state-create-a-new-pr"}},[e._v("#")]),e._v(" Draft State: Create a new PR")]),e._v(" "),a("p",[e._v("To start a new specification, a new branch must start")]),e._v(" "),a("ul",[a("li",[e._v("from "),a("code",[e._v("release-vX.X.X")]),e._v(" if the related changes are already planned for the release "),a("code",[e._v("vX.X.X")])]),e._v(" "),a("li",[e._v("from "),a("code",[e._v("main")]),e._v(" if you don't know in which release the changes will be integrated")])]),e._v(" "),a("p",[e._v("If a new specification file needs to be introduced, you must create a new file in "),a("a",{attrs:{href:"https://github.com/meilisearch/specifications/tree/main/text",target:"_blank",rel:"noopener noreferrer"}},[e._v("this folder"),a("OutboundLink")],1),e._v(" following the pattern: "),a("code",[e._v("PR_number-feature-name.md")]),e._v(". e.g. if PR number 12 is about facetting, the newly introduced specification file will be named "),a("code",[e._v("0012-facetting.md")]),e._v(".")]),e._v(" "),a("blockquote",[a("p",[e._v("Note that a pull request not strictly dealing about a specification conception will be tagged as "),a("code",[e._v("Not A Spec")]),e._v(". e.g. A pull-request updating this file will be tagged with the "),a("code",[e._v("Not A Spec")]),e._v(" label.")])]),e._v(" "),a("p",[e._v("The "),a("RouterLink",{attrs:{to:"/specifications/pull_request_template.html"}},[e._v("pull-request template")]),e._v(" must be filled in when the pull-request is created.")],1),e._v(" "),a("h2",{attrs:{id:"review-state"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#review-state"}},[e._v("#")]),e._v(" Review State")]),e._v(" "),a("p",[e._v("It's up to the maintainers of this repository to decide when the PR is ready to be reviewed and which persons should review it.")]),e._v(" "),a("p",[e._v("The PR must be tagged as "),a("code",[e._v("Ready For Review")]),e._v(" to enter this stage.")]),e._v(" "),a("p",[e._v("To be validated, it must be reviewed and approved by peers, ideally:")]),e._v(" "),a("ul",[a("li",[e._v("One person from the Engine team.")]),e._v(" "),a("li",[e._v("One person from the Integration team.")]),e._v(" "),a("li",[e._v("One person from the Documentation team.")])]),e._v(" "),a("h2",{attrs:{id:"merge-state"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#merge-state"}},[e._v("#")]),e._v(" Merge State")]),e._v(" "),a("p",[e._v("To be merged, a specification pull-request should follow the given rules:")]),e._v(" "),a("ul",[a("li",[e._v("It must be approved as described in the "),a("a",{attrs:{href:"#review-state"}},[e._v("Review State")]),e._v(" section.")]),e._v(" "),a("li",[e._v("The PR must point to the right "),a("code",[e._v("release-vX.X.X")]),e._v(" branch.")]),e._v(" "),a("li",[e._v("It must be tagged with:\n"),a("ul",[a("li",[e._v("A "),a("code",[e._v("vX.X.X")]),e._v(" tag indicating in which release the described changes will be introduced.")]),e._v(" "),a("li",[e._v("A "),a("code",[e._v("QX:YYYY")]),e._v(" tag indicating in which quarter and year the described changes will be introduced.")]),e._v(" "),a("li",[e._v("The "),a("code",[e._v("⚠ Breaking")]),e._v(" tag, if breaking changes are introduced.")]),e._v(" "),a("li",[e._v("The "),a("code",[e._v("Telemetry")]),e._v(" tag, if telemetry changes are introduced.")]),e._v(" "),a("li",[e._v("The "),a("code",[e._v("OpenAPI")]),e._v(" tag, if the "),a("a",{attrs:{href:"open-api.yaml"}},[e._v("open-api")]),e._v(" specification will see changes introduced.")])])])]),e._v(" "),a("hr"),e._v(" "),a("h1",{attrs:{id:"release-worfklow"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#release-worfklow"}},[e._v("#")]),e._v(" Release Worfklow")]),e._v(" "),a("p",[e._v("The following steps should happen the day a Meilisearch release is shipped:")]),e._v(" "),a("ul",[a("li",[e._v("Pull-requests describing changes for a release are squashed and merged into the corresponding "),a("code",[e._v("release-vX.X.X")]),e._v(" branch.")]),e._v(" "),a("li",[a("code",[e._v("release-vX.X.X")]),e._v(" is squashed and merged into "),a("code",[e._v("main")]),e._v(".")]),e._v(" "),a("li",[a("code",[e._v("open-api.yml")]),e._v(" version is deployed on bump.sh.")])]),e._v(" "),a("hr"),e._v(" "),a("h2",{attrs:{id:"specification-file-format"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#specification-file-format"}},[e._v("#")]),e._v(" Specification File Format")]),e._v(" "),a("p",[e._v("Meilisearch's feature specifications are made up of five sections, described below.")]),e._v(" "),a("h3",{attrs:{id:"_1-summary"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-summary"}},[e._v("#")]),e._v(" 1. Summary")]),e._v(" "),a("p",[e._v("Summarize the specification with a short paragraph.")]),e._v(" "),a("h3",{attrs:{id:"_2-motivation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-motivation"}},[e._v("#")]),e._v(" 2. Motivation")]),e._v(" "),a("p",[e._v("Explain which use cases are supported.")]),e._v(" "),a("h3",{attrs:{id:"_3-functional-specification"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-functional-specification"}},[e._v("#")]),e._v(" 3. Functional Specification")]),e._v(" "),a("p",[e._v("This section gives a high level overview of the feature. It should avoid technical language so that it can be understood by a general audience (think user-level).")]),e._v(" "),a("ul",[a("li",[e._v("Describe the API resource and endpoints. (Methods, URL, query parameters, body definition, status code).")]),e._v(" "),a("li",[e._v("Explain the feature through examples.")]),e._v(" "),a("li",[e._v("List error cases.")])]),e._v(" "),a("h3",{attrs:{id:"_4-technical-details-optional"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-technical-details-optional"}},[e._v("#")]),e._v(" 4. Technical Details (Optional)")]),e._v(" "),a("p",[e._v('When needed, we recommend describing practical aspects of implementation, e.g. specific algorithmic choices. If none, fill the section body with "n/a".')]),e._v(" "),a("h3",{attrs:{id:"_5-future-possibilities-optional"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-future-possibilities-optional"}},[e._v("#")]),e._v(" 5. Future Possibilities (Optional)")]),e._v(" "),a("p",[e._v('This last section includes any related topics or features which are not currently in Meilisearch and will not be added now, but which may be explored in the future. If none, fill the section body with "n/a".')])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[10],{436:function(e,t,a){"use strict";a.r(t);var i=a(62),s=Object(i.a)({},(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[a("h1",{attrs:{id:"specifications-workflow"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#specifications-workflow"}},[e._v("#")]),e._v(" Specifications Workflow")]),e._v(" "),a("p",[e._v("This repository manages the specifications of the Meilisearch API. Specifications are meant to describe the expected behavior on a high level and point out identified corner cases.")]),e._v(" "),a("h2",{attrs:{id:"draft-state-create-a-new-pr"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#draft-state-create-a-new-pr"}},[e._v("#")]),e._v(" Draft State: Create a new PR")]),e._v(" "),a("p",[e._v("To start a new specification, a new branch must start")]),e._v(" "),a("ul",[a("li",[e._v("from "),a("code",[e._v("release-vX.X.X")]),e._v(" if the related changes are already planned for the release "),a("code",[e._v("vX.X.X")])]),e._v(" "),a("li",[e._v("from "),a("code",[e._v("main")]),e._v(" if you don't know in which release the changes will be integrated")])]),e._v(" "),a("p",[e._v("If a new specification file needs to be introduced, you must create a new file in "),a("a",{attrs:{href:"https://github.com/meilisearch/specifications/tree/main/text",target:"_blank",rel:"noopener noreferrer"}},[e._v("this folder"),a("OutboundLink")],1),e._v(" following the pattern: "),a("code",[e._v("PR_number-feature-name.md")]),e._v(". e.g. if PR number 12 is about facetting, the newly introduced specification file will be named "),a("code",[e._v("0012-facetting.md")]),e._v(".")]),e._v(" "),a("blockquote",[a("p",[e._v("Note that a pull request not strictly dealing about a specification conception will be tagged as "),a("code",[e._v("Not A Spec")]),e._v(". e.g. A pull-request updating this file will be tagged with the "),a("code",[e._v("Not A Spec")]),e._v(" label.")])]),e._v(" "),a("p",[e._v("The "),a("RouterLink",{attrs:{to:"/specifications/pull_request_template.html"}},[e._v("pull-request template")]),e._v(" must be filled in when the pull-request is created.")],1),e._v(" "),a("h2",{attrs:{id:"review-state"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#review-state"}},[e._v("#")]),e._v(" Review State")]),e._v(" "),a("p",[e._v("It's up to the maintainers of this repository to decide when the PR is ready to be reviewed and which persons should review it.")]),e._v(" "),a("p",[e._v("The PR must be tagged as "),a("code",[e._v("Ready For Review")]),e._v(" to enter this stage.")]),e._v(" "),a("p",[e._v("To be validated, it must be reviewed and approved by peers, ideally:")]),e._v(" "),a("ul",[a("li",[e._v("One person from the Engine team.")]),e._v(" "),a("li",[e._v("One person from the Integration team.")]),e._v(" "),a("li",[e._v("One person from the Documentation team.")])]),e._v(" "),a("h2",{attrs:{id:"merge-state"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#merge-state"}},[e._v("#")]),e._v(" Merge State")]),e._v(" "),a("p",[e._v("To be merged, a specification pull-request should follow the given rules:")]),e._v(" "),a("ul",[a("li",[e._v("It must be approved as described in the "),a("a",{attrs:{href:"#review-state"}},[e._v("Review State")]),e._v(" section.")]),e._v(" "),a("li",[e._v("The PR must point to the right "),a("code",[e._v("release-vX.X.X")]),e._v(" branch.")]),e._v(" "),a("li",[e._v("It must be tagged with:\n"),a("ul",[a("li",[e._v("A "),a("code",[e._v("vX.X.X")]),e._v(" tag indicating in which release the described changes will be introduced.")]),e._v(" "),a("li",[e._v("A "),a("code",[e._v("QX:YYYY")]),e._v(" tag indicating in which quarter and year the described changes will be introduced.")]),e._v(" "),a("li",[e._v("The "),a("code",[e._v("⚠ Breaking")]),e._v(" tag, if breaking changes are introduced.")]),e._v(" "),a("li",[e._v("The "),a("code",[e._v("Telemetry")]),e._v(" tag, if telemetry changes are introduced.")]),e._v(" "),a("li",[e._v("The "),a("code",[e._v("OpenAPI")]),e._v(" tag, if the "),a("a",{attrs:{href:"open-api.yaml"}},[e._v("open-api")]),e._v(" specification will see changes introduced.")])])])]),e._v(" "),a("hr"),e._v(" "),a("h1",{attrs:{id:"release-worfklow"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#release-worfklow"}},[e._v("#")]),e._v(" Release Worfklow")]),e._v(" "),a("p",[e._v("The following steps should happen the day a Meilisearch release is shipped:")]),e._v(" "),a("ul",[a("li",[e._v("Pull-requests describing changes for a release are squashed and merged into the corresponding "),a("code",[e._v("release-vX.X.X")]),e._v(" branch.")]),e._v(" "),a("li",[a("code",[e._v("release-vX.X.X")]),e._v(" is squashed and merged into "),a("code",[e._v("main")]),e._v(".")]),e._v(" "),a("li",[a("code",[e._v("open-api.yml")]),e._v(" version is deployed on bump.sh.")])]),e._v(" "),a("hr"),e._v(" "),a("h2",{attrs:{id:"specification-file-format"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#specification-file-format"}},[e._v("#")]),e._v(" Specification File Format")]),e._v(" "),a("p",[e._v("Meilisearch's feature specifications are made up of five sections, described below.")]),e._v(" "),a("h3",{attrs:{id:"_1-summary"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-summary"}},[e._v("#")]),e._v(" 1. Summary")]),e._v(" "),a("p",[e._v("Summarize the specification with a short paragraph.")]),e._v(" "),a("h3",{attrs:{id:"_2-motivation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-motivation"}},[e._v("#")]),e._v(" 2. Motivation")]),e._v(" "),a("p",[e._v("Explain which use cases are supported.")]),e._v(" "),a("h3",{attrs:{id:"_3-functional-specification"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-functional-specification"}},[e._v("#")]),e._v(" 3. Functional Specification")]),e._v(" "),a("p",[e._v("This section gives a high level overview of the feature. It should avoid technical language so that it can be understood by a general audience (think user-level).")]),e._v(" "),a("ul",[a("li",[e._v("Describe the API resource and endpoints. (Methods, URL, query parameters, body definition, status code).")]),e._v(" "),a("li",[e._v("Explain the feature through examples.")]),e._v(" "),a("li",[e._v("List error cases.")])]),e._v(" "),a("h3",{attrs:{id:"_4-technical-details-optional"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-technical-details-optional"}},[e._v("#")]),e._v(" 4. Technical Details (Optional)")]),e._v(" "),a("p",[e._v('When needed, we recommend describing practical aspects of implementation, e.g. specific algorithmic choices. If none, fill the section body with "n/a".')]),e._v(" "),a("h3",{attrs:{id:"_5-future-possibilities-optional"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-future-possibilities-optional"}},[e._v("#")]),e._v(" 5. Future Possibilities (Optional)")]),e._v(" "),a("p",[e._v('This last section includes any related topics or features which are not currently in Meilisearch and will not be added now, but which may be explored in the future. If none, fill the section body with "n/a".')])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file diff --git a/docs/assets/js/11.07634795.js b/docs/assets/js/11.7b4d52ff.js similarity index 96% rename from docs/assets/js/11.07634795.js rename to docs/assets/js/11.7b4d52ff.js index 40189eca9..35bca0216 100644 --- a/docs/assets/js/11.07634795.js +++ b/docs/assets/js/11.7b4d52ff.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[11],{437:function(e,t,a){"use strict";a.r(t);var s=a(62),i=Object(s.a)({},(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[a("p",[e._v("🤖 "),a("a",{attrs:{href:""}},[e._v("API Diff")]),e._v(" "),a("em",[e._v("Put the link of the GitHub comment generated by bump.sh if generated; Apply the "),a("code",[e._v("OpenApi")]),e._v(" label")])]),e._v(" "),a("hr"),e._v(" "),a("h1",{attrs:{id:"summary"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#summary"}},[e._v("#")]),e._v(" Summary")]),e._v(" "),a("p",[a("em",[e._v("Explain with a few sentences the goal of the specification")])]),e._v(" "),a("hr"),e._v(" "),a("h1",{attrs:{id:"changes"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#changes"}},[e._v("#")]),e._v(" Changes")]),e._v(" "),a("p",[a("em",[e._v("Explain in a clear way the changes bring by the specification; Bullet points FTW;")])]),e._v(" "),a("h1",{attrs:{id:"out-of-scope"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#out-of-scope"}},[e._v("#")]),e._v(" Out Of Scope")]),e._v(" "),a("p",[a("em",[e._v("Explain in clear way subjects that are out of scope and shouldn't be discussed by the reviewers")])]),e._v(" "),a("hr"),e._v(" "),a("h1",{attrs:{id:"attention-to-reviewers"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#attention-to-reviewers"}},[e._v("#")]),e._v(" Attention To Reviewers")]),e._v(" "),a("p",[a("em",[e._v("Explain clearly what reviewers should specifically look for to facilitate the review phase. Also, mention the sections that will not necessarily be taken into account if reviewed.")])]),e._v(" "),a("hr"),e._v(" "),a("h2",{attrs:{id:"misc"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#misc"}},[e._v("#")]),e._v(" Misc")]),e._v(" "),a("ul",[a("li",[e._v("[] Update OpenAPI specification file "),a("em",[e._v("(if needed; Apply the "),a("code",[e._v("OpenApi")]),e._v(" label)")])]),e._v(" "),a("li",[e._v("[] Update telemetry datapoints "),a("em",[e._v("(if needed; Apply the "),a("code",[e._v("Telemetry")]),e._v(" label)")])])])])}),[],!1,null,null,null);t.default=i.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[11],{433:function(e,t,a){"use strict";a.r(t);var s=a(62),i=Object(s.a)({},(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[a("p",[e._v("🤖 "),a("a",{attrs:{href:""}},[e._v("API Diff")]),e._v(" "),a("em",[e._v("Put the link of the GitHub comment generated by bump.sh if generated; Apply the "),a("code",[e._v("OpenApi")]),e._v(" label")])]),e._v(" "),a("hr"),e._v(" "),a("h1",{attrs:{id:"summary"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#summary"}},[e._v("#")]),e._v(" Summary")]),e._v(" "),a("p",[a("em",[e._v("Explain with a few sentences the goal of the specification")])]),e._v(" "),a("hr"),e._v(" "),a("h1",{attrs:{id:"changes"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#changes"}},[e._v("#")]),e._v(" Changes")]),e._v(" "),a("p",[a("em",[e._v("Explain in a clear way the changes bring by the specification; Bullet points FTW;")])]),e._v(" "),a("h1",{attrs:{id:"out-of-scope"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#out-of-scope"}},[e._v("#")]),e._v(" Out Of Scope")]),e._v(" "),a("p",[a("em",[e._v("Explain in clear way subjects that are out of scope and shouldn't be discussed by the reviewers")])]),e._v(" "),a("hr"),e._v(" "),a("h1",{attrs:{id:"attention-to-reviewers"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#attention-to-reviewers"}},[e._v("#")]),e._v(" Attention To Reviewers")]),e._v(" "),a("p",[a("em",[e._v("Explain clearly what reviewers should specifically look for to facilitate the review phase. Also, mention the sections that will not necessarily be taken into account if reviewed.")])]),e._v(" "),a("hr"),e._v(" "),a("h2",{attrs:{id:"misc"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#misc"}},[e._v("#")]),e._v(" Misc")]),e._v(" "),a("ul",[a("li",[e._v("[] Update OpenAPI specification file "),a("em",[e._v("(if needed; Apply the "),a("code",[e._v("OpenApi")]),e._v(" label)")])]),e._v(" "),a("li",[e._v("[] Update telemetry datapoints "),a("em",[e._v("(if needed; Apply the "),a("code",[e._v("Telemetry")]),e._v(" label)")])])])])}),[],!1,null,null,null);t.default=i.exports}}]); \ No newline at end of file diff --git a/docs/assets/js/13.5ee4202d.js b/docs/assets/js/13.167021d3.js similarity index 98% rename from docs/assets/js/13.5ee4202d.js rename to docs/assets/js/13.167021d3.js index 0edf1b5be..35948ded7 100644 --- a/docs/assets/js/13.5ee4202d.js +++ b/docs/assets/js/13.167021d3.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[13],{436:function(e,t,i){"use strict";i.r(t);var a=i(62),r=Object(a.a)({},(function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[i("ul",[i("li",[e._v("Title: Optional Meilisearch Front-end")]),e._v(" "),i("li",[e._v("Start Date: 2020/11/16")]),e._v(" "),i("li",[e._v("specification PR: #8")]),e._v(" "),i("li",[e._v("Meilisearch Issue: #411")])]),e._v(" "),i("h1",{attrs:{id:"optional-meilisearch-front-end"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#optional-meilisearch-front-end"}},[e._v("#")]),e._v(" Optional Meilisearch Front-end")]),e._v(" "),i("h2",{attrs:{id:"first-section-feature-description-and-interaction"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#first-section-feature-description-and-interaction"}},[e._v("#")]),e._v(" First section: Feature Description and Interaction")]),e._v(" "),i("h3",{attrs:{id:"summary"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#summary"}},[e._v("#")]),e._v(" Summary")]),e._v(" "),i("p",[e._v("For testing purposes, MeiliSearch is shipped with a frontend that is served at the server's root. This provides the user with a basic GUI to perform searches on his documents. While this is useful in a development environment, this is not necessarily desirable in a production environment. This specification proposes to remove this frontend in a production environment.")]),e._v(" "),i("h3",{attrs:{id:"motivation"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#motivation"}},[e._v("#")]),e._v(" Motivation")]),e._v(" "),i("p",[e._v("This frontend was developed for testing purposes, therefore it should only be present in a development environment.")]),e._v(" "),i("h3",{attrs:{id:"prior-art-and-r-d"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#prior-art-and-r-d"}},[e._v("#")]),e._v(" Prior Art and R&D")]),e._v(" "),i("p",[e._v("N.A")]),e._v(" "),i("h3",{attrs:{id:"explanation"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#explanation"}},[e._v("#")]),e._v(" Explanation")]),e._v(" "),i("p",[e._v("When the option "),i("code",[e._v("--env")]),e._v(" or "),i("code",[e._v("MEILI_ENV")]),e._v(" is set to "),i("code",[e._v("production")]),e._v(", the frontend is disabled.")]),e._v(" "),i("h3",{attrs:{id:"impact-on-documentation"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#impact-on-documentation"}},[e._v("#")]),e._v(" Impact on documentation")]),e._v(" "),i("p",[e._v("Documentation needs to be updated in:")]),e._v(" "),i("ul",[i("li",[e._v("The "),i("a",{attrs:{href:"https://docs.meilisearch.com/guides/advanced_guides/configuration.html#environment",target:"_blank",rel:"noopener noreferrer"}},[e._v("environment documentation"),i("OutboundLink")],1)]),e._v(" "),i("li",[e._v("The "),i("a",{attrs:{href:"https://docs.meilisearch.com/guides/advanced_guides/web_interface.html#web-interface",target:"_blank",rel:"noopener noreferrer"}},[e._v("web interface documentation"),i("OutboundLink")],1)])]),e._v(" "),i("h2",{attrs:{id:"second-section-technical-specifications"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#second-section-technical-specifications"}},[e._v("#")]),e._v(" Second Section: Technical Specifications")]),e._v(" "),i("h3",{attrs:{id:"architecture"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#architecture"}},[e._v("#")]),e._v(" Architecture")]),e._v(" "),i("p",[e._v("N.A")]),e._v(" "),i("h3",{attrs:{id:"implementation-details"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#implementation-details"}},[e._v("#")]),e._v(" Implementation Details")]),e._v(" "),i("p",[e._v("Pass an argument to "),i("code",[e._v("create_app")]),e._v(" to conditionally enable the frontend service.")]),e._v(" "),i("h3",{attrs:{id:"corner-cases"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#corner-cases"}},[e._v("#")]),e._v(" Corner Cases")]),e._v(" "),i("p",[e._v("TDB")]),e._v(" "),i("h2",{attrs:{id:"third-section-future-possibilities"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#third-section-future-possibilities"}},[e._v("#")]),e._v(" Third Section: Future possibilities")]),e._v(" "),i("ul",[i("li",[e._v("Add an opt-in flag to re-enable the frontend in production environment, as suggested per "),i("a",{attrs:{href:"https://github.com/meilisearch/specifications/pull/8#issuecomment-729676988",target:"_blank",rel:"noopener noreferrer"}},[e._v("comment"),i("OutboundLink")],1)])])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[13],{437:function(e,t,i){"use strict";i.r(t);var a=i(62),r=Object(a.a)({},(function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[i("ul",[i("li",[e._v("Title: Optional Meilisearch Front-end")]),e._v(" "),i("li",[e._v("Start Date: 2020/11/16")]),e._v(" "),i("li",[e._v("specification PR: #8")]),e._v(" "),i("li",[e._v("Meilisearch Issue: #411")])]),e._v(" "),i("h1",{attrs:{id:"optional-meilisearch-front-end"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#optional-meilisearch-front-end"}},[e._v("#")]),e._v(" Optional Meilisearch Front-end")]),e._v(" "),i("h2",{attrs:{id:"first-section-feature-description-and-interaction"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#first-section-feature-description-and-interaction"}},[e._v("#")]),e._v(" First section: Feature Description and Interaction")]),e._v(" "),i("h3",{attrs:{id:"summary"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#summary"}},[e._v("#")]),e._v(" Summary")]),e._v(" "),i("p",[e._v("For testing purposes, MeiliSearch is shipped with a frontend that is served at the server's root. This provides the user with a basic GUI to perform searches on his documents. While this is useful in a development environment, this is not necessarily desirable in a production environment. This specification proposes to remove this frontend in a production environment.")]),e._v(" "),i("h3",{attrs:{id:"motivation"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#motivation"}},[e._v("#")]),e._v(" Motivation")]),e._v(" "),i("p",[e._v("This frontend was developed for testing purposes, therefore it should only be present in a development environment.")]),e._v(" "),i("h3",{attrs:{id:"prior-art-and-r-d"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#prior-art-and-r-d"}},[e._v("#")]),e._v(" Prior Art and R&D")]),e._v(" "),i("p",[e._v("N.A")]),e._v(" "),i("h3",{attrs:{id:"explanation"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#explanation"}},[e._v("#")]),e._v(" Explanation")]),e._v(" "),i("p",[e._v("When the option "),i("code",[e._v("--env")]),e._v(" or "),i("code",[e._v("MEILI_ENV")]),e._v(" is set to "),i("code",[e._v("production")]),e._v(", the frontend is disabled.")]),e._v(" "),i("h3",{attrs:{id:"impact-on-documentation"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#impact-on-documentation"}},[e._v("#")]),e._v(" Impact on documentation")]),e._v(" "),i("p",[e._v("Documentation needs to be updated in:")]),e._v(" "),i("ul",[i("li",[e._v("The "),i("a",{attrs:{href:"https://docs.meilisearch.com/guides/advanced_guides/configuration.html#environment",target:"_blank",rel:"noopener noreferrer"}},[e._v("environment documentation"),i("OutboundLink")],1)]),e._v(" "),i("li",[e._v("The "),i("a",{attrs:{href:"https://docs.meilisearch.com/guides/advanced_guides/web_interface.html#web-interface",target:"_blank",rel:"noopener noreferrer"}},[e._v("web interface documentation"),i("OutboundLink")],1)])]),e._v(" "),i("h2",{attrs:{id:"second-section-technical-specifications"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#second-section-technical-specifications"}},[e._v("#")]),e._v(" Second Section: Technical Specifications")]),e._v(" "),i("h3",{attrs:{id:"architecture"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#architecture"}},[e._v("#")]),e._v(" Architecture")]),e._v(" "),i("p",[e._v("N.A")]),e._v(" "),i("h3",{attrs:{id:"implementation-details"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#implementation-details"}},[e._v("#")]),e._v(" Implementation Details")]),e._v(" "),i("p",[e._v("Pass an argument to "),i("code",[e._v("create_app")]),e._v(" to conditionally enable the frontend service.")]),e._v(" "),i("h3",{attrs:{id:"corner-cases"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#corner-cases"}},[e._v("#")]),e._v(" Corner Cases")]),e._v(" "),i("p",[e._v("TDB")]),e._v(" "),i("h2",{attrs:{id:"third-section-future-possibilities"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#third-section-future-possibilities"}},[e._v("#")]),e._v(" Third Section: Future possibilities")]),e._v(" "),i("ul",[i("li",[e._v("Add an opt-in flag to re-enable the frontend in production environment, as suggested per "),i("a",{attrs:{href:"https://github.com/meilisearch/specifications/pull/8#issuecomment-729676988",target:"_blank",rel:"noopener noreferrer"}},[e._v("comment"),i("OutboundLink")],1)])])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file diff --git a/docs/assets/js/14.9305fa09.js b/docs/assets/js/14.acdd32fb.js similarity index 99% rename from docs/assets/js/14.9305fa09.js rename to docs/assets/js/14.acdd32fb.js index 98e1ae9ca..fb42d35f9 100644 --- a/docs/assets/js/14.9305fa09.js +++ b/docs/assets/js/14.acdd32fb.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[14],{438:function(t,s,a){"use strict";a.r(s);var n=a(62),e=Object(n.a)({},(function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("ul",[a("li",[t._v("Title: Script Based Tokenizer")]),t._v(" "),a("li",[t._v("Start Date: 2020-10-27")]),t._v(" "),a("li",[t._v("specification PR: meilisearch/specifications#2")]),t._v(" "),a("li",[t._v("Meilisearch Issue: meilisearch/Meilsearch#624")])]),t._v(" "),a("h2",{attrs:{id:"feature-description-and-interaction"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#feature-description-and-interaction"}},[t._v("#")]),t._v(" Feature Description and Interaction")]),t._v(" "),a("h3",{attrs:{id:"summary"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#summary"}},[t._v("#")]),t._v(" Summary")]),t._v(" "),a("p",[t._v("The first step of document indexing in the Meilisearch engine is tokenization. Tokenization is the action of taking a sentence and splitting it in units of language called tokens. The tokenization task is highly language dependant and is a critical factor in the quality of the search results.")]),t._v(" "),a("h3",{attrs:{id:"motivation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#motivation"}},[t._v("#")]),t._v(" Motivation")]),t._v(" "),a("p",[t._v("We want to provide our users with an always improved searching experience. For that matter, it is critical for us to improve the performance of our tokenizer, and to provide better support for multilingual tokenization.")]),t._v(" "),a("h3",{attrs:{id:"prior-art-and-r-d"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#prior-art-and-r-d"}},[t._v("#")]),t._v(" Prior Art and R&D")]),t._v(" "),a("p",[a("strong",[t._v("tokenization:")])]),t._v(" "),a("ul",[a("li",[a("blockquote",[a("p",[a("strong",[a("a",{attrs:{href:"https://github.com/unicode-rs/unicode-segmentation",target:"_blank",rel:"noopener noreferrer"}},[t._v("unicode-segmentation"),a("OutboundLink")],1),t._v(":")]),t._v("\ntokenizer which follow the "),a("a",{attrs:{href:"http://www.unicode.org/reports/tr29/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Standard Annex #29: Unicode Text Segmentation"),a("OutboundLink")],1),t._v(",\nthis tokenizer seems promising for Latin scripts.")])])]),t._v(" "),a("li",[a("blockquote",[a("p",[a("strong",[a("a",{attrs:{href:"https://github.com/messense/jieba-rs",target:"_blank",rel:"noopener noreferrer"}},[t._v("Jieba"),a("OutboundLink")],1),t._v(":")]),t._v("\ntokenizer specialized in Chinese languages")])])]),t._v(" "),a("li",[a("blockquote",[a("p",[a("strong",[a("a",{attrs:{href:"https://github.com/lindera-morphology/lindera",target:"_blank",rel:"noopener noreferrer"}},[t._v("Lindera"),a("OutboundLink")],1),t._v(":")]),t._v("\nJapanese and Korean")])])])]),t._v(" "),a("p",[a("strong",[t._v("lang/script detection:")])]),t._v(" "),a("ul",[a("li",[a("blockquote",[a("p",[a("strong",[a("a",{attrs:{href:"https://github.com/greyblake/whatlang-rs",target:"_blank",rel:"noopener noreferrer"}},[t._v("whatlang"),a("OutboundLink")],1),t._v(":")]),t._v("\nwhatlang is able to detect script or/and language in a text,\nlanguage detection is low but the script is acceptable.\nnote: Sonic also uses whatlang to perform the tokenization, it could be interesting to check out how they do it.")])])]),t._v(" "),a("li",[a("blockquote",[a("p",[a("strong",[t._v("toku (@qdequele):")]),t._v("\nin a R&D project, @qdequele was able to detect language based on stop word distribution in a text.\nIf, in a latin script, there is lot of French stop words then the text language is probably french.")])])])]),t._v(" "),a("p",[a("strong",[t._v("other solution that advertise multilingual support:")])]),t._v(" "),a("ul",[a("li",[t._v("Sonic uses whatlang to perform the tokenization, it could be interesting to checkout how they do it: https://github.com/valeriansaliou/sonic/tree/master/src/lexer\n"),a("ul",[a("li",[t._v("Sonic uses whatlang to detect the languages but doesn't actually seem to use it to segment the text. It simply uses unicode segmentation, I can't really explain what they actually do with the language information.")])])]),t._v(" "),a("li",[t._v("tantivy advertise good multilingual support: https://github.com/tantivy-search/tantivy/tree/main/src/tokenizer\n"),a("ul",[a("li",[t._v("Tantivy is similar to elastic in the sense that you can set up a custom text analyzer. The difference is that it is only made of "),a("code",[t._v("tokenizer")]),t._v(" -> "),a("code",[t._v("token_filter")]),t._v(". Tantivy also provides a collection of tokenizer to choose from. Tokens are rather simple and do not contain any metadata, except for their position.")])])]),t._v(" "),a("li",[t._v("How elastic search handle it: https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-tokenizers.html:\n"),a("ul",[a("li",[t._v("Elastic proposed to create custom text analyzer. A text analyzer is a pipelined text processor with the following components: "),a("code",[t._v("char_filter")]),t._v(" -> "),a("code",[t._v("tokenizer")]),t._v(" -> "),a("code",[t._v("token_filter")]),t._v(". There are multiple different tokenizers that can be chosen, depending on the use-case. This is a bit complicated, but I also think that advanced users should be able to choose the tokenizer they want. (default behavior is us guessing what's the best tokenizer to use.)")])])]),t._v(" "),a("li",[t._v("Algolia:\n"),a("ul",[a("li",[t._v("Algolia uses multiple techniques to handle tokenization. They start by "),a("a",{attrs:{href:"https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/normalization/",target:"_blank",rel:"noopener noreferrer"}},[t._v("normalizing"),a("OutboundLink")],1),t._v(" the text (lowercase, unidecode, transform traditional Chinese to modern, etc). Then, they tokenize the normalized data. It seems that the tokenization is based on two techniques. The first one is by "),a("a",{attrs:{href:"https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/tokenization/",target:"_blank",rel:"noopener noreferrer"}},[t._v("defining separators"),a("OutboundLink")],1),t._v(" (space, comma, carriage return, etc) and the other one is with "),a("a",{attrs:{href:"https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/#using-dictionaries",target:"_blank",rel:"noopener noreferrer"}},[t._v("dictionaries"),a("OutboundLink")],1),t._v(". The language is not automatically detected, "),a("a",{attrs:{href:"https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/#no-automatic-language-detection",target:"_blank",rel:"noopener noreferrer"}},[t._v("it must be set by the user"),a("OutboundLink")],1),t._v(". They also have dictionaries for plurals.")])])])]),t._v(" "),a("h3",{attrs:{id:"explanation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#explanation"}},[t._v("#")]),t._v(" Explanation")]),t._v(" "),a("p",[t._v("In order to use the tokenizer, all the user has to do is to instantiate a "),a("code",[t._v("Tokenizer")]),t._v(", call "),a("code",[t._v("tokenize(&str)")]),t._v(" on it and iterate over the emitted tokens:")]),t._v(" "),a("div",{staticClass:"language-rust extra-class"},[a("pre",{pre:!0,attrs:{class:"language-rust"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("fst"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Set")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("charabia"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TokenizerBuilder")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// text to tokenize.")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" orig "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"The quick (\\"brown\\") fox can\'t jump 32.3 feet, right? Brr, it\'s 29.3°F!"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// create the builder.")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" builder "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TokenizerBuilder")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// create a set of stop words.")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" stop_words "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Set")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_iter")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"the"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("iter")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// configurate stop words.")]),t._v("\n builder"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("stop_words")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("stop_words"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// build the tokenizer passing the text to tokenize.")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" tokenizer "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" builder"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("build")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// tokenize original string")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" tokens "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" tokenizer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("tokenize")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("orig"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Token")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" lemma"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" kind"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" tokens"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("next")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("assert_eq!")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("lemma"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"the"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("assert_eq!")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("kind"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TokenKind")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Word")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Token")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" lemma"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" kind"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" tokens"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("next")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("assert_eq!")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("lemma"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('" "')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("assert_eq!")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("kind"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TokenKind")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Separator")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SeparatorKind")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Soft")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Token")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" lemma"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" kind"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" tokens"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("next")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("assert_eq!")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("lemma"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"quick"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("assert_eq!")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("kind"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TokenKind")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Word")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("p",[t._v("The call to the tokenize method allows the reuse of the same "),a("code",[t._v("Tokenizer")]),t._v(" instance, and keep its configuration state and allocations.")]),t._v(" "),a("p",[t._v("Below are examples of the integration of the new tokenizer in existing code:")]),t._v(" "),a("ul",[a("li",[t._v("Highlight in @kerollmops milli:")])]),t._v(" "),a("div",{staticClass:"language-rust extra-class"},[a("pre",{pre:!0,attrs:{class:"language-rust"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// new tokenizer")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("highlight_record")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("record"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("IndexMap")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" words"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("HashSet")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// create the builder.")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" builder "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TokenizerBuilder")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// create a set of stop words.")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" stop_words "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Set")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_iter")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"the"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("iter")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// configurate stop words.")]),t._v("\n builder"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("stop_words")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("stop_words"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// build the tokenizer passing the text to tokenize.")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" tokenizer "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" builder"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("build")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("_key"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("in")]),t._v(" record"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("iter_mut")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" old_value "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("mem"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("take")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// reuse tokenizer at each iteration")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" tokens "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" tokenizer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("reconstruct")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("old_value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("original"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" token"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("in")]),t._v(" tokens "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" token"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("is_word")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" to_highlight "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" words"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("contains")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("token"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("text")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" to_highlight "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("push_str")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("push_str")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("original"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" to_highlight "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("push_str")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("push_str")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("original"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("div",{staticClass:"language-rust extra-class"},[a("pre",{pre:!0,attrs:{class:"language-rust"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// original")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("highlight_record")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("record"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("IndexMap")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" words"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("HashSet")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("_key"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("in")]),t._v(" record"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("iter_mut")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" old_value "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("mem"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("take")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("token_type"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" token"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("in")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("simple_tokenizer")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("old_value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" token_type "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TokenType")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Word")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" lowercase_token "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" token"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_lowercase")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" to_highlight "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" words"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("contains")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("lowercase_token"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" to_highlight "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("push_str")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("push_str")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("token"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" to_highlight "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("push_str")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("push_str")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("token"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("As we can see, the changes that need to be made are very minimal: this is because efforts have been made to make its API close to the previous one.")]),t._v(" "),a("h3",{attrs:{id:"impact-on-documentation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#impact-on-documentation"}},[t._v("#")]),t._v(" Impact on documentation")]),t._v(" "),a("p",[t._v("This feature should not impact meilisearch users' documentation.\nIn future versions, we will probably provide a way to configure tokenizer and this will be discussed in a new specification.")]),t._v(" "),a("h2",{attrs:{id:"technical-specifications"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#technical-specifications"}},[t._v("#")]),t._v(" Technical Specifications")]),t._v(" "),a("h3",{attrs:{id:"architecture"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#architecture"}},[t._v("#")]),t._v(" Architecture")]),t._v(" "),a("p",[t._v("The new version of the tokenizer will replace the current version as a "),a("a",{attrs:{href:"https://crates.io/crates/charabia",target:"_blank",rel:"noopener noreferrer"}},[t._v("standalone library named charabia"),a("OutboundLink")],1),t._v(".")]),t._v(" "),a("h3",{attrs:{id:"implementation-details"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#implementation-details"}},[t._v("#")]),t._v(" Implementation Details")]),t._v(" "),a("p",[t._v("We want to support different tokenizers based on the language of the text that needs to be indexed. For this, we may need to change the tokenizer we are using while indexing, depending on the language and the script, detected by "),a("code",[t._v("whatlang")]),t._v(". The Tokenizer provides an interface that abstracts this need away from the consumer of the tokens.")]),t._v(" "),a("p",[t._v("See "),a("a",{attrs:{href:"https://docs.rs/charabia",target:"_blank",rel:"noopener noreferrer"}},[t._v("the official documentation"),a("OutboundLink")],1),t._v(" to know more about the API of the library.")]),t._v(" "),a("p",[t._v("See the repository "),a("a",{attrs:{href:"https://github.com/meilisearch/charabia/blob/main/CONTRIBUTING.md",target:"_blank",rel:"noopener noreferrer"}},[t._v("Contributing.md"),a("OutboundLink")],1),t._v(" to know more about contribution that can be made by the community.")]),t._v(" "),a("h2",{attrs:{id:"future-possibilities"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#future-possibilities"}},[t._v("#")]),t._v(" Future possibilities")]),t._v(" "),a("ul",[a("li",[t._v("We should add a way to configure the tokenizer to enforce a specific language/script")]),t._v(" "),a("li",[t._v("We should add a way to configure tokenizer whitelisting/blacklisting separators")]),t._v(" "),a("li",[t._v("The tokenizer specified here is based on scripts, we should base it on languages to be able to have default stop-words for each language")]),t._v(" "),a("li",[t._v("We will want in the future to allow user configuration for the tokenizer. This is taken into account in the design of the new Tokenizer.")])])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[14],{439:function(t,s,a){"use strict";a.r(s);var n=a(62),e=Object(n.a)({},(function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("ul",[a("li",[t._v("Title: Script Based Tokenizer")]),t._v(" "),a("li",[t._v("Start Date: 2020-10-27")]),t._v(" "),a("li",[t._v("specification PR: meilisearch/specifications#2")]),t._v(" "),a("li",[t._v("Meilisearch Issue: meilisearch/Meilsearch#624")])]),t._v(" "),a("h2",{attrs:{id:"feature-description-and-interaction"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#feature-description-and-interaction"}},[t._v("#")]),t._v(" Feature Description and Interaction")]),t._v(" "),a("h3",{attrs:{id:"summary"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#summary"}},[t._v("#")]),t._v(" Summary")]),t._v(" "),a("p",[t._v("The first step of document indexing in the Meilisearch engine is tokenization. Tokenization is the action of taking a sentence and splitting it in units of language called tokens. The tokenization task is highly language dependant and is a critical factor in the quality of the search results.")]),t._v(" "),a("h3",{attrs:{id:"motivation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#motivation"}},[t._v("#")]),t._v(" Motivation")]),t._v(" "),a("p",[t._v("We want to provide our users with an always improved searching experience. For that matter, it is critical for us to improve the performance of our tokenizer, and to provide better support for multilingual tokenization.")]),t._v(" "),a("h3",{attrs:{id:"prior-art-and-r-d"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#prior-art-and-r-d"}},[t._v("#")]),t._v(" Prior Art and R&D")]),t._v(" "),a("p",[a("strong",[t._v("tokenization:")])]),t._v(" "),a("ul",[a("li",[a("blockquote",[a("p",[a("strong",[a("a",{attrs:{href:"https://github.com/unicode-rs/unicode-segmentation",target:"_blank",rel:"noopener noreferrer"}},[t._v("unicode-segmentation"),a("OutboundLink")],1),t._v(":")]),t._v("\ntokenizer which follow the "),a("a",{attrs:{href:"http://www.unicode.org/reports/tr29/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Standard Annex #29: Unicode Text Segmentation"),a("OutboundLink")],1),t._v(",\nthis tokenizer seems promising for Latin scripts.")])])]),t._v(" "),a("li",[a("blockquote",[a("p",[a("strong",[a("a",{attrs:{href:"https://github.com/messense/jieba-rs",target:"_blank",rel:"noopener noreferrer"}},[t._v("Jieba"),a("OutboundLink")],1),t._v(":")]),t._v("\ntokenizer specialized in Chinese languages")])])]),t._v(" "),a("li",[a("blockquote",[a("p",[a("strong",[a("a",{attrs:{href:"https://github.com/lindera-morphology/lindera",target:"_blank",rel:"noopener noreferrer"}},[t._v("Lindera"),a("OutboundLink")],1),t._v(":")]),t._v("\nJapanese and Korean")])])])]),t._v(" "),a("p",[a("strong",[t._v("lang/script detection:")])]),t._v(" "),a("ul",[a("li",[a("blockquote",[a("p",[a("strong",[a("a",{attrs:{href:"https://github.com/greyblake/whatlang-rs",target:"_blank",rel:"noopener noreferrer"}},[t._v("whatlang"),a("OutboundLink")],1),t._v(":")]),t._v("\nwhatlang is able to detect script or/and language in a text,\nlanguage detection is low but the script is acceptable.\nnote: Sonic also uses whatlang to perform the tokenization, it could be interesting to check out how they do it.")])])]),t._v(" "),a("li",[a("blockquote",[a("p",[a("strong",[t._v("toku (@qdequele):")]),t._v("\nin a R&D project, @qdequele was able to detect language based on stop word distribution in a text.\nIf, in a latin script, there is lot of French stop words then the text language is probably french.")])])])]),t._v(" "),a("p",[a("strong",[t._v("other solution that advertise multilingual support:")])]),t._v(" "),a("ul",[a("li",[t._v("Sonic uses whatlang to perform the tokenization, it could be interesting to checkout how they do it: https://github.com/valeriansaliou/sonic/tree/master/src/lexer\n"),a("ul",[a("li",[t._v("Sonic uses whatlang to detect the languages but doesn't actually seem to use it to segment the text. It simply uses unicode segmentation, I can't really explain what they actually do with the language information.")])])]),t._v(" "),a("li",[t._v("tantivy advertise good multilingual support: https://github.com/tantivy-search/tantivy/tree/main/src/tokenizer\n"),a("ul",[a("li",[t._v("Tantivy is similar to elastic in the sense that you can set up a custom text analyzer. The difference is that it is only made of "),a("code",[t._v("tokenizer")]),t._v(" -> "),a("code",[t._v("token_filter")]),t._v(". Tantivy also provides a collection of tokenizer to choose from. Tokens are rather simple and do not contain any metadata, except for their position.")])])]),t._v(" "),a("li",[t._v("How elastic search handle it: https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-tokenizers.html:\n"),a("ul",[a("li",[t._v("Elastic proposed to create custom text analyzer. A text analyzer is a pipelined text processor with the following components: "),a("code",[t._v("char_filter")]),t._v(" -> "),a("code",[t._v("tokenizer")]),t._v(" -> "),a("code",[t._v("token_filter")]),t._v(". There are multiple different tokenizers that can be chosen, depending on the use-case. This is a bit complicated, but I also think that advanced users should be able to choose the tokenizer they want. (default behavior is us guessing what's the best tokenizer to use.)")])])]),t._v(" "),a("li",[t._v("Algolia:\n"),a("ul",[a("li",[t._v("Algolia uses multiple techniques to handle tokenization. They start by "),a("a",{attrs:{href:"https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/normalization/",target:"_blank",rel:"noopener noreferrer"}},[t._v("normalizing"),a("OutboundLink")],1),t._v(" the text (lowercase, unidecode, transform traditional Chinese to modern, etc). Then, they tokenize the normalized data. It seems that the tokenization is based on two techniques. The first one is by "),a("a",{attrs:{href:"https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/in-depth/tokenization/",target:"_blank",rel:"noopener noreferrer"}},[t._v("defining separators"),a("OutboundLink")],1),t._v(" (space, comma, carriage return, etc) and the other one is with "),a("a",{attrs:{href:"https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/#using-dictionaries",target:"_blank",rel:"noopener noreferrer"}},[t._v("dictionaries"),a("OutboundLink")],1),t._v(". The language is not automatically detected, "),a("a",{attrs:{href:"https://www.algolia.com/doc/guides/managing-results/optimize-search-results/handling-natural-languages-nlp/#no-automatic-language-detection",target:"_blank",rel:"noopener noreferrer"}},[t._v("it must be set by the user"),a("OutboundLink")],1),t._v(". They also have dictionaries for plurals.")])])])]),t._v(" "),a("h3",{attrs:{id:"explanation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#explanation"}},[t._v("#")]),t._v(" Explanation")]),t._v(" "),a("p",[t._v("In order to use the tokenizer, all the user has to do is to instantiate a "),a("code",[t._v("Tokenizer")]),t._v(", call "),a("code",[t._v("tokenize(&str)")]),t._v(" on it and iterate over the emitted tokens:")]),t._v(" "),a("div",{staticClass:"language-rust extra-class"},[a("pre",{pre:!0,attrs:{class:"language-rust"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("fst"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Set")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("use")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("charabia"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TokenizerBuilder")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// text to tokenize.")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" orig "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"The quick (\\"brown\\") fox can\'t jump 32.3 feet, right? Brr, it\'s 29.3°F!"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// create the builder.")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" builder "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TokenizerBuilder")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// create a set of stop words.")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" stop_words "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Set")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_iter")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"the"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("iter")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// configurate stop words.")]),t._v("\n builder"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("stop_words")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("stop_words"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// build the tokenizer passing the text to tokenize.")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" tokenizer "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" builder"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("build")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// tokenize original string")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" tokens "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" tokenizer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("tokenize")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("orig"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Token")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" lemma"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" kind"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" tokens"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("next")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("assert_eq!")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("lemma"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"the"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("assert_eq!")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("kind"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TokenKind")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Word")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Token")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" lemma"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" kind"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" tokens"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("next")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("assert_eq!")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("lemma"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('" "')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("assert_eq!")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("kind"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TokenKind")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Separator")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("SeparatorKind")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Soft")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Token")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" lemma"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" kind"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" tokens"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("next")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("assert_eq!")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("lemma"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"quick"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token macro property"}},[t._v("assert_eq!")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("kind"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TokenKind")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Word")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("p",[t._v("The call to the tokenize method allows the reuse of the same "),a("code",[t._v("Tokenizer")]),t._v(" instance, and keep its configuration state and allocations.")]),t._v(" "),a("p",[t._v("Below are examples of the integration of the new tokenizer in existing code:")]),t._v(" "),a("ul",[a("li",[t._v("Highlight in @kerollmops milli:")])]),t._v(" "),a("div",{staticClass:"language-rust extra-class"},[a("pre",{pre:!0,attrs:{class:"language-rust"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// new tokenizer")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("highlight_record")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("record"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("IndexMap")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" words"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("HashSet")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// create the builder.")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" builder "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TokenizerBuilder")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("new")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// create a set of stop words.")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" stop_words "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Set")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("from_iter")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"the"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("iter")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("unwrap")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// configurate stop words.")]),t._v("\n builder"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("stop_words")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("stop_words"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// build the tokenizer passing the text to tokenize.")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" tokenizer "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" builder"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("build")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("_key"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("in")]),t._v(" record"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("iter_mut")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" old_value "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("mem"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("take")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// reuse tokenizer at each iteration")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" tokens "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" tokenizer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("reconstruct")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("old_value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n \n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("original"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" token"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("in")]),t._v(" tokens "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" token"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("is_word")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" to_highlight "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" words"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("contains")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("token"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("text")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" to_highlight "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("push_str")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("push_str")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("original"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" to_highlight "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("push_str")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("push_str")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("original"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("div",{staticClass:"language-rust extra-class"},[a("pre",{pre:!0,attrs:{class:"language-rust"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// original")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("fn")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function-definition function"}},[t._v("highlight_record")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("record"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("mut")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("IndexMap")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" words"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("HashSet")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("String")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("_key"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("in")]),t._v(" record"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("iter_mut")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" old_value "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token namespace"}},[t._v("mem"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")])]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("take")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("for")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("token_type"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" token"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("in")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("simple_tokenizer")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("old_value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" token_type "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("==")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("TokenType")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("::")]),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Word")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" lowercase_token "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" token"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("to_lowercase")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("let")]),t._v(" to_highlight "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" words"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("contains")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("&")]),t._v("lowercase_token"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" to_highlight "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("push_str")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("push_str")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("token"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" to_highlight "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("push_str")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n value"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("push_str")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("token"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("As we can see, the changes that need to be made are very minimal: this is because efforts have been made to make its API close to the previous one.")]),t._v(" "),a("h3",{attrs:{id:"impact-on-documentation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#impact-on-documentation"}},[t._v("#")]),t._v(" Impact on documentation")]),t._v(" "),a("p",[t._v("This feature should not impact meilisearch users' documentation.\nIn future versions, we will probably provide a way to configure tokenizer and this will be discussed in a new specification.")]),t._v(" "),a("h2",{attrs:{id:"technical-specifications"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#technical-specifications"}},[t._v("#")]),t._v(" Technical Specifications")]),t._v(" "),a("h3",{attrs:{id:"architecture"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#architecture"}},[t._v("#")]),t._v(" Architecture")]),t._v(" "),a("p",[t._v("The new version of the tokenizer will replace the current version as a "),a("a",{attrs:{href:"https://crates.io/crates/charabia",target:"_blank",rel:"noopener noreferrer"}},[t._v("standalone library named charabia"),a("OutboundLink")],1),t._v(".")]),t._v(" "),a("h3",{attrs:{id:"implementation-details"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#implementation-details"}},[t._v("#")]),t._v(" Implementation Details")]),t._v(" "),a("p",[t._v("We want to support different tokenizers based on the language of the text that needs to be indexed. For this, we may need to change the tokenizer we are using while indexing, depending on the language and the script, detected by "),a("code",[t._v("whatlang")]),t._v(". The Tokenizer provides an interface that abstracts this need away from the consumer of the tokens.")]),t._v(" "),a("p",[t._v("See "),a("a",{attrs:{href:"https://docs.rs/charabia",target:"_blank",rel:"noopener noreferrer"}},[t._v("the official documentation"),a("OutboundLink")],1),t._v(" to know more about the API of the library.")]),t._v(" "),a("p",[t._v("See the repository "),a("a",{attrs:{href:"https://github.com/meilisearch/charabia/blob/main/CONTRIBUTING.md",target:"_blank",rel:"noopener noreferrer"}},[t._v("Contributing.md"),a("OutboundLink")],1),t._v(" to know more about contribution that can be made by the community.")]),t._v(" "),a("h2",{attrs:{id:"future-possibilities"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#future-possibilities"}},[t._v("#")]),t._v(" Future possibilities")]),t._v(" "),a("ul",[a("li",[t._v("We should add a way to configure the tokenizer to enforce a specific language/script")]),t._v(" "),a("li",[t._v("We should add a way to configure tokenizer whitelisting/blacklisting separators")]),t._v(" "),a("li",[t._v("The tokenizer specified here is based on scripts, we should base it on languages to be able to have default stop-words for each language")]),t._v(" "),a("li",[t._v("We will want in the future to allow user configuration for the tokenizer. This is taken into account in the design of the new Tokenizer.")])])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file diff --git a/docs/assets/js/15.095125b3.js b/docs/assets/js/15.3f1414b9.js similarity index 99% rename from docs/assets/js/15.095125b3.js rename to docs/assets/js/15.3f1414b9.js index 6deb3d61a..4716ba4e4 100644 --- a/docs/assets/js/15.095125b3.js +++ b/docs/assets/js/15.3f1414b9.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[15],{439:function(e,t,a){"use strict";a.r(t);var s=a(62),r=Object(s.a)({},(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[a("ul",[a("li",[e._v("Title: Indexing CSV")]),e._v(" "),a("li",[e._v("Start Date: 2021-04-9")]),e._v(" "),a("li",[e._v("Specification PR: "),a("a",{attrs:{href:"https://github.com/Meilisearch/specifications/pull/28",target:"_blank",rel:"noopener noreferrer"}},[e._v("PR-#28"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Discovery Issue: n/a")])]),e._v(" "),a("h1",{attrs:{id:"indexing-csv"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#indexing-csv"}},[e._v("#")]),e._v(" Indexing CSV")]),e._v(" "),a("h2",{attrs:{id:"_1-functional-specification"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-functional-specification"}},[e._v("#")]),e._v(" 1. Functional Specification")]),e._v(" "),a("h3",{attrs:{id:"i-summary"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#i-summary"}},[e._v("#")]),e._v(" I. Summary")]),e._v(" "),a("p",[e._v("To index documents, the body of the add documents request has to match a specific format. That specific format is then parsed and tokenized inside Meilisearch. After which, the documents added are in the pool of searchable and returnable documents.")]),e._v(" "),a("p",[e._v("A "),a("a",{attrs:{href:"https://en.wikipedia.org/wiki/Comma-separated_values",target:"_blank",rel:"noopener noreferrer"}},[e._v("CSV"),a("OutboundLink")],1),e._v(" data format is broadly used to store and exchange data in a simple format.")]),e._v(" "),a("p",[e._v("Also, in order to boost write performance CSV data format is more suited than JSON for consequent datasets, as keys are not duplicated for every document.")]),e._v(" "),a("h4",{attrs:{id:"summary-key-points"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#summary-key-points"}},[e._v("#")]),e._v(" Summary Key Points")]),e._v(" "),a("ul",[a("li",[e._v("The header of the csv payload allows to name the attributes and type them.")]),e._v(" "),a("li",[a("code",[e._v("text/csv")]),e._v(" Content-Type header is now supported.")]),e._v(" "),a("li",[e._v("A new query parameter, "),a("code",[e._v("csvDelimiter")]),e._v(", has been introduced to customize the csv delimiter used in the document. It can change between two "),a("code",[e._v("documentAddition")]),e._v(".")]),e._v(" "),a("li",[e._v("The error cases have been strengthened and completed. See Errors part.")])]),e._v(" "),a("h3",{attrs:{id:"ii-motivation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#ii-motivation"}},[e._v("#")]),e._v(" II. Motivation")]),e._v(" "),a("p",[e._v("We want to provide our users with an always improved usage experience. Currently, the engine only accepts JSON format as a data source. We want to give users the possibility of another simple data format, well known, to use. Thus, give them more versatility at the data source choices for the indexing (add and update) step.")]),e._v(" "),a("p",[e._v("Since most SQL engines or SQL clients can easily dump data as CSV, it will facilitate Meilisearch adoption by extending the indexing step on a wider range of customer cases than before.")]),e._v(" "),a("p",[e._v("Writing performance is also considered as a motivation since CSV parsing is less CPU and memory intensive than parsing Json due to the streamable capability of the CSV format.")]),e._v(" "),a("h3",{attrs:{id:"iii-explanation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#iii-explanation"}},[e._v("#")]),e._v(" III.Explanation")]),e._v(" "),a("h4",{attrs:{id:"csv-formatting-rules"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#csv-formatting-rules"}},[e._v("#")]),e._v(" CSV Formatting Rules")]),e._v(" "),a("p",[e._v("While there's "),a("a",{attrs:{href:"https://tools.ietf.org/html/rfc4180",target:"_blank",rel:"noopener noreferrer"}},[e._v("RFC 4180"),a("OutboundLink")],1),e._v(" as a try to add a specification for CSV format, we will find a lot of variations from that. Meilisearch features capabilities requires CSV data to be formatted the proper way to be parsable by the engine.")]),e._v(" "),a("ul",[a("li",[e._v("CSV data format needs to contain a first line representing the list of attributes with the optionally chosen type separated from the attribute name by "),a("code",[e._v(":")]),e._v(" character. The type is case insensitive.")])]),e._v(" "),a("blockquote",[a("p",[e._v("An attribute can be specificed with three types: "),a("code",[e._v("string")]),e._v(", "),a("code",[e._v("boolean")]),e._v(" or "),a("code",[e._v("number")]),e._v(". A missing type will be interpreted as a "),a("code",[e._v("string")]),e._v(" by default.")]),e._v(" "),a("p",[e._v('Valid headline example: "id:number","title:string","author","price:number","cute:boolean"')])]),e._v(" "),a("ul",[a("li",[e._v("The following CSV lines will represent a document for Meilisearch.")]),e._v(" "),a("li",[e._v("A "),a("code",[e._v(",")]),e._v(" character must separate each cell.")]),e._v(" "),a("li",[e._v("A CSV value should be enclosed in double-quotes when it contains the delimiter character or a newline to escape it.")]),e._v(" "),a("li",[e._v("Using double-quotes to enclose fields, then a double-quote appearing inside a field must be escaped by preceding it with another double quote as mentioned in "),a("a",{attrs:{href:"https://tools.ietf.org/html/rfc4180",target:"_blank",rel:"noopener noreferrer"}},[e._v("RFC 4180"),a("OutboundLink")],1),e._v(".")]),e._v(" "),a("li",[e._v("Float value should be written with a "),a("code",[e._v(".")]),e._v(" character, like "),a("code",[e._v("3.14")]),e._v(".")]),e._v(" "),a("li",[e._v("CSV text should be encoded in UTF8.")]),e._v(" "),a("li",[e._v("The format can't handle array cell values. We are providing "),a("code",[e._v("nd-json")]),e._v(" format to deal with theses types of attribute in a easier way.")]),e._v(" "),a("li",[e._v("A "),a("code",[e._v("csvDelimiter")]),e._v(" query parameter is available to customize the delimiter used in the documents.\n"),a("ul",[a("li",[e._v("This "),a("code",[e._v("csvDelimiter")]),e._v(" is optional. By default, the "),a("code",[e._v(",")]),e._v(" character is used.")]),e._v(" "),a("li",[e._v("The separator must be one "),a("a",{attrs:{href:"https://www.rfc-editor.org/rfc/rfc20",target:"_blank",rel:"noopener noreferrer"}},[e._v("ascii char"),a("OutboundLink")],1),e._v(".")]),e._v(" "),a("li",[e._v("The separator can't be used with another Content-Type, or else it'll throw an error.")])])])]),e._v(" "),a("h5",{attrs:{id:"null-value"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#null-value"}},[e._v("#")]),e._v(" "),a("code",[e._v("null")]),e._v(" value")]),e._v(" "),a("ul",[a("li",[e._v("If a field is of type "),a("code",[e._v("string")]),e._v(", then an empty cell is considered as a "),a("code",[e._v("null")]),e._v(" value (e.g. "),a("code",[e._v(",,")]),e._v("), anything else is turned into a string value (e.g. "),a("code",[e._v(", ,")]),e._v(" is a single whitespace string)")]),e._v(" "),a("li",[e._v("If a field is of type "),a("code",[e._v("number")]),e._v(", when the trimmed field is empty, it's considered as a "),a("code",[e._v("null")]),e._v(" value (e.g. "),a("code",[e._v(",,")]),e._v(" "),a("code",[e._v(", ,")]),e._v("); otherwise, Meilisearch tries to parse the number.")]),e._v(" "),a("li",[e._v("If a field is of type "),a("code",[e._v("boolean")]),e._v(", when the trimmed field is empty, it's considered as a "),a("code",[e._v("null")]),e._v(" value (e.g. "),a("code",[e._v(",,")]),e._v(" "),a("code",[e._v(", ,")]),e._v("); otherwise, Meilisearch tries to parse the boolean as either "),a("code",[e._v("true")]),e._v(" or "),a("code",[e._v("false")]),e._v(".")])]),e._v(" "),a("h5",{attrs:{id:"example-with-a-comma-inside-a-cell"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#example-with-a-comma-inside-a-cell"}},[e._v("#")]),e._v(" Example with a comma inside a cell")]),e._v(" "),a("p",[e._v("Given the CSV payload")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('"id:number","label","price:number","colors","description","contains_a_dog_picture:boolean"\n"1","t-shirt","4.99","red","Thus, you will rock at summer time.","false"\n')])])]),a("p",[e._v("the search result should be displayed as")]),e._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"hits"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"id"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"label"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"t-shirt"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"price"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("4.99")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"colors"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"red"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"description"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"Thus, you will rock at summer time."')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"contains_a_dog_picture"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[e._v("false")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n ...\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),a("h5",{attrs:{id:"example-with-a-double-quote-inside-a-cell"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#example-with-a-double-quote-inside-a-cell"}},[e._v("#")]),e._v(" Example with a double quote inside a cell")]),e._v(" "),a("p",[e._v("Given the CSV payload")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('"id:number","label","price","colors","description"\n"1","t-shirt","4.99","red","Hey, you will ""rock"" at summer time."\n')])])]),a("p",[e._v("the search result should be displayed as")]),e._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"hits"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"id"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"label"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"t-shirt"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"price"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"4.99"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"colors"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"red"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"description"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"Hey, you will rock at summer time."')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n ...\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),a("blockquote",[a("p",[e._v("Note that the price attribute was not typed as a number. By default, Meilisearch type it as a string.")])]),e._v(" "),a("h5",{attrs:{id:"example-with-an-empty-cell"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#example-with-an-empty-cell"}},[e._v("#")]),e._v(" Example with an empty cell")]),e._v(" "),a("p",[e._v("Given the CSV payload")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v("id:number,label,price:number,colors\n1,t-shirt,,red\n")])])]),a("p",[e._v("the search result should be displayed as")]),e._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"hits"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"id"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"label"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"t-shirt"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"price"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token null keyword"}},[e._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"colors"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"red"')]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n ...\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),a("h4",{attrs:{id:"api-endpoints"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#api-endpoints"}},[e._v("#")]),e._v(" API Endpoints")]),e._v(" "),a("blockquote",[a("p",[e._v("Each API endpoints mentioned above will now require a "),a("code",[e._v("text/csv")]),e._v(" as "),a("code",[e._v("Content-Type")]),e._v(" header to be processed as CSV data.")])]),e._v(" "),a("p",[a("strong",[e._v("As a developer, I want to upload a CSV payload of documents so that end-user can search them")])]),e._v(" "),a("p",[a("strong",[e._v("POST documents")]),e._v(" "),a("code",[e._v("/indexes/:indexUid/documents")])]),e._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[e._v("curl")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("\n -X POST "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v("'http://localhost:7700/indexes/movies/documents'")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("\n -H "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v("'Content-Type: text/csv'")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("\n --data--binary "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('\'\n "id","label","price:number","colors","description"\\n\n "1","hoodie","19.99","purple","Hey, you will rock at summer time."\n \'')]),e._v("\n")])])]),a("blockquote",[a("p",[e._v("202 Accepted - Response")])]),e._v(" "),a("p",[a("strong",[e._v("PUT documents")]),e._v(" "),a("code",[e._v("/indexes/:indexUid/documents")])]),e._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[e._v("curl")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("\n -X PUT "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v("'http://localhost:7700/indexes/movies/documents'")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("\n -H "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v("'Content-Type: text/csv'")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("\n --data-binary "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('\'\n "id","label","price:number","colors","description"\\n\n "1","hoodie","19.99","purple","Hey, you will rock at summer time."\n \'')]),e._v("\n")])])]),a("blockquote",[a("p",[e._v("202 Accepted - Response")])]),e._v(" "),a("h5",{attrs:{id:"errors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#errors"}},[e._v("#")]),e._v(" Errors")]),e._v(" "),a("ul",[a("li",[e._v("🔴 Omitted "),a("code",[e._v("Content-Type")]),e._v(" header will lead to a 415 Unsupported Media Type - "),a("strong",[e._v("missing_content_type")]),e._v(" error code.")]),e._v(" "),a("li",[e._v("🔴 Sending an empty "),a("code",[e._v("Content-Type")]),e._v(" will lead to a 415 Unsupported Media Type - "),a("strong",[e._v("invalid_content_type")]),e._v(" error code.")]),e._v(" "),a("li",[e._v("🔴 Sending a different "),a("code",[e._v("Content-Type")]),e._v(" than "),a("code",[e._v("application/json")]),e._v(", "),a("code",[e._v("application/x-ndjson")]),e._v(" or "),a("code",[e._v("text/csv")]),e._v(" will lead to 415 Unsupported Media Type "),a("strong",[e._v("invalid_content_type")]),e._v(" error code.")]),e._v(" "),a("li",[e._v("🔴 Sending an empty payload will lead to a 400 Bad Request - "),a("strong",[e._v("missing_payload")]),e._v(" error code.")]),e._v(" "),a("li",[e._v("🔴 Sending a different payload type than the "),a("code",[e._v("Content-Type")]),e._v(" header should return a 400 Bad Request - "),a("strong",[e._v("malformed_payload")]),e._v(" error code.")]),e._v(" "),a("li",[e._v("🔴 Sending a payload excessing the limit will lead to a 413 Payload Too Large - "),a("strong",[e._v("payload_too_large")]),e._v(" error code.")]),e._v(" "),a("li",[e._v("🔴 Sending an invalid CSV format will lead to a 400 bad_request - "),a("strong",[e._v("malformed_payload")]),e._v(" error code.")]),e._v(" "),a("li",[e._v("🔴 Sending a CSV header that does not conform to the specification will lead to a 400 bad_request - "),a("strong",[e._v("malformed_payload")]),e._v(" error code.")]),e._v(" "),a("li",[e._v("🔴 Sending an invalid csv delimiter: not exactly one ASCII char. This will lead to a 400 bad_request - "),a("strong",[e._v("invalid_document_csv_delimiter")]),e._v(" error code.")]),e._v(" "),a("li",[e._v("🔴 Sending a CSV cell with the type "),a("code",[e._v("number")]),e._v(" or "),a("code",[e._v("boolean")]),e._v(" that can't be parsed will lead to a 400 bad_request - "),a("strong",[e._v("malformed_payload")]),e._v(" error code.")])]),e._v(" "),a("h5",{attrs:{id:"errors-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#errors-definition"}},[e._v("#")]),e._v(" Errors Definition")]),e._v(" "),a("h2",{attrs:{id:"missing-content-type"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#missing-content-type"}},[e._v("#")]),e._v(" missing_content_type")]),e._v(" "),a("h3",{attrs:{id:"context"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#context"}},[e._v("#")]),e._v(" Context")]),e._v(" "),a("p",[e._v("This error occurs when the Content-Type header is missing.")]),e._v(" "),a("h3",{attrs:{id:"error-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#error-definition"}},[e._v("#")]),e._v(" Error Definition")]),e._v(" "),a("p",[e._v("HTTP Code: "),a("code",[e._v("415 Unsupported Media Type")])]),e._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"message"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"A Content-Type header is missing. Accepted values for Content-Type are: :contentTypeList"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"missing_content_type"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"invalid_request"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"link"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"https://docs.meilisearch.com/errors#missing_content_type"')]),e._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),a("ul",[a("li",[e._v("The "),a("code",[e._v(":contentTypeList")]),e._v(" is inferred when the message is generated. The values are separated by a "),a("code",[e._v(",")]),e._v(" char. e.g. "),a("code",[e._v("application/json")]),e._v(", "),a("code",[e._v("text/csv")]),e._v(".")])]),e._v(" "),a("hr"),e._v(" "),a("h2",{attrs:{id:"invalid-content-type"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#invalid-content-type"}},[e._v("#")]),e._v(" invalid_content_type")]),e._v(" "),a("h3",{attrs:{id:"context-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#context-2"}},[e._v("#")]),e._v(" Context")]),e._v(" "),a("p",[e._v("This error occurs when the provided content-type is not handled by the API method.")]),e._v(" "),a("h3",{attrs:{id:"error-definition-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#error-definition-2"}},[e._v("#")]),e._v(" Error Definition")]),e._v(" "),a("p",[e._v("HTTP Code: "),a("code",[e._v("415 Unsupported Media Type")])]),e._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"message"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"The Content-Type :contentType is invalid. Accepted values for Content-Type are: :contentTypeList"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"invalid_content_type"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"invalid_request"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"link"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"https://docs.meilisearch.com/errors#invalid_content_type"')]),e._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),a("ul",[a("li",[e._v("The "),a("code",[e._v(":contentTypeList")]),e._v(" is inferred when the message is generated. The values are separated by a "),a("code",[e._v(",")]),e._v(" char. e.g. "),a("code",[e._v("application/json")]),e._v(", "),a("code",[e._v("text/csv")]),e._v(".")])]),e._v(" "),a("hr"),e._v(" "),a("h2",{attrs:{id:"missing-payload"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#missing-payload"}},[e._v("#")]),e._v(" missing_payload")]),e._v(" "),a("h3",{attrs:{id:"context-3"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#context-3"}},[e._v("#")]),e._v(" Context")]),e._v(" "),a("p",[e._v("This error occurs when the client does not provide a mandatory payload to the request.")]),e._v(" "),a("h3",{attrs:{id:"error-definition-3"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#error-definition-3"}},[e._v("#")]),e._v(" Error Definition")]),e._v(" "),a("p",[e._v("HTTP Code: "),a("code",[e._v("400 Bad Request")])]),e._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"message"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"A :payloadType payload is missing."')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"missing_payload"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"invalid_request"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"link"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"https://docs.meilisearch.com/errors#missing_payload"')]),e._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),a("ul",[a("li",[e._v("The "),a("code",[e._v(":payloadType")]),e._v(" is inferred when the message is generated. e.g. "),a("code",[e._v("json")]),e._v(", "),a("code",[e._v("ndjson")]),e._v(", "),a("code",[e._v("csv")])])]),e._v(" "),a("hr"),e._v(" "),a("h2",{attrs:{id:"malformed-payload"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#malformed-payload"}},[e._v("#")]),e._v(" malformed_payload")]),e._v(" "),a("h3",{attrs:{id:"context-4"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#context-4"}},[e._v("#")]),e._v(" Context")]),e._v(" "),a("p",[e._v("This error occurs when the format sent in the payload is malformed. The payload contains a syntax error.")]),e._v(" "),a("h3",{attrs:{id:"error-definition-4"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#error-definition-4"}},[e._v("#")]),e._v(" Error Definition")]),e._v(" "),a("p",[e._v("HTTP Code: "),a("code",[e._v("400 Bad Request")])]),e._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[e._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"message"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"The :payloadType payload provided is malformed. :syntaxErrorHelper."')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"malformed_payload"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"invalid_request"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"link"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"https://docs.meilisearch.com/errors#malformed_payload"')]),e._v("\n")])])]),a("ul",[a("li",[e._v("The "),a("code",[e._v(":payloadType")]),e._v(" is inferred when the message is generated. e.g. "),a("code",[e._v("json")]),e._v(", "),a("code",[e._v("ndjson")]),e._v(", "),a("code",[e._v("csv")])]),e._v(" "),a("li",[e._v("The "),a("code",[e._v(":syntaxErrorHelper")]),e._v(" is inferred when the message is generated.")])]),e._v(" "),a("hr"),e._v(" "),a("h2",{attrs:{id:"_2-technical-details"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-technical-details"}},[e._v("#")]),e._v(" 2. Technical details")]),e._v(" "),a("p",[e._v("n/a")]),e._v(" "),a("h2",{attrs:{id:"_3-future-possibilities"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-future-possibilities"}},[e._v("#")]),e._v(" 3. Future possibilities")]),e._v(" "),a("ul",[a("li",[e._v("Provide an interface in the future dashboard to upload CSV data into an index and optionally provide the headers types.")]),e._v(" "),a("li",[e._v("Set a payload limit directly related to the type of data format. Currently, the payload size is equivalent to "),a("a",{attrs:{href:"https://docs.meilisearch.com/reference/features/configuration.html#payload-limit-size",target:"_blank",rel:"noopener noreferrer"}},[e._v("JSON payload size"),a("OutboundLink")],1),e._v(". Metrics on feature usage and configuration update should help to choose a better suited value for this type of data format.")])])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[15],{438:function(e,t,a){"use strict";a.r(t);var s=a(62),r=Object(s.a)({},(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[a("ul",[a("li",[e._v("Title: Indexing CSV")]),e._v(" "),a("li",[e._v("Start Date: 2021-04-9")]),e._v(" "),a("li",[e._v("Specification PR: "),a("a",{attrs:{href:"https://github.com/Meilisearch/specifications/pull/28",target:"_blank",rel:"noopener noreferrer"}},[e._v("PR-#28"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Discovery Issue: n/a")])]),e._v(" "),a("h1",{attrs:{id:"indexing-csv"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#indexing-csv"}},[e._v("#")]),e._v(" Indexing CSV")]),e._v(" "),a("h2",{attrs:{id:"_1-functional-specification"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-functional-specification"}},[e._v("#")]),e._v(" 1. Functional Specification")]),e._v(" "),a("h3",{attrs:{id:"i-summary"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#i-summary"}},[e._v("#")]),e._v(" I. Summary")]),e._v(" "),a("p",[e._v("To index documents, the body of the add documents request has to match a specific format. That specific format is then parsed and tokenized inside Meilisearch. After which, the documents added are in the pool of searchable and returnable documents.")]),e._v(" "),a("p",[e._v("A "),a("a",{attrs:{href:"https://en.wikipedia.org/wiki/Comma-separated_values",target:"_blank",rel:"noopener noreferrer"}},[e._v("CSV"),a("OutboundLink")],1),e._v(" data format is broadly used to store and exchange data in a simple format.")]),e._v(" "),a("p",[e._v("Also, in order to boost write performance CSV data format is more suited than JSON for consequent datasets, as keys are not duplicated for every document.")]),e._v(" "),a("h4",{attrs:{id:"summary-key-points"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#summary-key-points"}},[e._v("#")]),e._v(" Summary Key Points")]),e._v(" "),a("ul",[a("li",[e._v("The header of the csv payload allows to name the attributes and type them.")]),e._v(" "),a("li",[a("code",[e._v("text/csv")]),e._v(" Content-Type header is now supported.")]),e._v(" "),a("li",[e._v("A new query parameter, "),a("code",[e._v("csvDelimiter")]),e._v(", has been introduced to customize the csv delimiter used in the document. It can change between two "),a("code",[e._v("documentAddition")]),e._v(".")]),e._v(" "),a("li",[e._v("The error cases have been strengthened and completed. See Errors part.")])]),e._v(" "),a("h3",{attrs:{id:"ii-motivation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#ii-motivation"}},[e._v("#")]),e._v(" II. Motivation")]),e._v(" "),a("p",[e._v("We want to provide our users with an always improved usage experience. Currently, the engine only accepts JSON format as a data source. We want to give users the possibility of another simple data format, well known, to use. Thus, give them more versatility at the data source choices for the indexing (add and update) step.")]),e._v(" "),a("p",[e._v("Since most SQL engines or SQL clients can easily dump data as CSV, it will facilitate Meilisearch adoption by extending the indexing step on a wider range of customer cases than before.")]),e._v(" "),a("p",[e._v("Writing performance is also considered as a motivation since CSV parsing is less CPU and memory intensive than parsing Json due to the streamable capability of the CSV format.")]),e._v(" "),a("h3",{attrs:{id:"iii-explanation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#iii-explanation"}},[e._v("#")]),e._v(" III.Explanation")]),e._v(" "),a("h4",{attrs:{id:"csv-formatting-rules"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#csv-formatting-rules"}},[e._v("#")]),e._v(" CSV Formatting Rules")]),e._v(" "),a("p",[e._v("While there's "),a("a",{attrs:{href:"https://tools.ietf.org/html/rfc4180",target:"_blank",rel:"noopener noreferrer"}},[e._v("RFC 4180"),a("OutboundLink")],1),e._v(" as a try to add a specification for CSV format, we will find a lot of variations from that. Meilisearch features capabilities requires CSV data to be formatted the proper way to be parsable by the engine.")]),e._v(" "),a("ul",[a("li",[e._v("CSV data format needs to contain a first line representing the list of attributes with the optionally chosen type separated from the attribute name by "),a("code",[e._v(":")]),e._v(" character. The type is case insensitive.")])]),e._v(" "),a("blockquote",[a("p",[e._v("An attribute can be specificed with three types: "),a("code",[e._v("string")]),e._v(", "),a("code",[e._v("boolean")]),e._v(" or "),a("code",[e._v("number")]),e._v(". A missing type will be interpreted as a "),a("code",[e._v("string")]),e._v(" by default.")]),e._v(" "),a("p",[e._v('Valid headline example: "id:number","title:string","author","price:number","cute:boolean"')])]),e._v(" "),a("ul",[a("li",[e._v("The following CSV lines will represent a document for Meilisearch.")]),e._v(" "),a("li",[e._v("A "),a("code",[e._v(",")]),e._v(" character must separate each cell.")]),e._v(" "),a("li",[e._v("A CSV value should be enclosed in double-quotes when it contains the delimiter character or a newline to escape it.")]),e._v(" "),a("li",[e._v("Using double-quotes to enclose fields, then a double-quote appearing inside a field must be escaped by preceding it with another double quote as mentioned in "),a("a",{attrs:{href:"https://tools.ietf.org/html/rfc4180",target:"_blank",rel:"noopener noreferrer"}},[e._v("RFC 4180"),a("OutboundLink")],1),e._v(".")]),e._v(" "),a("li",[e._v("Float value should be written with a "),a("code",[e._v(".")]),e._v(" character, like "),a("code",[e._v("3.14")]),e._v(".")]),e._v(" "),a("li",[e._v("CSV text should be encoded in UTF8.")]),e._v(" "),a("li",[e._v("The format can't handle array cell values. We are providing "),a("code",[e._v("nd-json")]),e._v(" format to deal with theses types of attribute in a easier way.")]),e._v(" "),a("li",[e._v("A "),a("code",[e._v("csvDelimiter")]),e._v(" query parameter is available to customize the delimiter used in the documents.\n"),a("ul",[a("li",[e._v("This "),a("code",[e._v("csvDelimiter")]),e._v(" is optional. By default, the "),a("code",[e._v(",")]),e._v(" character is used.")]),e._v(" "),a("li",[e._v("The separator must be one "),a("a",{attrs:{href:"https://www.rfc-editor.org/rfc/rfc20",target:"_blank",rel:"noopener noreferrer"}},[e._v("ascii char"),a("OutboundLink")],1),e._v(".")]),e._v(" "),a("li",[e._v("The separator can't be used with another Content-Type, or else it'll throw an error.")])])])]),e._v(" "),a("h5",{attrs:{id:"null-value"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#null-value"}},[e._v("#")]),e._v(" "),a("code",[e._v("null")]),e._v(" value")]),e._v(" "),a("ul",[a("li",[e._v("If a field is of type "),a("code",[e._v("string")]),e._v(", then an empty cell is considered as a "),a("code",[e._v("null")]),e._v(" value (e.g. "),a("code",[e._v(",,")]),e._v("), anything else is turned into a string value (e.g. "),a("code",[e._v(", ,")]),e._v(" is a single whitespace string)")]),e._v(" "),a("li",[e._v("If a field is of type "),a("code",[e._v("number")]),e._v(", when the trimmed field is empty, it's considered as a "),a("code",[e._v("null")]),e._v(" value (e.g. "),a("code",[e._v(",,")]),e._v(" "),a("code",[e._v(", ,")]),e._v("); otherwise, Meilisearch tries to parse the number.")]),e._v(" "),a("li",[e._v("If a field is of type "),a("code",[e._v("boolean")]),e._v(", when the trimmed field is empty, it's considered as a "),a("code",[e._v("null")]),e._v(" value (e.g. "),a("code",[e._v(",,")]),e._v(" "),a("code",[e._v(", ,")]),e._v("); otherwise, Meilisearch tries to parse the boolean as either "),a("code",[e._v("true")]),e._v(" or "),a("code",[e._v("false")]),e._v(".")])]),e._v(" "),a("h5",{attrs:{id:"example-with-a-comma-inside-a-cell"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#example-with-a-comma-inside-a-cell"}},[e._v("#")]),e._v(" Example with a comma inside a cell")]),e._v(" "),a("p",[e._v("Given the CSV payload")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('"id:number","label","price:number","colors","description","contains_a_dog_picture:boolean"\n"1","t-shirt","4.99","red","Thus, you will rock at summer time.","false"\n')])])]),a("p",[e._v("the search result should be displayed as")]),e._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"hits"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"id"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"label"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"t-shirt"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"price"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("4.99")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"colors"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"red"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"description"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"Thus, you will rock at summer time."')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"contains_a_dog_picture"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[e._v("false")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n ...\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),a("h5",{attrs:{id:"example-with-a-double-quote-inside-a-cell"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#example-with-a-double-quote-inside-a-cell"}},[e._v("#")]),e._v(" Example with a double quote inside a cell")]),e._v(" "),a("p",[e._v("Given the CSV payload")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('"id:number","label","price","colors","description"\n"1","t-shirt","4.99","red","Hey, you will ""rock"" at summer time."\n')])])]),a("p",[e._v("the search result should be displayed as")]),e._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"hits"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"id"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"label"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"t-shirt"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"price"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"4.99"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"colors"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"red"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"description"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"Hey, you will rock at summer time."')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n ...\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),a("blockquote",[a("p",[e._v("Note that the price attribute was not typed as a number. By default, Meilisearch type it as a string.")])]),e._v(" "),a("h5",{attrs:{id:"example-with-an-empty-cell"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#example-with-an-empty-cell"}},[e._v("#")]),e._v(" Example with an empty cell")]),e._v(" "),a("p",[e._v("Given the CSV payload")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v("id:number,label,price:number,colors\n1,t-shirt,,red\n")])])]),a("p",[e._v("the search result should be displayed as")]),e._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"hits"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"id"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"label"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"t-shirt"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"price"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token null keyword"}},[e._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"colors"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"red"')]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n ...\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),a("h4",{attrs:{id:"api-endpoints"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#api-endpoints"}},[e._v("#")]),e._v(" API Endpoints")]),e._v(" "),a("blockquote",[a("p",[e._v("Each API endpoints mentioned above will now require a "),a("code",[e._v("text/csv")]),e._v(" as "),a("code",[e._v("Content-Type")]),e._v(" header to be processed as CSV data.")])]),e._v(" "),a("p",[a("strong",[e._v("As a developer, I want to upload a CSV payload of documents so that end-user can search them")])]),e._v(" "),a("p",[a("strong",[e._v("POST documents")]),e._v(" "),a("code",[e._v("/indexes/:indexUid/documents")])]),e._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[e._v("curl")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("\n -X POST "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v("'http://localhost:7700/indexes/movies/documents'")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("\n -H "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v("'Content-Type: text/csv'")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("\n --data--binary "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('\'\n "id","label","price:number","colors","description"\\n\n "1","hoodie","19.99","purple","Hey, you will rock at summer time."\n \'')]),e._v("\n")])])]),a("blockquote",[a("p",[e._v("202 Accepted - Response")])]),e._v(" "),a("p",[a("strong",[e._v("PUT documents")]),e._v(" "),a("code",[e._v("/indexes/:indexUid/documents")])]),e._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[e._v("curl")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("\n -X PUT "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v("'http://localhost:7700/indexes/movies/documents'")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("\n -H "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v("'Content-Type: text/csv'")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("\\")]),e._v("\n --data-binary "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('\'\n "id","label","price:number","colors","description"\\n\n "1","hoodie","19.99","purple","Hey, you will rock at summer time."\n \'')]),e._v("\n")])])]),a("blockquote",[a("p",[e._v("202 Accepted - Response")])]),e._v(" "),a("h5",{attrs:{id:"errors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#errors"}},[e._v("#")]),e._v(" Errors")]),e._v(" "),a("ul",[a("li",[e._v("🔴 Omitted "),a("code",[e._v("Content-Type")]),e._v(" header will lead to a 415 Unsupported Media Type - "),a("strong",[e._v("missing_content_type")]),e._v(" error code.")]),e._v(" "),a("li",[e._v("🔴 Sending an empty "),a("code",[e._v("Content-Type")]),e._v(" will lead to a 415 Unsupported Media Type - "),a("strong",[e._v("invalid_content_type")]),e._v(" error code.")]),e._v(" "),a("li",[e._v("🔴 Sending a different "),a("code",[e._v("Content-Type")]),e._v(" than "),a("code",[e._v("application/json")]),e._v(", "),a("code",[e._v("application/x-ndjson")]),e._v(" or "),a("code",[e._v("text/csv")]),e._v(" will lead to 415 Unsupported Media Type "),a("strong",[e._v("invalid_content_type")]),e._v(" error code.")]),e._v(" "),a("li",[e._v("🔴 Sending an empty payload will lead to a 400 Bad Request - "),a("strong",[e._v("missing_payload")]),e._v(" error code.")]),e._v(" "),a("li",[e._v("🔴 Sending a different payload type than the "),a("code",[e._v("Content-Type")]),e._v(" header should return a 400 Bad Request - "),a("strong",[e._v("malformed_payload")]),e._v(" error code.")]),e._v(" "),a("li",[e._v("🔴 Sending a payload excessing the limit will lead to a 413 Payload Too Large - "),a("strong",[e._v("payload_too_large")]),e._v(" error code.")]),e._v(" "),a("li",[e._v("🔴 Sending an invalid CSV format will lead to a 400 bad_request - "),a("strong",[e._v("malformed_payload")]),e._v(" error code.")]),e._v(" "),a("li",[e._v("🔴 Sending a CSV header that does not conform to the specification will lead to a 400 bad_request - "),a("strong",[e._v("malformed_payload")]),e._v(" error code.")]),e._v(" "),a("li",[e._v("🔴 Sending an invalid csv delimiter: not exactly one ASCII char. This will lead to a 400 bad_request - "),a("strong",[e._v("invalid_document_csv_delimiter")]),e._v(" error code.")]),e._v(" "),a("li",[e._v("🔴 Sending a CSV cell with the type "),a("code",[e._v("number")]),e._v(" or "),a("code",[e._v("boolean")]),e._v(" that can't be parsed will lead to a 400 bad_request - "),a("strong",[e._v("malformed_payload")]),e._v(" error code.")])]),e._v(" "),a("h5",{attrs:{id:"errors-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#errors-definition"}},[e._v("#")]),e._v(" Errors Definition")]),e._v(" "),a("h2",{attrs:{id:"missing-content-type"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#missing-content-type"}},[e._v("#")]),e._v(" missing_content_type")]),e._v(" "),a("h3",{attrs:{id:"context"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#context"}},[e._v("#")]),e._v(" Context")]),e._v(" "),a("p",[e._v("This error occurs when the Content-Type header is missing.")]),e._v(" "),a("h3",{attrs:{id:"error-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#error-definition"}},[e._v("#")]),e._v(" Error Definition")]),e._v(" "),a("p",[e._v("HTTP Code: "),a("code",[e._v("415 Unsupported Media Type")])]),e._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"message"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"A Content-Type header is missing. Accepted values for Content-Type are: :contentTypeList"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"missing_content_type"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"invalid_request"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"link"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"https://docs.meilisearch.com/errors#missing_content_type"')]),e._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),a("ul",[a("li",[e._v("The "),a("code",[e._v(":contentTypeList")]),e._v(" is inferred when the message is generated. The values are separated by a "),a("code",[e._v(",")]),e._v(" char. e.g. "),a("code",[e._v("application/json")]),e._v(", "),a("code",[e._v("text/csv")]),e._v(".")])]),e._v(" "),a("hr"),e._v(" "),a("h2",{attrs:{id:"invalid-content-type"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#invalid-content-type"}},[e._v("#")]),e._v(" invalid_content_type")]),e._v(" "),a("h3",{attrs:{id:"context-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#context-2"}},[e._v("#")]),e._v(" Context")]),e._v(" "),a("p",[e._v("This error occurs when the provided content-type is not handled by the API method.")]),e._v(" "),a("h3",{attrs:{id:"error-definition-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#error-definition-2"}},[e._v("#")]),e._v(" Error Definition")]),e._v(" "),a("p",[e._v("HTTP Code: "),a("code",[e._v("415 Unsupported Media Type")])]),e._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"message"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"The Content-Type :contentType is invalid. Accepted values for Content-Type are: :contentTypeList"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"invalid_content_type"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"invalid_request"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"link"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"https://docs.meilisearch.com/errors#invalid_content_type"')]),e._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),a("ul",[a("li",[e._v("The "),a("code",[e._v(":contentTypeList")]),e._v(" is inferred when the message is generated. The values are separated by a "),a("code",[e._v(",")]),e._v(" char. e.g. "),a("code",[e._v("application/json")]),e._v(", "),a("code",[e._v("text/csv")]),e._v(".")])]),e._v(" "),a("hr"),e._v(" "),a("h2",{attrs:{id:"missing-payload"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#missing-payload"}},[e._v("#")]),e._v(" missing_payload")]),e._v(" "),a("h3",{attrs:{id:"context-3"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#context-3"}},[e._v("#")]),e._v(" Context")]),e._v(" "),a("p",[e._v("This error occurs when the client does not provide a mandatory payload to the request.")]),e._v(" "),a("h3",{attrs:{id:"error-definition-3"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#error-definition-3"}},[e._v("#")]),e._v(" Error Definition")]),e._v(" "),a("p",[e._v("HTTP Code: "),a("code",[e._v("400 Bad Request")])]),e._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"message"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"A :payloadType payload is missing."')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"missing_payload"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"invalid_request"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"link"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"https://docs.meilisearch.com/errors#missing_payload"')]),e._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),a("ul",[a("li",[e._v("The "),a("code",[e._v(":payloadType")]),e._v(" is inferred when the message is generated. e.g. "),a("code",[e._v("json")]),e._v(", "),a("code",[e._v("ndjson")]),e._v(", "),a("code",[e._v("csv")])])]),e._v(" "),a("hr"),e._v(" "),a("h2",{attrs:{id:"malformed-payload"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#malformed-payload"}},[e._v("#")]),e._v(" malformed_payload")]),e._v(" "),a("h3",{attrs:{id:"context-4"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#context-4"}},[e._v("#")]),e._v(" Context")]),e._v(" "),a("p",[e._v("This error occurs when the format sent in the payload is malformed. The payload contains a syntax error.")]),e._v(" "),a("h3",{attrs:{id:"error-definition-4"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#error-definition-4"}},[e._v("#")]),e._v(" Error Definition")]),e._v(" "),a("p",[e._v("HTTP Code: "),a("code",[e._v("400 Bad Request")])]),e._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[e._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"message"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"The :payloadType payload provided is malformed. :syntaxErrorHelper."')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"malformed_payload"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"invalid_request"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"link"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"https://docs.meilisearch.com/errors#malformed_payload"')]),e._v("\n")])])]),a("ul",[a("li",[e._v("The "),a("code",[e._v(":payloadType")]),e._v(" is inferred when the message is generated. e.g. "),a("code",[e._v("json")]),e._v(", "),a("code",[e._v("ndjson")]),e._v(", "),a("code",[e._v("csv")])]),e._v(" "),a("li",[e._v("The "),a("code",[e._v(":syntaxErrorHelper")]),e._v(" is inferred when the message is generated.")])]),e._v(" "),a("hr"),e._v(" "),a("h2",{attrs:{id:"_2-technical-details"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-technical-details"}},[e._v("#")]),e._v(" 2. Technical details")]),e._v(" "),a("p",[e._v("n/a")]),e._v(" "),a("h2",{attrs:{id:"_3-future-possibilities"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-future-possibilities"}},[e._v("#")]),e._v(" 3. Future possibilities")]),e._v(" "),a("ul",[a("li",[e._v("Provide an interface in the future dashboard to upload CSV data into an index and optionally provide the headers types.")]),e._v(" "),a("li",[e._v("Set a payload limit directly related to the type of data format. Currently, the payload size is equivalent to "),a("a",{attrs:{href:"https://docs.meilisearch.com/reference/features/configuration.html#payload-limit-size",target:"_blank",rel:"noopener noreferrer"}},[e._v("JSON payload size"),a("OutboundLink")],1),e._v(". Metrics on feature usage and configuration update should help to choose a better suited value for this type of data format.")])])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file diff --git a/docs/assets/js/20.fb03e236.js b/docs/assets/js/20.fe442e43.js similarity index 98% rename from docs/assets/js/20.fb03e236.js rename to docs/assets/js/20.fe442e43.js index 49f74c848..bab7328c4 100644 --- a/docs/assets/js/20.fb03e236.js +++ b/docs/assets/js/20.fe442e43.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[20],{445:function(e,t,i){"use strict";i.r(t);var a=i(62),r=Object(a.a)({},(function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[i("ul",[i("li",[e._v("Title: Rename attributesForFaceting")]),e._v(" "),i("li",[e._v("Start Date: 2021-04-16")]),e._v(" "),i("li",[e._v("Specification PR: "),i("a",{attrs:{href:"https://github.com/meilisearch/specifications/pull/38",target:"_blank",rel:"noopener noreferrer"}},[e._v("#38"),i("OutboundLink")],1)]),e._v(" "),i("li",[e._v("MeiliSearch Tracking-Issues: "),i("a",{attrs:{href:"https://github.com/meilisearch/transplant/issues/187",target:"_blank",rel:"noopener noreferrer"}},[e._v("transplant/#187"),i("OutboundLink")],1)])]),e._v(" "),i("h1",{attrs:{id:"rename-attributesforfaceting"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#rename-attributesforfaceting"}},[e._v("#")]),e._v(" Rename attributesForFaceting")]),e._v(" "),i("h2",{attrs:{id:"_1-feature-description-and-interaction"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_1-feature-description-and-interaction"}},[e._v("#")]),e._v(" 1. Feature Description and Interaction")]),e._v(" "),i("h3",{attrs:{id:"i-summary-motivation"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#i-summary-motivation"}},[e._v("#")]),e._v(" I. Summary & Motivation")]),e._v(" "),i("p",[e._v("As the new engine requires filterable fields to be declared in attributesForFaceting, the name of this field is not as clear as we would like it to be. Since it’s now concerning filter and possible wanted facets on search result by the user.")]),e._v(" "),i("h3",{attrs:{id:"ii-additional-materials"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#ii-additional-materials"}},[e._v("#")]),e._v(" II. Additional Materials")]),e._v(" "),i("p",[e._v("N/A")]),e._v(" "),i("h3",{attrs:{id:"iii-explanation"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#iii-explanation"}},[e._v("#")]),e._v(" III.Explanation")]),e._v(" "),i("h4",{attrs:{id:"i-attributesforfaceting"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#i-attributesforfaceting"}},[e._v("#")]),e._v(" I. attributesForFaceting")]),e._v(" "),i("p",[i("code",[e._v("attributesForFaceting")]),e._v(" is now used for declaring fields that could be filtered and given as facets.")]),e._v(" "),i("p",[e._v("Since faceting is also used to filter the search result by navigation, the idea is to highlight the filtering aspect in the name of the field.")]),e._v(" "),i("blockquote",[i("p",[e._v("Any fields declared in "),i("code",[e._v("attributesForFaceting")]),e._v(" for filtering can be faceted. Any fields declared in "),i("code",[e._v("attributesForFaceting")]),e._v(" for faceting can be filtered.")])]),e._v(" "),i("p",[i("code",[e._v("attributesForFaceting")]),e._v(" is lacking precision because it is now used to authorize the usage of those fields in "),i("code",[e._v("filter")]),e._v(" and "),i("code",[e._v("facetsDistribution")]),e._v(" parameters. Also, note that "),i("code",[e._v("facetFilters")]),e._v(" and "),i("code",[e._v("filters")]),e._v(" have been merged in "),i("a",{attrs:{href:"https://github.com/meilisearch/specifications/pull/27",target:"_blank",rel:"noopener noreferrer"}},[e._v("#27"),i("OutboundLink")],1),e._v(" to be "),i("code",[e._v("filter")]),e._v(".")]),e._v(" "),i("h3",{attrs:{id:"ii-filterableattributes"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#ii-filterableattributes"}},[e._v("#")]),e._v(" II. filterableAttributes")]),e._v(" "),i("p",[e._v("We are proposing "),i("code",[e._v("filterableAttributes")]),e._v(" as the new parameter name. This will be clearer since all the fields declared within it now allow you to refine the search results. The declared fields allow you to refine the query in two ways. The first allows you to use these in the "),i("code",[e._v("filter")]),e._v(" parameter. The second also enables the possibility of distributing the fields as a facet by using those in the "),i("code",[e._v("facetsDistribution")]),e._v(" parameter.")]),e._v(" "),i("p",[e._v("This way of naming this field is clearly saying that the expected parameter is an array of fields. Keeping the term faceting in the field name is something to be avoided as this field is not related only to faceting. The expected action behind that will remain the fact of activating filtering for these fields.")]),e._v(" "),i("blockquote",[i("p",[e._v("Faceting is a UI method of displaying document fields in a distributed fashion. Generally the final aim involves proposing a method of refining the research by interacting with the facets previously generated. Thus, filtering the search result.")])]),e._v(" "),i("p",[e._v("On a side note, the term "),i("code",[e._v("facetDistribution")]),e._v(" is a term used in e-commerce and we will therefore probably deal with this in a future specification.")]),e._v(" "),i("h3",{attrs:{id:"iii-impact-on-documentation"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#iii-impact-on-documentation"}},[e._v("#")]),e._v(" III. Impact on documentation")]),e._v(" "),i("p",[e._v("The documentation needs to replace occurences of "),i("code",[e._v("attributesForFaceting")]),e._v(" by "),i("code",[e._v("filterableAttributes")]),e._v(" "),i("a",{attrs:{href:"https://docs.meilisearch.com/reference/features/faceted_search.html#filters-or-facets",target:"_blank",rel:"noopener noreferrer"}},[e._v("here"),i("OutboundLink")],1),e._v(". Also, the documentation should mention that fields needs to be declared in "),i("code",[e._v("filterableAttributes")]),e._v(" to be used in the "),i("code",[e._v("filter")]),e._v(" query parameter "),i("a",{attrs:{href:"https://docs.meilisearch.com/reference/features/filtering.html#filtering",target:"_blank",rel:"noopener noreferrer"}},[e._v("here"),i("OutboundLink")],1),e._v(".")]),e._v(" "),i("h3",{attrs:{id:"iv-impact-on-sdks"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#iv-impact-on-sdks"}},[e._v("#")]),e._v(" IV. Impact on SDKs")]),e._v(" "),i("p",[e._v("N/A")]),e._v(" "),i("h2",{attrs:{id:"_2-technical-aspects"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_2-technical-aspects"}},[e._v("#")]),e._v(" 2. Technical Aspects")]),e._v(" "),i("p",[e._v("N/A")]),e._v(" "),i("h2",{attrs:{id:"_3-future-possibilities"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-future-possibilities"}},[e._v("#")]),e._v(" 3. Future possibilities")]),e._v(" "),i("p",[e._v("N/A")])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[20],{444:function(e,t,i){"use strict";i.r(t);var a=i(62),r=Object(a.a)({},(function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[i("ul",[i("li",[e._v("Title: Rename attributesForFaceting")]),e._v(" "),i("li",[e._v("Start Date: 2021-04-16")]),e._v(" "),i("li",[e._v("Specification PR: "),i("a",{attrs:{href:"https://github.com/meilisearch/specifications/pull/38",target:"_blank",rel:"noopener noreferrer"}},[e._v("#38"),i("OutboundLink")],1)]),e._v(" "),i("li",[e._v("MeiliSearch Tracking-Issues: "),i("a",{attrs:{href:"https://github.com/meilisearch/transplant/issues/187",target:"_blank",rel:"noopener noreferrer"}},[e._v("transplant/#187"),i("OutboundLink")],1)])]),e._v(" "),i("h1",{attrs:{id:"rename-attributesforfaceting"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#rename-attributesforfaceting"}},[e._v("#")]),e._v(" Rename attributesForFaceting")]),e._v(" "),i("h2",{attrs:{id:"_1-feature-description-and-interaction"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_1-feature-description-and-interaction"}},[e._v("#")]),e._v(" 1. Feature Description and Interaction")]),e._v(" "),i("h3",{attrs:{id:"i-summary-motivation"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#i-summary-motivation"}},[e._v("#")]),e._v(" I. Summary & Motivation")]),e._v(" "),i("p",[e._v("As the new engine requires filterable fields to be declared in attributesForFaceting, the name of this field is not as clear as we would like it to be. Since it’s now concerning filter and possible wanted facets on search result by the user.")]),e._v(" "),i("h3",{attrs:{id:"ii-additional-materials"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#ii-additional-materials"}},[e._v("#")]),e._v(" II. Additional Materials")]),e._v(" "),i("p",[e._v("N/A")]),e._v(" "),i("h3",{attrs:{id:"iii-explanation"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#iii-explanation"}},[e._v("#")]),e._v(" III.Explanation")]),e._v(" "),i("h4",{attrs:{id:"i-attributesforfaceting"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#i-attributesforfaceting"}},[e._v("#")]),e._v(" I. attributesForFaceting")]),e._v(" "),i("p",[i("code",[e._v("attributesForFaceting")]),e._v(" is now used for declaring fields that could be filtered and given as facets.")]),e._v(" "),i("p",[e._v("Since faceting is also used to filter the search result by navigation, the idea is to highlight the filtering aspect in the name of the field.")]),e._v(" "),i("blockquote",[i("p",[e._v("Any fields declared in "),i("code",[e._v("attributesForFaceting")]),e._v(" for filtering can be faceted. Any fields declared in "),i("code",[e._v("attributesForFaceting")]),e._v(" for faceting can be filtered.")])]),e._v(" "),i("p",[i("code",[e._v("attributesForFaceting")]),e._v(" is lacking precision because it is now used to authorize the usage of those fields in "),i("code",[e._v("filter")]),e._v(" and "),i("code",[e._v("facetsDistribution")]),e._v(" parameters. Also, note that "),i("code",[e._v("facetFilters")]),e._v(" and "),i("code",[e._v("filters")]),e._v(" have been merged in "),i("a",{attrs:{href:"https://github.com/meilisearch/specifications/pull/27",target:"_blank",rel:"noopener noreferrer"}},[e._v("#27"),i("OutboundLink")],1),e._v(" to be "),i("code",[e._v("filter")]),e._v(".")]),e._v(" "),i("h3",{attrs:{id:"ii-filterableattributes"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#ii-filterableattributes"}},[e._v("#")]),e._v(" II. filterableAttributes")]),e._v(" "),i("p",[e._v("We are proposing "),i("code",[e._v("filterableAttributes")]),e._v(" as the new parameter name. This will be clearer since all the fields declared within it now allow you to refine the search results. The declared fields allow you to refine the query in two ways. The first allows you to use these in the "),i("code",[e._v("filter")]),e._v(" parameter. The second also enables the possibility of distributing the fields as a facet by using those in the "),i("code",[e._v("facetsDistribution")]),e._v(" parameter.")]),e._v(" "),i("p",[e._v("This way of naming this field is clearly saying that the expected parameter is an array of fields. Keeping the term faceting in the field name is something to be avoided as this field is not related only to faceting. The expected action behind that will remain the fact of activating filtering for these fields.")]),e._v(" "),i("blockquote",[i("p",[e._v("Faceting is a UI method of displaying document fields in a distributed fashion. Generally the final aim involves proposing a method of refining the research by interacting with the facets previously generated. Thus, filtering the search result.")])]),e._v(" "),i("p",[e._v("On a side note, the term "),i("code",[e._v("facetDistribution")]),e._v(" is a term used in e-commerce and we will therefore probably deal with this in a future specification.")]),e._v(" "),i("h3",{attrs:{id:"iii-impact-on-documentation"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#iii-impact-on-documentation"}},[e._v("#")]),e._v(" III. Impact on documentation")]),e._v(" "),i("p",[e._v("The documentation needs to replace occurences of "),i("code",[e._v("attributesForFaceting")]),e._v(" by "),i("code",[e._v("filterableAttributes")]),e._v(" "),i("a",{attrs:{href:"https://docs.meilisearch.com/reference/features/faceted_search.html#filters-or-facets",target:"_blank",rel:"noopener noreferrer"}},[e._v("here"),i("OutboundLink")],1),e._v(". Also, the documentation should mention that fields needs to be declared in "),i("code",[e._v("filterableAttributes")]),e._v(" to be used in the "),i("code",[e._v("filter")]),e._v(" query parameter "),i("a",{attrs:{href:"https://docs.meilisearch.com/reference/features/filtering.html#filtering",target:"_blank",rel:"noopener noreferrer"}},[e._v("here"),i("OutboundLink")],1),e._v(".")]),e._v(" "),i("h3",{attrs:{id:"iv-impact-on-sdks"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#iv-impact-on-sdks"}},[e._v("#")]),e._v(" IV. Impact on SDKs")]),e._v(" "),i("p",[e._v("N/A")]),e._v(" "),i("h2",{attrs:{id:"_2-technical-aspects"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_2-technical-aspects"}},[e._v("#")]),e._v(" 2. Technical Aspects")]),e._v(" "),i("p",[e._v("N/A")]),e._v(" "),i("h2",{attrs:{id:"_3-future-possibilities"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-future-possibilities"}},[e._v("#")]),e._v(" 3. Future possibilities")]),e._v(" "),i("p",[e._v("N/A")])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file diff --git a/docs/assets/js/21.5d4e271d.js b/docs/assets/js/21.01b56736.js similarity index 99% rename from docs/assets/js/21.5d4e271d.js rename to docs/assets/js/21.01b56736.js index a691dfec2..6b3d5575d 100644 --- a/docs/assets/js/21.5d4e271d.js +++ b/docs/assets/js/21.01b56736.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[21],{444:function(e,t,a){"use strict";a.r(t);var s=a(62),r=Object(s.a)({},(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[a("ul",[a("li",[e._v("Title: Phrase Query")]),e._v(" "),a("li",[e._v("Start Date: 2021-06-02")]),e._v(" "),a("li",[e._v("Specification PR: "),a("a",{attrs:{href:"https://github.com/meilisearch/specifications/pull/43",target:"_blank",rel:"noopener noreferrer"}},[e._v("#43"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("MeiliSearch Tracking-Issues: "),a("a",{attrs:{href:"https://github.com/meilisearch/transplant/issues/198",target:"_blank",rel:"noopener noreferrer"}},[e._v("transplant/#198"),a("OutboundLink")],1)])]),e._v(" "),a("h1",{attrs:{id:"phrase-query"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#phrase-query"}},[e._v("#")]),e._v(" Phrase Query")]),e._v(" "),a("h2",{attrs:{id:"_1-feature-description-and-interaction"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-feature-description-and-interaction"}},[e._v("#")]),e._v(" 1. Feature Description and Interaction")]),e._v(" "),a("h3",{attrs:{id:"i-summary"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#i-summary"}},[e._v("#")]),e._v(" I. Summary")]),e._v(" "),a("p",[e._v("MeiliSearch does not allow users a way to write a strict query in order to ask the engine to be more strict in its selection of candidates for search results. The Phrase Query feature adds a simple syntax available to users to require the engine to select documents that strictly match some phrase, indicated by quotation marks. That is, without typography, n-gram, wordsplit, prefix, synonym, and, proximity. In addition, the expression of a Phrase Query is case insensitive.")]),e._v(" "),a("h3",{attrs:{id:"ii-motivation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#ii-motivation"}},[e._v("#")]),e._v(" II. Motivation")]),e._v(" "),a("p",[e._v("This feature is driven by the user's needs. Indeed, let's take some examples recently brought up in our community Slack.")]),e._v(" "),a("h4",{attrs:{id:"example-1"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#example-1"}},[e._v("#")]),e._v(" Example 1")]),e._v(" "),a("p",[e._v("The user wants to have a way to ensure that the words of his search are exactly contained in the order of the terms in the documents returned by MeiliSearch.")]),e._v(" "),a("h4",{attrs:{id:"example-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#example-2"}},[e._v("#")]),e._v(" Example 2")]),e._v(" "),a("p",[e._v("The user in question would like to be able to retrieve specifically the document containing the unique ISBN identifier and only that one. In a UX context of type as you search, this is impossible today without impacting the UI/UX or finding a workaround.")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("It could have had a specific search field only dedicated to this ISBN field in order to make it a filter and using the "),a("code",[e._v("=")]),e._v(" operator. Not great for the UX.")])]),e._v(" "),a("li",[a("p",[e._v("It could also have kept a single search field and detected that an ISBN was entered in the search field using a regex to inject that filter at that point. Not great for the developper experience, moreover, what happens when a pattern cannot be specifically determined?")])])]),e._v(" "),a("p",[e._v("The Phrase Query feature will easily solve the last case but will also adapt to the needs of the user performing the search.")]),e._v(" "),a("h3",{attrs:{id:"iii-additional-materials"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#iii-additional-materials"}},[e._v("#")]),e._v(" III. Additional Materials")]),e._v(" "),a("h4",{attrs:{id:"algolia"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#algolia"}},[e._v("#")]),e._v(" Algolia")]),e._v(" "),a("p",[e._v("Algolia allows the use of Phrase Query syntax as long as the "),a("code",[e._v("advancedSyntax")]),e._v(" parameter is set to true in the settings.")]),e._v(" "),a("p",[e._v('As Algolia documentation said, a phrase query represents a specific sequence of terms that must be matched next to one another and in the given order. A phrase query needs to be surrounded by double quotes ("). For example, the query "search engine" only returns a record if it contains “search engine” exactly in at least one attribute.')]),e._v(" "),a("h4",{attrs:{id:"elasticsearch"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#elasticsearch"}},[e._v("#")]),e._v(" Elasticsearch")]),e._v(" "),a("p",[e._v("Elasticsearch provides a "),a("code",[e._v("match_phrase")]),e._v(" field to perform this type of search.")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('GET /_search\n{\n "query": {\n "match_phrase": {\n "message": "this is a test"\n }\n }\n}\n')])])]),a("h3",{attrs:{id:"iv-explanation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#iv-explanation"}},[e._v("#")]),e._v(" IV. Explanation")]),e._v(" "),a("p",[e._v("Let's say I want to search for a specific book with a title strictly containing "),a("code",[e._v("Plays and Playwrights 2002")]),e._v(".")]),e._v(" "),a("p",[e._v("Using the standard query parameter syntax as "),a("code",[e._v("q")]),e._v(" equals to "),a("code",[e._v("Plays and Playwrights 2002")]),e._v(", will lead to have multiple search results because of the ranking rules criterions.")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "hits": [\n {\n "title": "Plays and Playwrights 2002",\n "author": "Martin Denton"\n },\n {\n "title": "Plays and Playwrights 2009",\n "author": "Martin Denton"\n },\n {\n "title": "Plays and Playwrights 2008",\n "author": "Robert Attweiler"\n },\n ...\n {\n "title": "The Best American Short Plays 2006-2007",\n "author": "Barbara Parisi"\n },\n {\n "title": "New Playwrights: The Best Plays of 2000",\n "author": "D. L. Lepidus"\n },\n {\n "title": "Women Heroes: Six Short Plays from the Women\'s Project",\n "author": "Julia Miles"\n }\n ],\n "nbHits": 31,\n "exhaustiveNbHits": false,\n "query": "Plays and Playwrights 2002",\n "limit": 20,\n "offset": 0,\n "processingTimeMs": 7\n}\n')])])]),a("h4",{attrs:{id:"phrase-query-usage"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#phrase-query-usage"}},[e._v("#")]),e._v(" Phrase Query usage")]),e._v(" "),a("p",[e._v("To use the Phrase Query syntax, simply surround the contiguous search terms with the characters "),a("code",[e._v('"')]),e._v(".")]),e._v(" "),a("p",[e._v("Using the Phrase Query syntax this way, with "),a("code",[e._v("q")]),e._v(" equals to "),a("code",[e._v('"Plays and Playwrights 2002"')]),e._v(", will lead to have only one result because the title is written exactly like that.")]),e._v(" "),a("blockquote",[a("p",[e._v("Note that it's case insensitive. So, if I search with "),a("code",[e._v('"plays and playwrights 2002"')]),e._v(", this will lead to the same result.")])]),e._v(" "),a("p",[e._v("The value between the "),a("code",[e._v('"')]),e._v(" operators will be searched without:")]),e._v(" "),a("ul",[a("li",[e._v("typography")]),e._v(" "),a("li",[e._v("n-gram")]),e._v(" "),a("li",[e._v("wordsplit")]),e._v(" "),a("li",[e._v("prefix")]),e._v(" "),a("li",[e._v("synonym")]),e._v(" "),a("li",[e._v("proximity")])]),e._v(" "),a("p",[e._v("Moreover, it ensures that all matching documents contain the words in the given order in the Phrase.")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "hits": [\n {\n "title": "Plays and Playwrights 2002",\n "author": "Martin Denton"\n }\n ],\n "nbHits": 1,\n "exhaustiveNbHits": false,\n "query": "\\"Plays and Playwrights 2002\\"",\n "limit": 20,\n "offset": 0,\n "processingTimeMs": 0\n}\n')])])]),a("p",[e._v("So now let's say that I want to search for a title that strictly includes the phrase "),a("code",[e._v('"African American"')]),e._v(" but speaking about poetry. The Phrase Query syntax can be used in conjunction with the basic syntax.")]),e._v(" "),a("p",[e._v("The query can be expressed like this: "),a("code",[e._v('"African American" poem')])]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "hits": [\n {\n "title": "100 Best African American Poems with CD",\n "author": "Nikki Giovanni"\n },\n {\n "title": "The African American Experience: Black History and Culture Through Speeches, Letters, Editorials, Poems, Songs, and Stories",\n "author": "Kai Wright"\n },\n {\n "title": "African American Literature (Penguin Academics Series)",\n "author": "Keith Gilyard"\n },\n {\n "title": "African-American Poetry: An Anthology, 1773-1930",\n "author": "Joan R. Sherman"\n },\n {\n "title": "African-American Literature: A Brief Introduction and Anthology",\n "author": "Al Young"\n },\n {\n "title": "Early African American Classics (Barnes & Noble Classics Series)",\n "author": "Barnes & Noble"\n },\n')])])]),a("p",[e._v("As you can see in the results, the presence or absence of one or more soft separators such as "),a("code",[e._v("-")]),e._v(", "),a("code",[e._v("_")]),e._v(", "),a("code",[e._v("\\")]),e._v(", "),a("code",[e._v(":")]),e._v(", "),a("code",[e._v("/")]),e._v(", "),a("code",[e._v("\\\\")]),e._v(", "),a("code",[e._v("@")]),e._v(", "),a("code",[e._v('"')]),e._v(", "),a("code",[e._v("+")]),e._v(", "),a("code",[e._v("~")]),e._v(", "),a("code",[e._v("=")]),e._v(", "),a("code",[e._v("^")]),e._v(", "),a("code",[e._v("*")]),e._v(", "),a("code",[e._v("#")]),e._v(" between two words does not affect the query match of the phrase and the document.")]),e._v(" "),a("h4",{attrs:{id:"multiple-phrase-query-usage"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#multiple-phrase-query-usage"}},[e._v("#")]),e._v(" Multiple Phrase Query usage")]),e._v(" "),a("p",[e._v("It is possible to use multiple phrase queries within a search.")]),e._v(" "),a("p",[e._v("E.g. "),a("code",[e._v('"African American" "Anthology"')])]),e._v(" "),a("p",[e._v("With this expression, the returned documents will contain exactly the existence of both phrase queries.")]),e._v(" "),a("h4",{attrs:{id:"know-limitations"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#know-limitations"}},[e._v("#")]),e._v(" Know limitations")]),e._v(" "),a("h5",{attrs:{id:"case-sensivity"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#case-sensivity"}},[e._v("#")]),e._v(" Case Sensivity")]),e._v(" "),a("p",[e._v("The Phrase Query syntax is case insensitive.")]),e._v(" "),a("h5",{attrs:{id:"multiple-hard-separator-case"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#multiple-hard-separator-case"}},[e._v("#")]),e._v(" Multiple hard separator case")]),e._v(" "),a("p",[e._v("Given a document containing "),a("code",[e._v("David.- .- .- .- .-Bowie")]),e._v(" as value for an attribute.")]),e._v(" "),a("p",[e._v("This document can be matched using a phrase query such as "),a("code",[e._v('"David" "Bowie"')]),e._v(" or "),a("code",[e._v('"David.Bowie"')]),e._v(". At the engine level, this is the same query. The latter is translated into the former phrase because the "),a("code",[e._v(".")]),e._v(" character is a hard separator. This behavior comes from the default tokenizer, hard separators are seen as a marker for a different context or phrase.")]),e._v(" "),a("p",[e._v("Here is the list of hard separators in the default tokenizer: "),a("code",[e._v(".")]),e._v(", "),a("code",[e._v(";")]),e._v(", "),a("code",[e._v(",")]),e._v(", "),a("code",[e._v("!")]),e._v(", "),a("code",[e._v("?")]),e._v(", "),a("code",[e._v("(")]),e._v(", "),a("code",[e._v(")")]),e._v(", "),a("code",[e._v("[")]),e._v(", "),a("code",[e._v("]")]),e._v(", "),a("code",[e._v("{")]),e._v(", "),a("code",[e._v("}")]),e._v(", "),a("code",[e._v("|")])]),e._v(" "),a("p",[e._v("Multiple hard separator are treaten the same as if they were one. So "),a("code",[e._v('"David.-.-.-.Bowie"')]),e._v(" will not work to match the document.")]),e._v(" "),a("h3",{attrs:{id:"v-impact-on-documentation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#v-impact-on-documentation"}},[e._v("#")]),e._v(" V. Impact on Documentation")]),e._v(" "),a("ul",[a("li",[e._v("Mention that new Phrase Query syntax in the documentation. Can it be on a dedicated page or on "),a("a",{attrs:{href:"https://docs.meilisearch.com/reference/features/search_parameters.html#query-q",target:"_blank",rel:"noopener noreferrer"}},[e._v("the q search parameter"),a("OutboundLink")],1),e._v("?")])]),e._v(" "),a("h3",{attrs:{id:"vi-impact-on-sdks"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#vi-impact-on-sdks"}},[e._v("#")]),e._v(" VI. Impact on SDKs")]),e._v(" "),a("p",[e._v("N/A")]),e._v(" "),a("h2",{attrs:{id:"_2-technical-aspects"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-technical-aspects"}},[e._v("#")]),e._v(" 2. Technical Aspects")]),e._v(" "),a("p",[e._v("N/A")]),e._v(" "),a("h2",{attrs:{id:"_3-future-possibilities"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-future-possibilities"}},[e._v("#")]),e._v(" 3. Future Possibilities")]),e._v(" "),a("p",[e._v("N/A")])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[21],{445:function(e,t,a){"use strict";a.r(t);var s=a(62),r=Object(s.a)({},(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[a("ul",[a("li",[e._v("Title: Phrase Query")]),e._v(" "),a("li",[e._v("Start Date: 2021-06-02")]),e._v(" "),a("li",[e._v("Specification PR: "),a("a",{attrs:{href:"https://github.com/meilisearch/specifications/pull/43",target:"_blank",rel:"noopener noreferrer"}},[e._v("#43"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("MeiliSearch Tracking-Issues: "),a("a",{attrs:{href:"https://github.com/meilisearch/transplant/issues/198",target:"_blank",rel:"noopener noreferrer"}},[e._v("transplant/#198"),a("OutboundLink")],1)])]),e._v(" "),a("h1",{attrs:{id:"phrase-query"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#phrase-query"}},[e._v("#")]),e._v(" Phrase Query")]),e._v(" "),a("h2",{attrs:{id:"_1-feature-description-and-interaction"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-feature-description-and-interaction"}},[e._v("#")]),e._v(" 1. Feature Description and Interaction")]),e._v(" "),a("h3",{attrs:{id:"i-summary"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#i-summary"}},[e._v("#")]),e._v(" I. Summary")]),e._v(" "),a("p",[e._v("MeiliSearch does not allow users a way to write a strict query in order to ask the engine to be more strict in its selection of candidates for search results. The Phrase Query feature adds a simple syntax available to users to require the engine to select documents that strictly match some phrase, indicated by quotation marks. That is, without typography, n-gram, wordsplit, prefix, synonym, and, proximity. In addition, the expression of a Phrase Query is case insensitive.")]),e._v(" "),a("h3",{attrs:{id:"ii-motivation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#ii-motivation"}},[e._v("#")]),e._v(" II. Motivation")]),e._v(" "),a("p",[e._v("This feature is driven by the user's needs. Indeed, let's take some examples recently brought up in our community Slack.")]),e._v(" "),a("h4",{attrs:{id:"example-1"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#example-1"}},[e._v("#")]),e._v(" Example 1")]),e._v(" "),a("p",[e._v("The user wants to have a way to ensure that the words of his search are exactly contained in the order of the terms in the documents returned by MeiliSearch.")]),e._v(" "),a("h4",{attrs:{id:"example-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#example-2"}},[e._v("#")]),e._v(" Example 2")]),e._v(" "),a("p",[e._v("The user in question would like to be able to retrieve specifically the document containing the unique ISBN identifier and only that one. In a UX context of type as you search, this is impossible today without impacting the UI/UX or finding a workaround.")]),e._v(" "),a("ul",[a("li",[a("p",[e._v("It could have had a specific search field only dedicated to this ISBN field in order to make it a filter and using the "),a("code",[e._v("=")]),e._v(" operator. Not great for the UX.")])]),e._v(" "),a("li",[a("p",[e._v("It could also have kept a single search field and detected that an ISBN was entered in the search field using a regex to inject that filter at that point. Not great for the developper experience, moreover, what happens when a pattern cannot be specifically determined?")])])]),e._v(" "),a("p",[e._v("The Phrase Query feature will easily solve the last case but will also adapt to the needs of the user performing the search.")]),e._v(" "),a("h3",{attrs:{id:"iii-additional-materials"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#iii-additional-materials"}},[e._v("#")]),e._v(" III. Additional Materials")]),e._v(" "),a("h4",{attrs:{id:"algolia"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#algolia"}},[e._v("#")]),e._v(" Algolia")]),e._v(" "),a("p",[e._v("Algolia allows the use of Phrase Query syntax as long as the "),a("code",[e._v("advancedSyntax")]),e._v(" parameter is set to true in the settings.")]),e._v(" "),a("p",[e._v('As Algolia documentation said, a phrase query represents a specific sequence of terms that must be matched next to one another and in the given order. A phrase query needs to be surrounded by double quotes ("). For example, the query "search engine" only returns a record if it contains “search engine” exactly in at least one attribute.')]),e._v(" "),a("h4",{attrs:{id:"elasticsearch"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#elasticsearch"}},[e._v("#")]),e._v(" Elasticsearch")]),e._v(" "),a("p",[e._v("Elasticsearch provides a "),a("code",[e._v("match_phrase")]),e._v(" field to perform this type of search.")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('GET /_search\n{\n "query": {\n "match_phrase": {\n "message": "this is a test"\n }\n }\n}\n')])])]),a("h3",{attrs:{id:"iv-explanation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#iv-explanation"}},[e._v("#")]),e._v(" IV. Explanation")]),e._v(" "),a("p",[e._v("Let's say I want to search for a specific book with a title strictly containing "),a("code",[e._v("Plays and Playwrights 2002")]),e._v(".")]),e._v(" "),a("p",[e._v("Using the standard query parameter syntax as "),a("code",[e._v("q")]),e._v(" equals to "),a("code",[e._v("Plays and Playwrights 2002")]),e._v(", will lead to have multiple search results because of the ranking rules criterions.")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "hits": [\n {\n "title": "Plays and Playwrights 2002",\n "author": "Martin Denton"\n },\n {\n "title": "Plays and Playwrights 2009",\n "author": "Martin Denton"\n },\n {\n "title": "Plays and Playwrights 2008",\n "author": "Robert Attweiler"\n },\n ...\n {\n "title": "The Best American Short Plays 2006-2007",\n "author": "Barbara Parisi"\n },\n {\n "title": "New Playwrights: The Best Plays of 2000",\n "author": "D. L. Lepidus"\n },\n {\n "title": "Women Heroes: Six Short Plays from the Women\'s Project",\n "author": "Julia Miles"\n }\n ],\n "nbHits": 31,\n "exhaustiveNbHits": false,\n "query": "Plays and Playwrights 2002",\n "limit": 20,\n "offset": 0,\n "processingTimeMs": 7\n}\n')])])]),a("h4",{attrs:{id:"phrase-query-usage"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#phrase-query-usage"}},[e._v("#")]),e._v(" Phrase Query usage")]),e._v(" "),a("p",[e._v("To use the Phrase Query syntax, simply surround the contiguous search terms with the characters "),a("code",[e._v('"')]),e._v(".")]),e._v(" "),a("p",[e._v("Using the Phrase Query syntax this way, with "),a("code",[e._v("q")]),e._v(" equals to "),a("code",[e._v('"Plays and Playwrights 2002"')]),e._v(", will lead to have only one result because the title is written exactly like that.")]),e._v(" "),a("blockquote",[a("p",[e._v("Note that it's case insensitive. So, if I search with "),a("code",[e._v('"plays and playwrights 2002"')]),e._v(", this will lead to the same result.")])]),e._v(" "),a("p",[e._v("The value between the "),a("code",[e._v('"')]),e._v(" operators will be searched without:")]),e._v(" "),a("ul",[a("li",[e._v("typography")]),e._v(" "),a("li",[e._v("n-gram")]),e._v(" "),a("li",[e._v("wordsplit")]),e._v(" "),a("li",[e._v("prefix")]),e._v(" "),a("li",[e._v("synonym")]),e._v(" "),a("li",[e._v("proximity")])]),e._v(" "),a("p",[e._v("Moreover, it ensures that all matching documents contain the words in the given order in the Phrase.")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "hits": [\n {\n "title": "Plays and Playwrights 2002",\n "author": "Martin Denton"\n }\n ],\n "nbHits": 1,\n "exhaustiveNbHits": false,\n "query": "\\"Plays and Playwrights 2002\\"",\n "limit": 20,\n "offset": 0,\n "processingTimeMs": 0\n}\n')])])]),a("p",[e._v("So now let's say that I want to search for a title that strictly includes the phrase "),a("code",[e._v('"African American"')]),e._v(" but speaking about poetry. The Phrase Query syntax can be used in conjunction with the basic syntax.")]),e._v(" "),a("p",[e._v("The query can be expressed like this: "),a("code",[e._v('"African American" poem')])]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "hits": [\n {\n "title": "100 Best African American Poems with CD",\n "author": "Nikki Giovanni"\n },\n {\n "title": "The African American Experience: Black History and Culture Through Speeches, Letters, Editorials, Poems, Songs, and Stories",\n "author": "Kai Wright"\n },\n {\n "title": "African American Literature (Penguin Academics Series)",\n "author": "Keith Gilyard"\n },\n {\n "title": "African-American Poetry: An Anthology, 1773-1930",\n "author": "Joan R. Sherman"\n },\n {\n "title": "African-American Literature: A Brief Introduction and Anthology",\n "author": "Al Young"\n },\n {\n "title": "Early African American Classics (Barnes & Noble Classics Series)",\n "author": "Barnes & Noble"\n },\n')])])]),a("p",[e._v("As you can see in the results, the presence or absence of one or more soft separators such as "),a("code",[e._v("-")]),e._v(", "),a("code",[e._v("_")]),e._v(", "),a("code",[e._v("\\")]),e._v(", "),a("code",[e._v(":")]),e._v(", "),a("code",[e._v("/")]),e._v(", "),a("code",[e._v("\\\\")]),e._v(", "),a("code",[e._v("@")]),e._v(", "),a("code",[e._v('"')]),e._v(", "),a("code",[e._v("+")]),e._v(", "),a("code",[e._v("~")]),e._v(", "),a("code",[e._v("=")]),e._v(", "),a("code",[e._v("^")]),e._v(", "),a("code",[e._v("*")]),e._v(", "),a("code",[e._v("#")]),e._v(" between two words does not affect the query match of the phrase and the document.")]),e._v(" "),a("h4",{attrs:{id:"multiple-phrase-query-usage"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#multiple-phrase-query-usage"}},[e._v("#")]),e._v(" Multiple Phrase Query usage")]),e._v(" "),a("p",[e._v("It is possible to use multiple phrase queries within a search.")]),e._v(" "),a("p",[e._v("E.g. "),a("code",[e._v('"African American" "Anthology"')])]),e._v(" "),a("p",[e._v("With this expression, the returned documents will contain exactly the existence of both phrase queries.")]),e._v(" "),a("h4",{attrs:{id:"know-limitations"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#know-limitations"}},[e._v("#")]),e._v(" Know limitations")]),e._v(" "),a("h5",{attrs:{id:"case-sensivity"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#case-sensivity"}},[e._v("#")]),e._v(" Case Sensivity")]),e._v(" "),a("p",[e._v("The Phrase Query syntax is case insensitive.")]),e._v(" "),a("h5",{attrs:{id:"multiple-hard-separator-case"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#multiple-hard-separator-case"}},[e._v("#")]),e._v(" Multiple hard separator case")]),e._v(" "),a("p",[e._v("Given a document containing "),a("code",[e._v("David.- .- .- .- .-Bowie")]),e._v(" as value for an attribute.")]),e._v(" "),a("p",[e._v("This document can be matched using a phrase query such as "),a("code",[e._v('"David" "Bowie"')]),e._v(" or "),a("code",[e._v('"David.Bowie"')]),e._v(". At the engine level, this is the same query. The latter is translated into the former phrase because the "),a("code",[e._v(".")]),e._v(" character is a hard separator. This behavior comes from the default tokenizer, hard separators are seen as a marker for a different context or phrase.")]),e._v(" "),a("p",[e._v("Here is the list of hard separators in the default tokenizer: "),a("code",[e._v(".")]),e._v(", "),a("code",[e._v(";")]),e._v(", "),a("code",[e._v(",")]),e._v(", "),a("code",[e._v("!")]),e._v(", "),a("code",[e._v("?")]),e._v(", "),a("code",[e._v("(")]),e._v(", "),a("code",[e._v(")")]),e._v(", "),a("code",[e._v("[")]),e._v(", "),a("code",[e._v("]")]),e._v(", "),a("code",[e._v("{")]),e._v(", "),a("code",[e._v("}")]),e._v(", "),a("code",[e._v("|")])]),e._v(" "),a("p",[e._v("Multiple hard separator are treaten the same as if they were one. So "),a("code",[e._v('"David.-.-.-.Bowie"')]),e._v(" will not work to match the document.")]),e._v(" "),a("h3",{attrs:{id:"v-impact-on-documentation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#v-impact-on-documentation"}},[e._v("#")]),e._v(" V. Impact on Documentation")]),e._v(" "),a("ul",[a("li",[e._v("Mention that new Phrase Query syntax in the documentation. Can it be on a dedicated page or on "),a("a",{attrs:{href:"https://docs.meilisearch.com/reference/features/search_parameters.html#query-q",target:"_blank",rel:"noopener noreferrer"}},[e._v("the q search parameter"),a("OutboundLink")],1),e._v("?")])]),e._v(" "),a("h3",{attrs:{id:"vi-impact-on-sdks"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#vi-impact-on-sdks"}},[e._v("#")]),e._v(" VI. Impact on SDKs")]),e._v(" "),a("p",[e._v("N/A")]),e._v(" "),a("h2",{attrs:{id:"_2-technical-aspects"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-technical-aspects"}},[e._v("#")]),e._v(" 2. Technical Aspects")]),e._v(" "),a("p",[e._v("N/A")]),e._v(" "),a("h2",{attrs:{id:"_3-future-possibilities"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-future-possibilities"}},[e._v("#")]),e._v(" 3. Future Possibilities")]),e._v(" "),a("p",[e._v("N/A")])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file diff --git a/docs/assets/js/22.9d7baf38.js b/docs/assets/js/22.a9f2f84c.js similarity index 98% rename from docs/assets/js/22.9d7baf38.js rename to docs/assets/js/22.a9f2f84c.js index d579d4247..3de72a44b 100644 --- a/docs/assets/js/22.9d7baf38.js +++ b/docs/assets/js/22.a9f2f84c.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[22],{446:function(t,e,a){"use strict";a.r(e);var s=a(62),n=Object(s.a)({},(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("ul",[a("li",[t._v("Title: Reset Stop-words and Synonyms settings with null value")]),t._v(" "),a("li",[t._v("Start Date: 2021-06-08")]),t._v(" "),a("li",[t._v("Specification PR: "),a("a",{attrs:{href:"https://github.com/meilisearch/specifications/pull/47",target:"_blank",rel:"noopener noreferrer"}},[t._v("#47"),a("OutboundLink")],1)]),t._v(" "),a("li",[t._v("MeiliSearch Tracking-issues: "),a("a",{attrs:{href:"https://github.com/meilisearch/transplant/issues/217",target:"_blank",rel:"noopener noreferrer"}},[t._v("transplant/#217"),a("OutboundLink")],1)])]),t._v(" "),a("h1",{attrs:{id:"reset-stop-words-and-synonyms-settings-with-a-null-value"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#reset-stop-words-and-synonyms-settings-with-a-null-value"}},[t._v("#")]),t._v(" Reset Stop-words and Synonyms settings with a null value.")]),t._v(" "),a("h2",{attrs:{id:"_1-functional-specification"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-functional-specification"}},[t._v("#")]),t._v(" 1. Functional Specification")]),t._v(" "),a("h3",{attrs:{id:"i-summary"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#i-summary"}},[t._v("#")]),t._v(" I. Summary")]),t._v(" "),a("p",[t._v("All Sub Settings "),a("code",[t._v("POST")]),t._v(" endpoint accepts a null value in the http request body to reset the engine configuration to the default values. This is not the case for "),a("a",{attrs:{href:"https://docs.meilisearch.com/reference/api/stop_words.html#update-stop-words",target:"_blank",rel:"noopener noreferrer"}},[t._v("Stop-words"),a("OutboundLink")],1),t._v(" and "),a("a",{attrs:{href:"https://docs.meilisearch.com/reference/api/synonyms.html#update-synonyms",target:"_blank",rel:"noopener noreferrer"}},[t._v("Synonyms"),a("OutboundLink")],1),t._v(" settings endpoints.")]),t._v(" "),a("h3",{attrs:{id:"ii-motivation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#ii-motivation"}},[t._v("#")]),t._v(" II. Motivation")]),t._v(" "),a("p",[t._v("This specification is written to make the above mentioned routes consistent with the others.")]),t._v(" "),a("h3",{attrs:{id:"iii-additional-materials"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#iii-additional-materials"}},[t._v("#")]),t._v(" III. Additional Materials")]),t._v(" "),a("p",[t._v("N/A")]),t._v(" "),a("h3",{attrs:{id:"iv-explanation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#iv-explanation"}},[t._v("#")]),t._v(" IV. Explanation")]),t._v(" "),a("h4",{attrs:{id:"example"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#example"}},[t._v("#")]),t._v(" Example")]),t._v(" "),a("p",[t._v("E.g. Reset Stop-Words setting with a null value on "),a("a",{attrs:{href:"https://docs.meilisearch.com/reference/api/stop_words.html#update-stop-words",target:"_blank",rel:"noopener noreferrer"}},[t._v("POST Stop-Words Endpoint"),a("OutboundLink")],1)]),t._v(" "),a("p",[t._v("Given this stop-words configuration")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('[\n "of",\n "the"\n]\n')])])]),a("p",[t._v("As a User I send")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("null\n")])])]),a("p",[t._v("To Expect")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("[]\n")])])]),a("h4",{attrs:{id:"post-stop-words-endpoint"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#post-stop-words-endpoint"}},[t._v("#")]),t._v(" "),a("a",{attrs:{href:"https://docs.meilisearch.com/reference/api/stop_words.html#update-stop-words",target:"_blank",rel:"noopener noreferrer"}},[t._v("POST Stop-Words Endpoint"),a("OutboundLink")],1)]),t._v(" "),a("p",[t._v("Sending a "),a("code",[t._v("null")]),t._v(" value in the request body like the given request body above should reset the "),a("code",[t._v("Stop-Words")]),t._v(" setting to the engine default values.")]),t._v(" "),a("p",[t._v("The default value for "),a("code",[t._v("Stop-Words")]),t._v(" is an empty array.")]),t._v(" "),a("h4",{attrs:{id:"post-synonyms-endpoint"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#post-synonyms-endpoint"}},[t._v("#")]),t._v(" "),a("a",{attrs:{href:"https://docs.meilisearch.com/reference/api/synonyms.html#update-synonyms",target:"_blank",rel:"noopener noreferrer"}},[t._v("POST Synonyms Endpoint"),a("OutboundLink")],1)]),t._v(" "),a("p",[t._v("Sending a "),a("code",[t._v("null")]),t._v(" value in the request body like the given request body above should reset the "),a("code",[t._v("Synonyms")]),t._v(" setting to the engine default values.")]),t._v(" "),a("p",[t._v("The default value for "),a("code",[t._v("Synonyms")]),t._v(" is an empty object.")]),t._v(" "),a("h3",{attrs:{id:"v-impact-on-documentation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#v-impact-on-documentation"}},[t._v("#")]),t._v(" V. Impact on Documentation")]),t._v(" "),a("p",[t._v("N/A")]),t._v(" "),a("h3",{attrs:{id:"vi-impact-on-sdks"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#vi-impact-on-sdks"}},[t._v("#")]),t._v(" VI. Impact on SDKs")]),t._v(" "),a("p",[t._v("The SDKs must allow the "),a("code",[t._v("null")]),t._v(" value for every setting.")]),t._v(" "),a("h2",{attrs:{id:"_2-technical-aspects"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-technical-aspects"}},[t._v("#")]),t._v(" 2. Technical Aspects")]),t._v(" "),a("h2",{attrs:{id:"_3-future-possibilities"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-future-possibilities"}},[t._v("#")]),t._v(" 3. Future Possibilities")])])}),[],!1,null,null,null);e.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[22],{448:function(t,e,a){"use strict";a.r(e);var s=a(62),n=Object(s.a)({},(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("ul",[a("li",[t._v("Title: Reset Stop-words and Synonyms settings with null value")]),t._v(" "),a("li",[t._v("Start Date: 2021-06-08")]),t._v(" "),a("li",[t._v("Specification PR: "),a("a",{attrs:{href:"https://github.com/meilisearch/specifications/pull/47",target:"_blank",rel:"noopener noreferrer"}},[t._v("#47"),a("OutboundLink")],1)]),t._v(" "),a("li",[t._v("MeiliSearch Tracking-issues: "),a("a",{attrs:{href:"https://github.com/meilisearch/transplant/issues/217",target:"_blank",rel:"noopener noreferrer"}},[t._v("transplant/#217"),a("OutboundLink")],1)])]),t._v(" "),a("h1",{attrs:{id:"reset-stop-words-and-synonyms-settings-with-a-null-value"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#reset-stop-words-and-synonyms-settings-with-a-null-value"}},[t._v("#")]),t._v(" Reset Stop-words and Synonyms settings with a null value.")]),t._v(" "),a("h2",{attrs:{id:"_1-functional-specification"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-functional-specification"}},[t._v("#")]),t._v(" 1. Functional Specification")]),t._v(" "),a("h3",{attrs:{id:"i-summary"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#i-summary"}},[t._v("#")]),t._v(" I. Summary")]),t._v(" "),a("p",[t._v("All Sub Settings "),a("code",[t._v("POST")]),t._v(" endpoint accepts a null value in the http request body to reset the engine configuration to the default values. This is not the case for "),a("a",{attrs:{href:"https://docs.meilisearch.com/reference/api/stop_words.html#update-stop-words",target:"_blank",rel:"noopener noreferrer"}},[t._v("Stop-words"),a("OutboundLink")],1),t._v(" and "),a("a",{attrs:{href:"https://docs.meilisearch.com/reference/api/synonyms.html#update-synonyms",target:"_blank",rel:"noopener noreferrer"}},[t._v("Synonyms"),a("OutboundLink")],1),t._v(" settings endpoints.")]),t._v(" "),a("h3",{attrs:{id:"ii-motivation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#ii-motivation"}},[t._v("#")]),t._v(" II. Motivation")]),t._v(" "),a("p",[t._v("This specification is written to make the above mentioned routes consistent with the others.")]),t._v(" "),a("h3",{attrs:{id:"iii-additional-materials"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#iii-additional-materials"}},[t._v("#")]),t._v(" III. Additional Materials")]),t._v(" "),a("p",[t._v("N/A")]),t._v(" "),a("h3",{attrs:{id:"iv-explanation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#iv-explanation"}},[t._v("#")]),t._v(" IV. Explanation")]),t._v(" "),a("h4",{attrs:{id:"example"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#example"}},[t._v("#")]),t._v(" Example")]),t._v(" "),a("p",[t._v("E.g. Reset Stop-Words setting with a null value on "),a("a",{attrs:{href:"https://docs.meilisearch.com/reference/api/stop_words.html#update-stop-words",target:"_blank",rel:"noopener noreferrer"}},[t._v("POST Stop-Words Endpoint"),a("OutboundLink")],1)]),t._v(" "),a("p",[t._v("Given this stop-words configuration")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v('[\n "of",\n "the"\n]\n')])])]),a("p",[t._v("As a User I send")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("null\n")])])]),a("p",[t._v("To Expect")]),t._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[t._v("[]\n")])])]),a("h4",{attrs:{id:"post-stop-words-endpoint"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#post-stop-words-endpoint"}},[t._v("#")]),t._v(" "),a("a",{attrs:{href:"https://docs.meilisearch.com/reference/api/stop_words.html#update-stop-words",target:"_blank",rel:"noopener noreferrer"}},[t._v("POST Stop-Words Endpoint"),a("OutboundLink")],1)]),t._v(" "),a("p",[t._v("Sending a "),a("code",[t._v("null")]),t._v(" value in the request body like the given request body above should reset the "),a("code",[t._v("Stop-Words")]),t._v(" setting to the engine default values.")]),t._v(" "),a("p",[t._v("The default value for "),a("code",[t._v("Stop-Words")]),t._v(" is an empty array.")]),t._v(" "),a("h4",{attrs:{id:"post-synonyms-endpoint"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#post-synonyms-endpoint"}},[t._v("#")]),t._v(" "),a("a",{attrs:{href:"https://docs.meilisearch.com/reference/api/synonyms.html#update-synonyms",target:"_blank",rel:"noopener noreferrer"}},[t._v("POST Synonyms Endpoint"),a("OutboundLink")],1)]),t._v(" "),a("p",[t._v("Sending a "),a("code",[t._v("null")]),t._v(" value in the request body like the given request body above should reset the "),a("code",[t._v("Synonyms")]),t._v(" setting to the engine default values.")]),t._v(" "),a("p",[t._v("The default value for "),a("code",[t._v("Synonyms")]),t._v(" is an empty object.")]),t._v(" "),a("h3",{attrs:{id:"v-impact-on-documentation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#v-impact-on-documentation"}},[t._v("#")]),t._v(" V. Impact on Documentation")]),t._v(" "),a("p",[t._v("N/A")]),t._v(" "),a("h3",{attrs:{id:"vi-impact-on-sdks"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#vi-impact-on-sdks"}},[t._v("#")]),t._v(" VI. Impact on SDKs")]),t._v(" "),a("p",[t._v("The SDKs must allow the "),a("code",[t._v("null")]),t._v(" value for every setting.")]),t._v(" "),a("h2",{attrs:{id:"_2-technical-aspects"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-technical-aspects"}},[t._v("#")]),t._v(" 2. Technical Aspects")]),t._v(" "),a("h2",{attrs:{id:"_3-future-possibilities"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-future-possibilities"}},[t._v("#")]),t._v(" 3. Future Possibilities")])])}),[],!1,null,null,null);e.default=n.exports}}]); \ No newline at end of file diff --git a/docs/assets/js/23.06e68601.js b/docs/assets/js/23.582f3200.js similarity index 97% rename from docs/assets/js/23.06e68601.js rename to docs/assets/js/23.582f3200.js index 2f39cc53d..8f77059f1 100644 --- a/docs/assets/js/23.06e68601.js +++ b/docs/assets/js/23.582f3200.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[23],{447:function(a,t,e){"use strict";e.r(t);var i=e(62),n=Object(i.a)({},(function(){var a=this,t=a.$createElement,e=a._self._c||t;return e("ContentSlotsDistributor",{attrs:{"slot-key":a.$parent.slotKey}},[e("ul",[e("li",[a._v("Title: Rename MEILI_MAX_MDB_SIZE env var and --max-mdb-size option flag")]),a._v(" "),e("li",[a._v("Start Date: 2021-04-14")]),a._v(" "),e("li",[a._v("Specification PR: "),e("a",{attrs:{href:"https://github.com/meilisearch/specifications/pull/48",target:"_blank",rel:"noopener noreferrer"}},[a._v("#48"),e("OutboundLink")],1)]),a._v(" "),e("li",[a._v("MeiliSearch Tracking-issues: "),e("a",{attrs:{href:"https://github.com/meilisearch/transplant/issues/206",target:"_blank",rel:"noopener noreferrer"}},[a._v("transplant/#206"),e("OutboundLink")],1)])]),a._v(" "),e("h1",{attrs:{id:"rename-meili-max-mdb-size-env-var-and-max-mdb-size-option-flag"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#rename-meili-max-mdb-size-env-var-and-max-mdb-size-option-flag"}},[a._v("#")]),a._v(" Rename MEILI_MAX_MDB_SIZE env var and --max-mdb-size option flag")]),a._v(" "),e("h2",{attrs:{id:"_1-functional-specification"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-functional-specification"}},[a._v("#")]),a._v(" 1. Functional Specification")]),a._v(" "),e("h3",{attrs:{id:"i-summary"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#i-summary"}},[a._v("#")]),a._v(" I. Summary")]),a._v(" "),e("p",[a._v("This specification is written to rename the "),e("code",[a._v("MEILI_MAX_MDB_SIZE")]),a._v(" environnement variable and "),e("code",[a._v("--max-mdb-size")]),a._v(" option flag to "),e("code",[a._v("MEILI_MAX_INDEX_SIZE")]),a._v(" and "),e("code",[a._v("--max-index-size")]),a._v(".")]),a._v(" "),e("h3",{attrs:{id:"ii-motivation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#ii-motivation"}},[a._v("#")]),a._v(" II. Motivation")]),a._v(" "),e("p",[a._v("Since version 0.21 no longer has a main LMDB database for all indexes but one LMBD database per index, the concept of a "),e("code",[a._v("main")]),a._v(" database no longer exists internally.")]),a._v(" "),e("h3",{attrs:{id:"iii-additional-materials"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#iii-additional-materials"}},[a._v("#")]),a._v(" III. Additional Materials")]),a._v(" "),e("p",[a._v("N/A")]),a._v(" "),e("h3",{attrs:{id:"iv-explanation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#iv-explanation"}},[a._v("#")]),a._v(" IV. Explanation")]),a._v(" "),e("ul",[e("li",[a._v("Rename "),e("code",[a._v("--max-mdb-size")]),a._v(" to "),e("code",[a._v("--max-index-size")])]),a._v(" "),e("li",[a._v("Rename "),e("code",[a._v("MEILI_MAX_MDB_SIZE")]),a._v(" to "),e("code",[a._v("MEILI_MAX_INDEX_SIZE")])])]),a._v(" "),e("h3",{attrs:{id:"v-impact-on-documentation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#v-impact-on-documentation"}},[a._v("#")]),a._v(" V. Impact on Documentation")]),a._v(" "),e("ul",[e("li",[a._v("Update the "),e("a",{attrs:{href:"https://docs.meilisearch.com/reference/features/configuration.html#max-mdb-size",target:"_blank",rel:"noopener noreferrer"}},[a._v("Max MDB Size documentation part"),e("OutboundLink")],1),a._v(".")])]),a._v(" "),e("h3",{attrs:{id:"vi-impact-on-sdks"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#vi-impact-on-sdks"}},[a._v("#")]),a._v(" VI. Impact on SDKs")]),a._v(" "),e("p",[a._v("N/A")]),a._v(" "),e("h2",{attrs:{id:"_2-technical-aspects"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-technical-aspects"}},[a._v("#")]),a._v(" 2. Technical Aspects")]),a._v(" "),e("p",[a._v("N/A")]),a._v(" "),e("h2",{attrs:{id:"_3-future-possibilities"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-future-possibilities"}},[a._v("#")]),a._v(" 3. Future Possibilities")]),a._v(" "),e("ul",[e("li",[a._v("Provide a way to set a custom size per index.")])])])}),[],!1,null,null,null);t.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[23],{446:function(a,t,e){"use strict";e.r(t);var i=e(62),n=Object(i.a)({},(function(){var a=this,t=a.$createElement,e=a._self._c||t;return e("ContentSlotsDistributor",{attrs:{"slot-key":a.$parent.slotKey}},[e("ul",[e("li",[a._v("Title: Rename MEILI_MAX_MDB_SIZE env var and --max-mdb-size option flag")]),a._v(" "),e("li",[a._v("Start Date: 2021-04-14")]),a._v(" "),e("li",[a._v("Specification PR: "),e("a",{attrs:{href:"https://github.com/meilisearch/specifications/pull/48",target:"_blank",rel:"noopener noreferrer"}},[a._v("#48"),e("OutboundLink")],1)]),a._v(" "),e("li",[a._v("MeiliSearch Tracking-issues: "),e("a",{attrs:{href:"https://github.com/meilisearch/transplant/issues/206",target:"_blank",rel:"noopener noreferrer"}},[a._v("transplant/#206"),e("OutboundLink")],1)])]),a._v(" "),e("h1",{attrs:{id:"rename-meili-max-mdb-size-env-var-and-max-mdb-size-option-flag"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#rename-meili-max-mdb-size-env-var-and-max-mdb-size-option-flag"}},[a._v("#")]),a._v(" Rename MEILI_MAX_MDB_SIZE env var and --max-mdb-size option flag")]),a._v(" "),e("h2",{attrs:{id:"_1-functional-specification"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-functional-specification"}},[a._v("#")]),a._v(" 1. Functional Specification")]),a._v(" "),e("h3",{attrs:{id:"i-summary"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#i-summary"}},[a._v("#")]),a._v(" I. Summary")]),a._v(" "),e("p",[a._v("This specification is written to rename the "),e("code",[a._v("MEILI_MAX_MDB_SIZE")]),a._v(" environnement variable and "),e("code",[a._v("--max-mdb-size")]),a._v(" option flag to "),e("code",[a._v("MEILI_MAX_INDEX_SIZE")]),a._v(" and "),e("code",[a._v("--max-index-size")]),a._v(".")]),a._v(" "),e("h3",{attrs:{id:"ii-motivation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#ii-motivation"}},[a._v("#")]),a._v(" II. Motivation")]),a._v(" "),e("p",[a._v("Since version 0.21 no longer has a main LMDB database for all indexes but one LMBD database per index, the concept of a "),e("code",[a._v("main")]),a._v(" database no longer exists internally.")]),a._v(" "),e("h3",{attrs:{id:"iii-additional-materials"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#iii-additional-materials"}},[a._v("#")]),a._v(" III. Additional Materials")]),a._v(" "),e("p",[a._v("N/A")]),a._v(" "),e("h3",{attrs:{id:"iv-explanation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#iv-explanation"}},[a._v("#")]),a._v(" IV. Explanation")]),a._v(" "),e("ul",[e("li",[a._v("Rename "),e("code",[a._v("--max-mdb-size")]),a._v(" to "),e("code",[a._v("--max-index-size")])]),a._v(" "),e("li",[a._v("Rename "),e("code",[a._v("MEILI_MAX_MDB_SIZE")]),a._v(" to "),e("code",[a._v("MEILI_MAX_INDEX_SIZE")])])]),a._v(" "),e("h3",{attrs:{id:"v-impact-on-documentation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#v-impact-on-documentation"}},[a._v("#")]),a._v(" V. Impact on Documentation")]),a._v(" "),e("ul",[e("li",[a._v("Update the "),e("a",{attrs:{href:"https://docs.meilisearch.com/reference/features/configuration.html#max-mdb-size",target:"_blank",rel:"noopener noreferrer"}},[a._v("Max MDB Size documentation part"),e("OutboundLink")],1),a._v(".")])]),a._v(" "),e("h3",{attrs:{id:"vi-impact-on-sdks"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#vi-impact-on-sdks"}},[a._v("#")]),a._v(" VI. Impact on SDKs")]),a._v(" "),e("p",[a._v("N/A")]),a._v(" "),e("h2",{attrs:{id:"_2-technical-aspects"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-technical-aspects"}},[a._v("#")]),a._v(" 2. Technical Aspects")]),a._v(" "),e("p",[a._v("N/A")]),a._v(" "),e("h2",{attrs:{id:"_3-future-possibilities"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-future-possibilities"}},[a._v("#")]),a._v(" 3. Future Possibilities")]),a._v(" "),e("ul",[e("li",[a._v("Provide a way to set a custom size per index.")])])])}),[],!1,null,null,null);t.default=n.exports}}]); \ No newline at end of file diff --git a/docs/assets/js/24.95542534.js b/docs/assets/js/24.2234005f.js similarity index 99% rename from docs/assets/js/24.95542534.js rename to docs/assets/js/24.2234005f.js index c5a275dfa..1c2ca573e 100644 --- a/docs/assets/js/24.95542534.js +++ b/docs/assets/js/24.2234005f.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[24],{451:function(t,s,e){"use strict";e.r(s);var a=e(62),n=Object(a.a)({},(function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("ul",[e("li",[t._v("Title: Sort")]),t._v(" "),e("li",[t._v("Start Date: 2021-07-20")]),t._v(" "),e("li",[t._v("Specification PR: "),e("a",{attrs:{href:"https://github.com/meilisearch/specifications/pull/55",target:"_blank",rel:"noopener noreferrer"}},[t._v("#55"),e("OutboundLink")],1)]),t._v(" "),e("li",[t._v("Discovery Issue: "),e("a",{attrs:{href:"https://github.com/meilisearch/product/issues/43",target:"_blank",rel:"noopener noreferrer"}},[t._v("#43"),e("OutboundLink")],1)])]),t._v(" "),e("h1",{attrs:{id:"sort"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#sort"}},[t._v("#")]),t._v(" Sort")]),t._v(" "),e("h2",{attrs:{id:"_1-functional-specification"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-functional-specification"}},[t._v("#")]),t._v(" 1. Functional Specification")]),t._v(" "),e("h3",{attrs:{id:"i-summary"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#i-summary"}},[t._v("#")]),t._v(" I. Summary")]),t._v(" "),e("p",[t._v("The purpose of this specification is to add a "),e("strong",[t._v("sort")]),t._v(" feature at search time to quickly sort the search results as an end-user. Fields called "),e("code",[t._v("sortable-attributes")]),t._v(" must be known for the search to be usable. These fields can be of type "),e("code",[t._v("string")]),t._v(" and "),e("code",[t._v("number")]),t._v(". We have also introduced a new ranking rule called "),e("code",[t._v("sort")]),t._v(", allowing the user to adjust how the sorting should behave. Its position within the ranking rules allows to adjust its behavior according to the needs of exhaustivity and relevancy. We also introduced a "),e("code",[t._v("sort")]),t._v(" parameter on the search resource to give the end-user the ability to sort the search results according to his needs.")]),t._v(" "),e("h4",{attrs:{id:"summary-key-points"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#summary-key-points"}},[t._v("#")]),t._v(" Summary Key points")]),t._v(" "),e("ul",[e("li",[e("code",[t._v("sortable-attributes")]),t._v(" setting MUST be known by the engine before search time.")]),t._v(" "),e("li",[e("code",[t._v("sort")]),t._v(' search parameter MUST be able to operate on multiple fields at search time. e.g. sort="price:asc,label:desc,...". '),e("code",[t._v("string")]),t._v(" and "),e("code",[t._v("number")]),t._v(" fields MUST be supported. Sorting on nested fields WON'T be supported for this iteration.")]),t._v(" "),e("li",[e("code",[t._v("sort")]),t._v(" ranking rule allows developers to adjust the sorting behavior between exhaustivity and relevancy.")])]),t._v(" "),e("h3",{attrs:{id:"ii-motivation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#ii-motivation"}},[t._v("#")]),t._v(" II. Motivation")]),t._v(" "),e("p",[t._v("According to our user feedback, the lack of a sorting feature is mentioned as one of the biggest deal-breakers for choosing MeiliSearch as a search engine. A search engine must be able to offer this feature, especially for e-commerce use. Moreover, competitors all offer it. Today, users must find workarounds that take time to develop and maintain to sort search results.")]),t._v(" "),e("p",[t._v("We want to offer a simple and versatile solution for their needs.")]),t._v(" "),e("h3",{attrs:{id:"iii-explanation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#iii-explanation"}},[t._v("#")]),t._v(" III. Explanation")]),t._v(" "),e("h4",{attrs:{id:"as-a-developer-i-want-to-configure-the-sortable-attributes-so-that-the-end-user-can-sort-results"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#as-a-developer-i-want-to-configure-the-sortable-attributes-so-that-the-end-user-can-sort-results"}},[t._v("#")]),t._v(" "),e("strong",[t._v("As a developer, I want to configure the sortable attributes so that the end-user can sort results.")])]),t._v(" "),e("ul",[e("li",[t._v("Introduce a new "),e("code",[t._v("sortableAttributes")]),t._v(" field in the global settings resource schema.")]),t._v(" "),e("li",[t._v("Introduce a new "),e("code",[t._v("/sortable-attributes")]),t._v(" sub-setting resource.")])]),t._v(" "),e("p",[e("strong",[e("code",[t._v("sortableAttributes")]),t._v(" field definition")])]),t._v(" "),e("ul",[e("li",[t._v("Name: "),e("code",[t._v("sortableAttributes")])]),t._v(" "),e("li",[t._v("Type: Array[String]")]),t._v(" "),e("li",[t._v("Default: []")])]),t._v(" "),e("p",[e("strong",[t._v("GET settings")]),t._v(" "),e("code",[t._v("/indexes/{indexUid}/settings")])]),t._v(" "),e("p",[t._v("200 - Response with empty "),e("code",[t._v("sortableAttributes")]),t._v(" (default case)")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n ..."),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"sortableAttributes"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n ...\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("p",[t._v("200 - Response with already configured "),e("code",[t._v("sortableAttributes")])]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n ..."),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"sortableAttributes"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"price"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"release_date"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n ...\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("p",[t._v("💡 The values order in "),e("code",[t._v("sortableAttributes")]),t._v(" has no impact. The order will be determined at search time from the "),e("code",[t._v("sort")]),t._v(" parameter.")]),t._v(" "),e("p",[e("strong",[t._v("POST settings")]),t._v(" "),e("code",[t._v("/indexes/{indexUid}/settings")])]),t._v(" "),e("p",[t._v("Request body")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n ..."),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t"),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"sortableAttributes"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"price"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"release_date"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"title"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n ...\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("p",[t._v("202 Accepted - Response body")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"updateId"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("7")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("ul",[e("li",[t._v("💡 Sending an inexistent field WON'T throw an error. It is possible to define settings before indexing documents so we accept fields that may not yet exist within a document.")]),t._v(" "),e("li",[t._v("💡 "),e("code",[t._v("sortableAttributes")]),t._v(" accepts "),e("code",[t._v("null")]),t._v(" and "),e("code",[t._v("[]")]),t._v(" values to be reset.\n🔴 Sending other than string value as array item results in a 400 bad request - "),e("strong",[t._v("invalid_request_error")]),t._v(".")])]),t._v(" "),e("p",[e("strong",[t._v("DELETE settings")]),t._v(" "),e("code",[t._v("/indexes/{indexUid}/settings")])]),t._v(" "),e("p",[t._v("💡 Resetting all settings will result to the default case e.g. "),e("code",[t._v("sortableAttributes: []")])]),t._v(" "),e("p",[t._v("202 Accepted - Response body")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"updateId"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("8")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("p",[e("strong",[t._v("GET settings/sortable-attributes")]),t._v(" "),e("code",[t._v("/indexes/{indexUid}/settings/sortable-attributes")])]),t._v(" "),e("p",[t._v("200 - Response body (Default case)")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])]),e("p",[t._v("200 - Response body with "),e("code",[t._v("sortableAttributes")]),t._v(" already configured")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"price"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"release_date"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])]),e("ul",[e("li",[t._v("🔴 If a master key is set and missing from the client, the new GET "),e("code",[t._v("settings/sortable-attributes")]),t._v(" API method is protected and returns a 401 Unauthorized "),e("code",[t._v("missing_authorization_header")]),t._v(".")]),t._v(" "),e("li",[t._v("🔴 If the index is not found, a 404 Not Found response is returned.")])]),t._v(" "),e("p",[e("strong",[t._v("POST settings/sortable-attributes")]),t._v(" "),e("code",[t._v("/indexes/{indexUid}/settings/sortable-attributes")])]),t._v(" "),e("p",[t._v("Request body")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('[\n "price",\n "release_date",\n "title"\n]\n')])])]),e("p",[t._v("202 Accepted - Response body")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"updateId"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("7")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("ul",[e("li",[t._v("💡 Sending an inexistent field WON'T throw an error. It is possible to define settings before indexing documents so we accept fields that may not yet exist within a document.")]),t._v(" "),e("li",[t._v("💡 POST request body accept null and [] values to reset the "),e("code",[t._v("sortableAttributes")]),t._v(".")]),t._v(" "),e("li",[t._v("🔴 Sending other than string value as array item results in a 400 bad request - "),e("strong",[t._v("invalid_request_error")]),t._v(".")]),t._v(" "),e("li",[t._v("🔴 If a master key is set and missing from the client, the new POST "),e("code",[t._v("settings/sortable-attributes")]),t._v(" API method is protected and returns a 401 Unauthorized "),e("code",[t._v("missing_authorization_header")]),t._v(".")]),t._v(" "),e("li",[t._v("🔴 If the index is not found, a 404 Not Found response is returned.")])]),t._v(" "),e("p",[e("strong",[t._v("DEL settings/sortable-attributes")]),t._v(" "),e("code",[t._v("/indexes/{indexUid}/settings/sortable-attributes")])]),t._v(" "),e("p",[t._v("202 Accepted - Response body")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"updateId"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("8")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("ul",[e("li",[t._v("🔴 If a master key is set and missing from the client, the new DELETE "),e("code",[t._v("settings/sortable-attributes")]),t._v(" API method is protected and returns a 401 Unauthorized "),e("code",[t._v("missing_authorization_header")]),t._v(".")]),t._v(" "),e("li",[t._v("🔴 If the index is not found, a 404 Not Found response is returned.")])]),t._v(" "),e("h4",{attrs:{id:"as-an-end-user-i-want-to-specify-a-sort-parameter-at-search-time-so-that-i-can-sort-search-result-in-ascending-descending-order-from-document-attributes-whether-they-are-numeric-or-string"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#as-an-end-user-i-want-to-specify-a-sort-parameter-at-search-time-so-that-i-can-sort-search-result-in-ascending-descending-order-from-document-attributes-whether-they-are-numeric-or-string"}},[t._v("#")]),t._v(" "),e("strong",[t._v("As an End-User, I want to specify a "),e("code",[t._v("sort")]),t._v(" parameter at search time so that I can sort search result in ascending/descending order from document attributes, whether they are "),e("code",[t._v("numeric")]),t._v(" or "),e("code",[t._v("string")]),t._v(".")])]),t._v(" "),e("ul",[e("li",[t._v("Introduce a "),e("code",[t._v("sort")]),t._v(" parameter on GET/POST "),e("code",[t._v("/search")]),t._v(" methods.")])]),t._v(" "),e("blockquote",[e("p",[t._v("💡 In the case where an attribute is specified as a sort criterion at search time and if this attribute is of a different type between several documents, the numeric type will always be favored first by the engine. This means that documents with numeric values for this attribute will be sorted before those with string values. This can lead to awkward sorting behavior, so the user should make sure to have the same type on the attribute he wants to sort on for all these documents.")])]),t._v(" "),e("blockquote",[e("p",[t._v("💡 In the case where an attribute is specified as a sort criterion at search time and does not exist on a document, the document will be placed at the end of the ranking rule sort.")])]),t._v(" "),e("p",[e("strong",[t._v("GET Search /indexes/{indexUid}/search")])]),t._v(" "),e("p",[e("code",[t._v("sort")]),t._v(" - String - E.g. "),e("code",[t._v('sort="price:asc,release_date:desc"')])]),t._v(" "),e("blockquote",[e("p",[e("code",[t._v(":asc")])])]),t._v(" "),e("p",[e("strong",[t._v("POST Search /indexes/{indexUid}/search")])]),t._v(" "),e("p",[e("code",[t._v("sort")]),t._v(" - Array[String] - E.g.")]),t._v(" "),e("p",[t._v("Request body")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n ..."),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"sort"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"price:asc"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"release_date:desc"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n ...\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("ul",[e("li",[t._v("🔴 Sending a sort parameter while the "),e("code",[t._v("sort")]),t._v(" ranking rule is not specified in the ranking rules settings will lead to a 400 Bad Request - "),e("strong",[t._v("invalid_sort")]),t._v(" error.")])]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"message"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"You must specify where `sort` is listed in the rankingRules setting to use the sort parameter at search time."')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"errorCode"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"invalid_sort"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"errorType"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"invalid_request_error"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"errorLink"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"https://docs.meilisearch.com/errors#invalid_sort"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("ul",[e("li",[t._v("🔴 Sending a value not set in "),e("code",[t._v("sortableAttribute")]),t._v(" will lead to a 400 Bad Request - "),e("strong",[t._v("invalid_sort")]),t._v(" error.")])]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"message"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Attribute :attribute is not sortable, available sortable attributes are: ..., ..."')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"errorCode"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"invalid_sort"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"errorType"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"invalid_request_error"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"errorLink"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"https://docs.meilisearch.com/errors#invalid_sort"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("ul",[e("li",[e("p",[e("code",[t._v(":attribute")]),t._v(" is inferred when the message is generated.")])]),t._v(" "),e("li",[e("p",[t._v("🔴 Sending a wrong formatted value will lead to a 400 Bad Request - "),e("strong",[t._v("invalid_sort")]),t._v(".")])])]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"message"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Invalid syntax for the sort parameter: :syntaxErrorHelper."')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"errorCode"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"invalid_sort"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"errorType"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"invalid_request_error"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"errorLink"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"https://docs.meilisearch.com/errors#invalid_sort"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("ul",[e("li",[e("code",[t._v(":syntaxErrorhelper")]),t._v(" is inferred when the message is generated.")])]),t._v(" "),e("p",[t._v("We want to align the way custom ordering rules are written with the syntax of the "),e("code",[t._v("sort")]),t._v(" search parameter.")]),t._v(" "),e("p",[t._v("Current custom ranking rule definition syntax")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"asc(title)"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])]),e("p",[t._v("become")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"title:asc"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])]),e("p",[e("strong",[t._v("Search example with "),e("code",[t._v("sort")])])]),t._v(" "),e("p",[t._v("With this set of document")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"id"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"label"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Vans Classic II sweatshirt in black"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"price"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("52.00")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"colors"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"black"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"sizes"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xs"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"s"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"m"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"m"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xl"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reviews_rating"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("4.5")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"id"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"label"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"The North Face Drew Peak hoodie in green"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"price"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("36.00")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"colors"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"green"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reviews_rating"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("4.89")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"id"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"label"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nike Club hoodie in navy"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"price"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("52.00")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"colors"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"navy"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reviews_rating"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("4.7")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])]),e("p",[t._v("With this ranking rules definition")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sort"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"typo"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"words"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"proximity"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"attribute"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"exactness"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])]),e("p",[t._v("And with this "),e("code",[t._v("sortableAttributes")]),t._v(" definition")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"price"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"reviews_rating"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])]),e("p",[e("strong",[t._v("POST Search")])]),t._v(" "),e("p",[t._v("Request Body")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n ..."),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"sort"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"price:asc"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"reviews_rating:desc"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("p",[t._v("200 - Response")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hits"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"id"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"label"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"The North Face Drew Peak hoodie in green"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"price"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("36.00")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"colors"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"green"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reviews_rating"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("4.89")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"id"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"label"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nike Club hoodie in navy"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"price"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("52.00")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"colors"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"navy"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reviews_rating"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("4.7")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"id"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"label"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Vans Classic II sweatshirt in black"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"price"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("52.00")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"colors"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"black"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"sizes"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xs"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"s"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"m"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"m"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xl"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reviews_rating"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("4.5")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("p",[t._v("As we can see "),e("code",[t._v("sort")]),t._v(" is the most important criterion in play according to the ranking rules ordering. Moreover, we see that the "),e("code",[t._v("sort")]),t._v(" search parameter is able to handle several attributes. The priorities are determined from left to right, so the "),e("code",[t._v("price")]),t._v(" field is more important, if N documents share the same price value they are sorted by "),e("code",[t._v("reviews_rating")]),t._v(" and so on.")]),t._v(" "),e("h4",{attrs:{id:"as-a-developer-i-want-to-change-the-position-of-the-sort-ranking-rule-so-that-i-tweak-the-behavior-of-the-sort-ranking-rule-between-exhaustivity-and-relevancy"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#as-a-developer-i-want-to-change-the-position-of-the-sort-ranking-rule-so-that-i-tweak-the-behavior-of-the-sort-ranking-rule-between-exhaustivity-and-relevancy"}},[t._v("#")]),t._v(" "),e("strong",[t._v("As a Developer, I want to change the position of the "),e("code",[t._v("sort")]),t._v(" ranking rule so that I tweak the behavior of the "),e("code",[t._v("sort")]),t._v(" ranking rule between exhaustivity and relevancy.")])]),t._v(" "),e("p",[e("strong",[t._v("GET settings/ranking-rules")]),t._v(" "),e("code",[t._v("/indexes/{indexUid}/settings/ranking-rules")])]),t._v(" "),e("p",[t._v("200 - Response body (Default case)")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"words"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"typo"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"proximity"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"attribute"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sort"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"exactness"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])]),e("p",[e("strong",[t._v("POST settings/ranking-rules")])]),t._v(" "),e("p",[t._v("Request body")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sort"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"words"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"typo"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"proximity"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"attribute"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"exactness"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])]),e("p",[t._v("202 Accepted - Response body")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"updateId"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("7")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("ul",[e("li",[t._v("ℹ️ The position of the sort ranking rule is significant. The higher it is, the more critical it will be. The lower it is, the less important it will be and other rules will take priority. This allows the developer to adjust the behavior between exhaustivity and relevancy with the sort criterion. If the "),e("code",[t._v("sort")]),t._v(" ranking rule is in the last position you will have a very relevant sort; that is, results will emphasize relevancy over your sort criteria. Likewise, if "),e("code",[t._v("sort")]),t._v(" is in the first position, you will have a very exhaustive search that gives precedence to results less relevant to the query terms but more in line with your sort criteria.")])]),t._v(" "),e("p",[e("strong",[t._v("Real condition explanation")])]),t._v(" "),e("p",[t._v("e.g. Relevant Sort")]),t._v(" "),e("p",[t._v("I want a relevant sort (sort on relevant items). I put sort at the latest level of my ranking rules.")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"typo"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"words"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"proximity"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"attribute"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"exactness"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sort"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])]),e("p",[t._v("At search time, if I use (knowing that price and reviews_rating have been set as sortable-attributes previously)")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"q"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Mac Book"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"sort"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"price:asc"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"reviews_rating:desc"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("p",[t._v("Ranking rules can virtually be represented that way for this search request.")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"typo"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"words"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"proximity"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"attribute"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"exactness"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"price:asc"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//First part of the `sort` ranking rule.")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"reviews_rating:desc"')]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//Second part of the `sort`ranking rule.")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])]),e("p",[t._v("Note that if I change the "),e("code",[t._v("sort")]),t._v(" search parameter's value order, it changes the inner element of the "),e("code",[t._v("sort")]),t._v(" ranking rule.")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"q"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Mac Book"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"sort"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"reviews_rating:desc"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"price:asc"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"typo"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"words"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"proximity"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"attribute"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"exactness"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"reviews_rating:desc"')]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//The ordering of inner elements of the sort ranking rule is made from the order of the `sort` query/request parameter.")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"price:asc"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])]),e("h3",{attrs:{id:"iv-finalized-key-changes"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#iv-finalized-key-changes"}},[t._v("#")]),t._v(" IV. Finalized Key Changes")]),t._v(" "),e("ul",[e("li",[t._v("Add "),e("code",[t._v("sortableAttributes")]),t._v(" parameter in settings schema.")]),t._v(" "),e("li",[t._v("Add "),e("code",[t._v("sortable-attributes")]),t._v(" API ressource.")]),t._v(" "),e("li",[t._v("Add the "),e("code",[t._v("sort")]),t._v(" ranking rule after "),e("code",[t._v("attribute")]),t._v(" ranking rule by default to promote relevant sort.")]),t._v(" "),e("li",[t._v("Add "),e("code",[t._v("sort")]),t._v(" query/request parameter on "),e("code",[t._v("/search")]),t._v(" resource. Support "),e("code",[t._v("string")]),t._v(" and "),e("code",[t._v("number")]),t._v(". "),e("code",[t._v("string")]),t._v(" can be sorted in lexicographical order.")]),t._v(" "),e("li",[t._v("Change custom ranking rule format. e.g. "),e("code",[t._v("asc(price)")]),t._v(" become "),e("code",[t._v("price:asc")])]),t._v(" "),e("li",[t._v("Add a new error "),e("code",[t._v("invalid_sort")]),t._v(" similar to "),e("code",[t._v("invalid_filter")]),t._v(".")]),t._v(" "),e("li",[t._v("The numeric type is preferred to the string type by the "),e("code",[t._v("sort")]),t._v(" ranking rule. If an attribute has different types among the documents, those containing a numeric value will be placed before the documents containing a string value type.")]),t._v(" "),e("li",[t._v("A document not containing an attribute requested in the "),e("code",[t._v("sort")]),t._v(" parameter will be placed last during the tie-breaking of the "),e("code",[t._v("sort")]),t._v(" ranking-rule.")])]),t._v(" "),e("h2",{attrs:{id:"_2-technical-details"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-technical-details"}},[t._v("#")]),t._v(" 2. Technical details")]),t._v(" "),e("h3",{attrs:{id:"i-measuring"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#i-measuring"}},[t._v("#")]),t._v(" I. Measuring")]),t._v(" "),e("ul",[e("li",[t._v("Number of sorted attributes used in "),e("code",[t._v("sort")]),t._v(" search parameter to calculate an avg per server.")]),t._v(" "),e("li",[e("code",[t._v("ranking-rules")]),t._v(" setting definition to evaluate position customization.")]),t._v(" "),e("li",[t._v("Number of "),e("code",[t._v("sortableAttributes")]),t._v(" to calculate an avg per server.")])]),t._v(" "),e("h2",{attrs:{id:"_3-future-possibilities"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-future-possibilities"}},[t._v("#")]),t._v(" 3. Future Possibilities")]),t._v(" "),e("ul",[e("li",[t._v("Support sort on nested fields")]),t._v(" "),e("li",[t._v("Support computational functions avg, sum, min, max, median. For now, the workaround is to pre-compute values in the document before indexing and sort them at search time with a "),e("code",[t._v("sort")]),t._v(' on the pre-computed field. e.g. sort="precomputed_avg_price:desc".')]),t._v(" "),e("li",[t._v("Ability to set a custom ranking rules order at search time. Out of scope from the "),e("code",[t._v("sort")]),t._v(".")])])])}),[],!1,null,null,null);s.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[24],{447:function(t,s,e){"use strict";e.r(s);var a=e(62),n=Object(a.a)({},(function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("ul",[e("li",[t._v("Title: Sort")]),t._v(" "),e("li",[t._v("Start Date: 2021-07-20")]),t._v(" "),e("li",[t._v("Specification PR: "),e("a",{attrs:{href:"https://github.com/meilisearch/specifications/pull/55",target:"_blank",rel:"noopener noreferrer"}},[t._v("#55"),e("OutboundLink")],1)]),t._v(" "),e("li",[t._v("Discovery Issue: "),e("a",{attrs:{href:"https://github.com/meilisearch/product/issues/43",target:"_blank",rel:"noopener noreferrer"}},[t._v("#43"),e("OutboundLink")],1)])]),t._v(" "),e("h1",{attrs:{id:"sort"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#sort"}},[t._v("#")]),t._v(" Sort")]),t._v(" "),e("h2",{attrs:{id:"_1-functional-specification"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-functional-specification"}},[t._v("#")]),t._v(" 1. Functional Specification")]),t._v(" "),e("h3",{attrs:{id:"i-summary"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#i-summary"}},[t._v("#")]),t._v(" I. Summary")]),t._v(" "),e("p",[t._v("The purpose of this specification is to add a "),e("strong",[t._v("sort")]),t._v(" feature at search time to quickly sort the search results as an end-user. Fields called "),e("code",[t._v("sortable-attributes")]),t._v(" must be known for the search to be usable. These fields can be of type "),e("code",[t._v("string")]),t._v(" and "),e("code",[t._v("number")]),t._v(". We have also introduced a new ranking rule called "),e("code",[t._v("sort")]),t._v(", allowing the user to adjust how the sorting should behave. Its position within the ranking rules allows to adjust its behavior according to the needs of exhaustivity and relevancy. We also introduced a "),e("code",[t._v("sort")]),t._v(" parameter on the search resource to give the end-user the ability to sort the search results according to his needs.")]),t._v(" "),e("h4",{attrs:{id:"summary-key-points"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#summary-key-points"}},[t._v("#")]),t._v(" Summary Key points")]),t._v(" "),e("ul",[e("li",[e("code",[t._v("sortable-attributes")]),t._v(" setting MUST be known by the engine before search time.")]),t._v(" "),e("li",[e("code",[t._v("sort")]),t._v(' search parameter MUST be able to operate on multiple fields at search time. e.g. sort="price:asc,label:desc,...". '),e("code",[t._v("string")]),t._v(" and "),e("code",[t._v("number")]),t._v(" fields MUST be supported. Sorting on nested fields WON'T be supported for this iteration.")]),t._v(" "),e("li",[e("code",[t._v("sort")]),t._v(" ranking rule allows developers to adjust the sorting behavior between exhaustivity and relevancy.")])]),t._v(" "),e("h3",{attrs:{id:"ii-motivation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#ii-motivation"}},[t._v("#")]),t._v(" II. Motivation")]),t._v(" "),e("p",[t._v("According to our user feedback, the lack of a sorting feature is mentioned as one of the biggest deal-breakers for choosing MeiliSearch as a search engine. A search engine must be able to offer this feature, especially for e-commerce use. Moreover, competitors all offer it. Today, users must find workarounds that take time to develop and maintain to sort search results.")]),t._v(" "),e("p",[t._v("We want to offer a simple and versatile solution for their needs.")]),t._v(" "),e("h3",{attrs:{id:"iii-explanation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#iii-explanation"}},[t._v("#")]),t._v(" III. Explanation")]),t._v(" "),e("h4",{attrs:{id:"as-a-developer-i-want-to-configure-the-sortable-attributes-so-that-the-end-user-can-sort-results"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#as-a-developer-i-want-to-configure-the-sortable-attributes-so-that-the-end-user-can-sort-results"}},[t._v("#")]),t._v(" "),e("strong",[t._v("As a developer, I want to configure the sortable attributes so that the end-user can sort results.")])]),t._v(" "),e("ul",[e("li",[t._v("Introduce a new "),e("code",[t._v("sortableAttributes")]),t._v(" field in the global settings resource schema.")]),t._v(" "),e("li",[t._v("Introduce a new "),e("code",[t._v("/sortable-attributes")]),t._v(" sub-setting resource.")])]),t._v(" "),e("p",[e("strong",[e("code",[t._v("sortableAttributes")]),t._v(" field definition")])]),t._v(" "),e("ul",[e("li",[t._v("Name: "),e("code",[t._v("sortableAttributes")])]),t._v(" "),e("li",[t._v("Type: Array[String]")]),t._v(" "),e("li",[t._v("Default: []")])]),t._v(" "),e("p",[e("strong",[t._v("GET settings")]),t._v(" "),e("code",[t._v("/indexes/{indexUid}/settings")])]),t._v(" "),e("p",[t._v("200 - Response with empty "),e("code",[t._v("sortableAttributes")]),t._v(" (default case)")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n ..."),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"sortableAttributes"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n ...\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("p",[t._v("200 - Response with already configured "),e("code",[t._v("sortableAttributes")])]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n ..."),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"sortableAttributes"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"price"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"release_date"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n ...\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("p",[t._v("💡 The values order in "),e("code",[t._v("sortableAttributes")]),t._v(" has no impact. The order will be determined at search time from the "),e("code",[t._v("sort")]),t._v(" parameter.")]),t._v(" "),e("p",[e("strong",[t._v("POST settings")]),t._v(" "),e("code",[t._v("/indexes/{indexUid}/settings")])]),t._v(" "),e("p",[t._v("Request body")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n ..."),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n\t"),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"sortableAttributes"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"price"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"release_date"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"title"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n ...\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("p",[t._v("202 Accepted - Response body")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"updateId"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("7")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("ul",[e("li",[t._v("💡 Sending an inexistent field WON'T throw an error. It is possible to define settings before indexing documents so we accept fields that may not yet exist within a document.")]),t._v(" "),e("li",[t._v("💡 "),e("code",[t._v("sortableAttributes")]),t._v(" accepts "),e("code",[t._v("null")]),t._v(" and "),e("code",[t._v("[]")]),t._v(" values to be reset.\n🔴 Sending other than string value as array item results in a 400 bad request - "),e("strong",[t._v("invalid_request_error")]),t._v(".")])]),t._v(" "),e("p",[e("strong",[t._v("DELETE settings")]),t._v(" "),e("code",[t._v("/indexes/{indexUid}/settings")])]),t._v(" "),e("p",[t._v("💡 Resetting all settings will result to the default case e.g. "),e("code",[t._v("sortableAttributes: []")])]),t._v(" "),e("p",[t._v("202 Accepted - Response body")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"updateId"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("8")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("p",[e("strong",[t._v("GET settings/sortable-attributes")]),t._v(" "),e("code",[t._v("/indexes/{indexUid}/settings/sortable-attributes")])]),t._v(" "),e("p",[t._v("200 - Response body (Default case)")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])]),e("p",[t._v("200 - Response body with "),e("code",[t._v("sortableAttributes")]),t._v(" already configured")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"price"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"release_date"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])]),e("ul",[e("li",[t._v("🔴 If a master key is set and missing from the client, the new GET "),e("code",[t._v("settings/sortable-attributes")]),t._v(" API method is protected and returns a 401 Unauthorized "),e("code",[t._v("missing_authorization_header")]),t._v(".")]),t._v(" "),e("li",[t._v("🔴 If the index is not found, a 404 Not Found response is returned.")])]),t._v(" "),e("p",[e("strong",[t._v("POST settings/sortable-attributes")]),t._v(" "),e("code",[t._v("/indexes/{indexUid}/settings/sortable-attributes")])]),t._v(" "),e("p",[t._v("Request body")]),t._v(" "),e("div",{staticClass:"language- extra-class"},[e("pre",{pre:!0,attrs:{class:"language-text"}},[e("code",[t._v('[\n "price",\n "release_date",\n "title"\n]\n')])])]),e("p",[t._v("202 Accepted - Response body")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"updateId"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("7")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("ul",[e("li",[t._v("💡 Sending an inexistent field WON'T throw an error. It is possible to define settings before indexing documents so we accept fields that may not yet exist within a document.")]),t._v(" "),e("li",[t._v("💡 POST request body accept null and [] values to reset the "),e("code",[t._v("sortableAttributes")]),t._v(".")]),t._v(" "),e("li",[t._v("🔴 Sending other than string value as array item results in a 400 bad request - "),e("strong",[t._v("invalid_request_error")]),t._v(".")]),t._v(" "),e("li",[t._v("🔴 If a master key is set and missing from the client, the new POST "),e("code",[t._v("settings/sortable-attributes")]),t._v(" API method is protected and returns a 401 Unauthorized "),e("code",[t._v("missing_authorization_header")]),t._v(".")]),t._v(" "),e("li",[t._v("🔴 If the index is not found, a 404 Not Found response is returned.")])]),t._v(" "),e("p",[e("strong",[t._v("DEL settings/sortable-attributes")]),t._v(" "),e("code",[t._v("/indexes/{indexUid}/settings/sortable-attributes")])]),t._v(" "),e("p",[t._v("202 Accepted - Response body")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"updateId"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("8")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("ul",[e("li",[t._v("🔴 If a master key is set and missing from the client, the new DELETE "),e("code",[t._v("settings/sortable-attributes")]),t._v(" API method is protected and returns a 401 Unauthorized "),e("code",[t._v("missing_authorization_header")]),t._v(".")]),t._v(" "),e("li",[t._v("🔴 If the index is not found, a 404 Not Found response is returned.")])]),t._v(" "),e("h4",{attrs:{id:"as-an-end-user-i-want-to-specify-a-sort-parameter-at-search-time-so-that-i-can-sort-search-result-in-ascending-descending-order-from-document-attributes-whether-they-are-numeric-or-string"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#as-an-end-user-i-want-to-specify-a-sort-parameter-at-search-time-so-that-i-can-sort-search-result-in-ascending-descending-order-from-document-attributes-whether-they-are-numeric-or-string"}},[t._v("#")]),t._v(" "),e("strong",[t._v("As an End-User, I want to specify a "),e("code",[t._v("sort")]),t._v(" parameter at search time so that I can sort search result in ascending/descending order from document attributes, whether they are "),e("code",[t._v("numeric")]),t._v(" or "),e("code",[t._v("string")]),t._v(".")])]),t._v(" "),e("ul",[e("li",[t._v("Introduce a "),e("code",[t._v("sort")]),t._v(" parameter on GET/POST "),e("code",[t._v("/search")]),t._v(" methods.")])]),t._v(" "),e("blockquote",[e("p",[t._v("💡 In the case where an attribute is specified as a sort criterion at search time and if this attribute is of a different type between several documents, the numeric type will always be favored first by the engine. This means that documents with numeric values for this attribute will be sorted before those with string values. This can lead to awkward sorting behavior, so the user should make sure to have the same type on the attribute he wants to sort on for all these documents.")])]),t._v(" "),e("blockquote",[e("p",[t._v("💡 In the case where an attribute is specified as a sort criterion at search time and does not exist on a document, the document will be placed at the end of the ranking rule sort.")])]),t._v(" "),e("p",[e("strong",[t._v("GET Search /indexes/{indexUid}/search")])]),t._v(" "),e("p",[e("code",[t._v("sort")]),t._v(" - String - E.g. "),e("code",[t._v('sort="price:asc,release_date:desc"')])]),t._v(" "),e("blockquote",[e("p",[e("code",[t._v(":asc")])])]),t._v(" "),e("p",[e("strong",[t._v("POST Search /indexes/{indexUid}/search")])]),t._v(" "),e("p",[e("code",[t._v("sort")]),t._v(" - Array[String] - E.g.")]),t._v(" "),e("p",[t._v("Request body")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n ..."),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"sort"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"price:asc"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"release_date:desc"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n ...\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("ul",[e("li",[t._v("🔴 Sending a sort parameter while the "),e("code",[t._v("sort")]),t._v(" ranking rule is not specified in the ranking rules settings will lead to a 400 Bad Request - "),e("strong",[t._v("invalid_sort")]),t._v(" error.")])]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"message"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"You must specify where `sort` is listed in the rankingRules setting to use the sort parameter at search time."')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"errorCode"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"invalid_sort"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"errorType"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"invalid_request_error"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"errorLink"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"https://docs.meilisearch.com/errors#invalid_sort"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("ul",[e("li",[t._v("🔴 Sending a value not set in "),e("code",[t._v("sortableAttribute")]),t._v(" will lead to a 400 Bad Request - "),e("strong",[t._v("invalid_sort")]),t._v(" error.")])]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"message"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Attribute :attribute is not sortable, available sortable attributes are: ..., ..."')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"errorCode"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"invalid_sort"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"errorType"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"invalid_request_error"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"errorLink"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"https://docs.meilisearch.com/errors#invalid_sort"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("ul",[e("li",[e("p",[e("code",[t._v(":attribute")]),t._v(" is inferred when the message is generated.")])]),t._v(" "),e("li",[e("p",[t._v("🔴 Sending a wrong formatted value will lead to a 400 Bad Request - "),e("strong",[t._v("invalid_sort")]),t._v(".")])])]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"message"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Invalid syntax for the sort parameter: :syntaxErrorHelper."')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"errorCode"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"invalid_sort"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"errorType"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"invalid_request_error"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"errorLink"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"https://docs.meilisearch.com/errors#invalid_sort"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("ul",[e("li",[e("code",[t._v(":syntaxErrorhelper")]),t._v(" is inferred when the message is generated.")])]),t._v(" "),e("p",[t._v("We want to align the way custom ordering rules are written with the syntax of the "),e("code",[t._v("sort")]),t._v(" search parameter.")]),t._v(" "),e("p",[t._v("Current custom ranking rule definition syntax")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"asc(title)"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])]),e("p",[t._v("become")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"title:asc"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])]),e("p",[e("strong",[t._v("Search example with "),e("code",[t._v("sort")])])]),t._v(" "),e("p",[t._v("With this set of document")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"id"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"label"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Vans Classic II sweatshirt in black"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"price"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("52.00")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"colors"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"black"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"sizes"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xs"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"s"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"m"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"m"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xl"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reviews_rating"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("4.5")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"id"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"label"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"The North Face Drew Peak hoodie in green"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"price"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("36.00")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"colors"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"green"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reviews_rating"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("4.89")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"id"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"label"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nike Club hoodie in navy"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"price"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("52.00")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"colors"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"navy"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reviews_rating"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("4.7")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])]),e("p",[t._v("With this ranking rules definition")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sort"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"typo"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"words"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"proximity"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"attribute"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"exactness"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])]),e("p",[t._v("And with this "),e("code",[t._v("sortableAttributes")]),t._v(" definition")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"price"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"reviews_rating"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])]),e("p",[e("strong",[t._v("POST Search")])]),t._v(" "),e("p",[t._v("Request Body")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n ..."),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"sort"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"price:asc"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"reviews_rating:desc"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("p",[t._v("200 - Response")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hits"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"id"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"label"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"The North Face Drew Peak hoodie in green"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"price"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("36.00")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"colors"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"green"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reviews_rating"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("4.89")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"id"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"label"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Nike Club hoodie in navy"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"price"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("52.00")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"colors"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"navy"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reviews_rating"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("4.7")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"id"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"label"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Vans Classic II sweatshirt in black"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"price"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("52.00")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"colors"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"black"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"sizes"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xs"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"s"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"m"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"m"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"xl"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"reviews_rating"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("4.5")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("p",[t._v("As we can see "),e("code",[t._v("sort")]),t._v(" is the most important criterion in play according to the ranking rules ordering. Moreover, we see that the "),e("code",[t._v("sort")]),t._v(" search parameter is able to handle several attributes. The priorities are determined from left to right, so the "),e("code",[t._v("price")]),t._v(" field is more important, if N documents share the same price value they are sorted by "),e("code",[t._v("reviews_rating")]),t._v(" and so on.")]),t._v(" "),e("h4",{attrs:{id:"as-a-developer-i-want-to-change-the-position-of-the-sort-ranking-rule-so-that-i-tweak-the-behavior-of-the-sort-ranking-rule-between-exhaustivity-and-relevancy"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#as-a-developer-i-want-to-change-the-position-of-the-sort-ranking-rule-so-that-i-tweak-the-behavior-of-the-sort-ranking-rule-between-exhaustivity-and-relevancy"}},[t._v("#")]),t._v(" "),e("strong",[t._v("As a Developer, I want to change the position of the "),e("code",[t._v("sort")]),t._v(" ranking rule so that I tweak the behavior of the "),e("code",[t._v("sort")]),t._v(" ranking rule between exhaustivity and relevancy.")])]),t._v(" "),e("p",[e("strong",[t._v("GET settings/ranking-rules")]),t._v(" "),e("code",[t._v("/indexes/{indexUid}/settings/ranking-rules")])]),t._v(" "),e("p",[t._v("200 - Response body (Default case)")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"words"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"typo"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"proximity"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"attribute"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sort"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"exactness"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])]),e("p",[e("strong",[t._v("POST settings/ranking-rules")])]),t._v(" "),e("p",[t._v("Request body")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sort"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"words"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"typo"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"proximity"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"attribute"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"exactness"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])]),e("p",[t._v("202 Accepted - Response body")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"updateId"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("7")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("ul",[e("li",[t._v("ℹ️ The position of the sort ranking rule is significant. The higher it is, the more critical it will be. The lower it is, the less important it will be and other rules will take priority. This allows the developer to adjust the behavior between exhaustivity and relevancy with the sort criterion. If the "),e("code",[t._v("sort")]),t._v(" ranking rule is in the last position you will have a very relevant sort; that is, results will emphasize relevancy over your sort criteria. Likewise, if "),e("code",[t._v("sort")]),t._v(" is in the first position, you will have a very exhaustive search that gives precedence to results less relevant to the query terms but more in line with your sort criteria.")])]),t._v(" "),e("p",[e("strong",[t._v("Real condition explanation")])]),t._v(" "),e("p",[t._v("e.g. Relevant Sort")]),t._v(" "),e("p",[t._v("I want a relevant sort (sort on relevant items). I put sort at the latest level of my ranking rules.")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"typo"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"words"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"proximity"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"attribute"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"exactness"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"sort"')]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])]),e("p",[t._v("At search time, if I use (knowing that price and reviews_rating have been set as sortable-attributes previously)")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"q"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Mac Book"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"sort"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"price:asc"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"reviews_rating:desc"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("p",[t._v("Ranking rules can virtually be represented that way for this search request.")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"typo"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"words"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"proximity"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"attribute"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"exactness"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"price:asc"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//First part of the `sort` ranking rule.")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"reviews_rating:desc"')]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//Second part of the `sort`ranking rule.")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])]),e("p",[t._v("Note that if I change the "),e("code",[t._v("sort")]),t._v(" search parameter's value order, it changes the inner element of the "),e("code",[t._v("sort")]),t._v(" ranking rule.")]),t._v(" "),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"q"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Mac Book"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token property"}},[t._v('"sort"')]),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"reviews_rating:desc"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"price:asc"')]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),e("div",{staticClass:"language-json extra-class"},[e("pre",{pre:!0,attrs:{class:"language-json"}},[e("code",[e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"typo"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"words"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"proximity"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"attribute"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"exactness"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"reviews_rating:desc"')]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("//The ordering of inner elements of the sort ranking rule is made from the order of the `sort` query/request parameter.")]),t._v("\n "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v('"price:asc"')]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])]),e("h3",{attrs:{id:"iv-finalized-key-changes"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#iv-finalized-key-changes"}},[t._v("#")]),t._v(" IV. Finalized Key Changes")]),t._v(" "),e("ul",[e("li",[t._v("Add "),e("code",[t._v("sortableAttributes")]),t._v(" parameter in settings schema.")]),t._v(" "),e("li",[t._v("Add "),e("code",[t._v("sortable-attributes")]),t._v(" API ressource.")]),t._v(" "),e("li",[t._v("Add the "),e("code",[t._v("sort")]),t._v(" ranking rule after "),e("code",[t._v("attribute")]),t._v(" ranking rule by default to promote relevant sort.")]),t._v(" "),e("li",[t._v("Add "),e("code",[t._v("sort")]),t._v(" query/request parameter on "),e("code",[t._v("/search")]),t._v(" resource. Support "),e("code",[t._v("string")]),t._v(" and "),e("code",[t._v("number")]),t._v(". "),e("code",[t._v("string")]),t._v(" can be sorted in lexicographical order.")]),t._v(" "),e("li",[t._v("Change custom ranking rule format. e.g. "),e("code",[t._v("asc(price)")]),t._v(" become "),e("code",[t._v("price:asc")])]),t._v(" "),e("li",[t._v("Add a new error "),e("code",[t._v("invalid_sort")]),t._v(" similar to "),e("code",[t._v("invalid_filter")]),t._v(".")]),t._v(" "),e("li",[t._v("The numeric type is preferred to the string type by the "),e("code",[t._v("sort")]),t._v(" ranking rule. If an attribute has different types among the documents, those containing a numeric value will be placed before the documents containing a string value type.")]),t._v(" "),e("li",[t._v("A document not containing an attribute requested in the "),e("code",[t._v("sort")]),t._v(" parameter will be placed last during the tie-breaking of the "),e("code",[t._v("sort")]),t._v(" ranking-rule.")])]),t._v(" "),e("h2",{attrs:{id:"_2-technical-details"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-technical-details"}},[t._v("#")]),t._v(" 2. Technical details")]),t._v(" "),e("h3",{attrs:{id:"i-measuring"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#i-measuring"}},[t._v("#")]),t._v(" I. Measuring")]),t._v(" "),e("ul",[e("li",[t._v("Number of sorted attributes used in "),e("code",[t._v("sort")]),t._v(" search parameter to calculate an avg per server.")]),t._v(" "),e("li",[e("code",[t._v("ranking-rules")]),t._v(" setting definition to evaluate position customization.")]),t._v(" "),e("li",[t._v("Number of "),e("code",[t._v("sortableAttributes")]),t._v(" to calculate an avg per server.")])]),t._v(" "),e("h2",{attrs:{id:"_3-future-possibilities"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-future-possibilities"}},[t._v("#")]),t._v(" 3. Future Possibilities")]),t._v(" "),e("ul",[e("li",[t._v("Support sort on nested fields")]),t._v(" "),e("li",[t._v("Support computational functions avg, sum, min, max, median. For now, the workaround is to pre-compute values in the document before indexing and sort them at search time with a "),e("code",[t._v("sort")]),t._v(' on the pre-computed field. e.g. sort="precomputed_avg_price:desc".')]),t._v(" "),e("li",[t._v("Ability to set a custom ranking rules order at search time. Out of scope from the "),e("code",[t._v("sort")]),t._v(".")])])])}),[],!1,null,null,null);s.default=n.exports}}]); \ No newline at end of file diff --git a/docs/assets/js/25.96849fe5.js b/docs/assets/js/25.c49340ab.js similarity index 99% rename from docs/assets/js/25.96849fe5.js rename to docs/assets/js/25.c49340ab.js index 34fcd818a..f6ec885a7 100644 --- a/docs/assets/js/25.96849fe5.js +++ b/docs/assets/js/25.c49340ab.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[25],{448:function(e,t,a){"use strict";a.r(t);var s=a(62),r=Object(s.a)({},(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[a("ul",[a("li",[e._v("Title: Geosearch")]),e._v(" "),a("li",[e._v("Start Date: 2021-08-02")]),e._v(" "),a("li",[e._v("Specification PR: "),a("a",{attrs:{href:"https://github.com/meilisearch/specifications/pull/59",target:"_blank",rel:"noopener noreferrer"}},[e._v("#59"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Discovery Issue: "),a("a",{attrs:{href:"https://github.com/meilisearch/product/issues/42",target:"_blank",rel:"noopener noreferrer"}},[e._v("#42"),a("OutboundLink")],1)])]),e._v(" "),a("h1",{attrs:{id:"geosearch"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#geosearch"}},[e._v("#")]),e._v(" Geosearch")]),e._v(" "),a("h2",{attrs:{id:"_1-functional-specification"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-functional-specification"}},[e._v("#")]),e._v(" 1. Functional Specification")]),e._v(" "),a("h3",{attrs:{id:"i-summary"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#i-summary"}},[e._v("#")]),e._v(" I. Summary")]),e._v(" "),a("p",[e._v("The purpose of this specification is to add a first iteration of the "),a("strong",[e._v("geosearch")]),e._v(" feature to give geo-filtering and geosorting capabilities at search time.")]),e._v(" "),a("h4",{attrs:{id:"summary-key-points"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#summary-key-points"}},[e._v("#")]),e._v(" Summary Key points")]),e._v(" "),a("ul",[a("li",[e._v("Documents MUST have a "),a("code",[e._v("_geo")]),e._v(" reserved object to be geosearchable.")]),e._v(" "),a("li",[e._v("Filter documents by a given geo radius using the built-in filter "),a("code",[e._v("_geoRadius({lat}, {lng}, {distance_in_meters})")]),e._v(".")]),e._v(" "),a("li",[e._v("Filter documents by a given geo bounding box using the built-in filter "),a("code",[e._v("_geoBoundingBox([{lat}, {lng}], [{lat, lng}])")]),e._v(". The first pair of coordinates represents the top right corner of the bounding box, while the second pair represents the bottom left corner.")]),e._v(" "),a("li",[e._v("It is possible to cumulate several geosearch filters within the "),a("code",[e._v("filter")]),e._v(" field.")]),e._v(" "),a("li",[e._v("Sort documents in ascending/descending order around a geo point. e.g. "),a("code",[e._v("_geoPoint({lat}, {lng}):asc")]),e._v(".")]),e._v(" "),a("li",[e._v("It is possible to filter and/or sort by geographical criteria of the user's choice.")]),e._v(" "),a("li",[a("code",[e._v("_geo")]),e._v(" must be set as a filterable attribute to use geo filtering capabilities.")]),e._v(" "),a("li",[a("code",[e._v("_geo")]),e._v(" must be set as a sortable attribute to use geo sort capabilities.")]),e._v(" "),a("li",[e._v("There is no "),a("code",[e._v("geo")]),e._v(" ranking rule that can be manipulated by the user. This one is automatically integrated in the ranking rule "),a("code",[e._v("sort")]),e._v(" by default and activated by sorting using the "),a("code",[e._v("_geoPoint({lat}, {lng})")]),e._v(" built-in sort rule.")]),e._v(" "),a("li",[e._v("Using "),a("code",[e._v("_geoPoint({lat}, {lng})")]),e._v(" in the "),a("code",[e._v("sort")]),e._v(" parameter at search leads the engine to return a "),a("code",[e._v("_geoDistance")]),e._v(" within the search results. This field represents the distance in meters of the document from the specified "),a("code",[e._v("_geoPoint")]),e._v(".")])]),e._v(" "),a("h3",{attrs:{id:"ii-motivation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#ii-motivation"}},[e._v("#")]),e._v(" II. Motivation")]),e._v(" "),a("p",[e._v("According to our user feedback, the lack of a geosearch feature is mentioned as one of the biggest deal-breakers for choosing MeiliSearch as a search engine. A search engine must offer this feature. Some use cases specifically require integrated geosearch capabilities. Moreover, a lot of direct competitors offer it. Users today must find workarounds like using geohash to be able to geosearch documents. We hope to better serve the needs of users by implementing this feature. It allows multiplying the use-cases to which MeiliSearch can respond.")]),e._v(" "),a("h3",{attrs:{id:"iii-technical-explanations"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#iii-technical-explanations"}},[e._v("#")]),e._v(" III. Technical Explanations")]),e._v(" "),a("h4",{attrs:{id:"as-a-developer-i-want-to-add-geospatial-coordinates-to-a-document-so-that-the-document-can-be-geosearchable"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#as-a-developer-i-want-to-add-geospatial-coordinates-to-a-document-so-that-the-document-can-be-geosearchable"}},[e._v("#")]),e._v(" "),a("strong",[e._v("As a developer, I want to add geospatial coordinates to a document so that the document can be geosearchable.")])]),e._v(" "),a("ul",[a("li",[e._v("Introduce a reserved field "),a("code",[e._v("_geo")]),e._v(" for documents to store geo spatial data from an "),a("strong",[e._v("object")]),e._v(" made of "),a("code",[e._v("lat")]),e._v(" and "),a("code",[e._v("lng")]),e._v(" fields for a "),a("strong",[e._v("JSON format")]),e._v(". If the "),a("code",[e._v("_geo")]),e._v(" field is set to "),a("code",[e._v("null")]),e._v(", my document won't be geosearchable.")]),e._v(" "),a("li",[e._v("Introduce a reserved column "),a("code",[e._v("_geo")]),e._v(" for documents to store geo spatial data from a "),a("strong",[e._v("string")]),e._v(" made of "),a("code",[e._v("lat,lng")]),e._v(" for a "),a("strong",[e._v("CSV format")]),e._v(".")])]),e._v(" "),a("h5",{attrs:{id:"json-format"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#json-format"}},[e._v("#")]),e._v(" "),a("strong",[e._v("JSON Format")])]),e._v(" "),a("p",[a("strong",[a("code",[e._v("_geo")]),e._v(" field definition")])]),e._v(" "),a("ul",[a("li",[e._v("Name: "),a("code",[e._v("_geo")])]),e._v(" "),a("li",[e._v("Type: Object")]),e._v(" "),a("li",[e._v("Format: "),a("code",[e._v("{lat:number|string, lng:number|string}")])]),e._v(" "),a("li",[e._v("Not required")])]),e._v(" "),a("blockquote",[a("p",[e._v("💡 if "),a("code",[e._v("_geo")]),e._v(" is found in the document payload, "),a("code",[e._v("lat")]),e._v(" and "),a("code",[e._v("lng")]),e._v(" are required.\n💡 "),a("code",[e._v("lat")]),e._v(" and "),a("code",[e._v("lng")]),e._v(" must be of float value.\n💡 "),a("code",[e._v("lat")]),e._v(" and "),a("code",[e._v("lng")]),e._v(" field type can be mixed. e.g. "),a("code",[e._v("lat")]),e._v(" can be a string while "),a("code",[e._v("lng")]),e._v(" is a number in the same "),a("code",[e._v("_geo")]),e._v(" object.")])]),e._v(" "),a("h5",{attrs:{id:"csv-format"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#csv-format"}},[e._v("#")]),e._v(" "),a("strong",[e._v("CSV Format")])]),e._v(" "),a("p",[e._v("Following the format already defined in the https://github.com/meilisearch/specifications/pull/28/files specification for document indexing from a CSV format. A reserved column "),a("code",[e._v("_geo")]),e._v(" can be added to specify the geographical coordinates of a document.")]),e._v(" "),a("p",[e._v("csv format example")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('"id:number","label","brand","_geo"\n"1","F40","Ferrari","48.862725,2.287592"\n')])])]),a("p",[a("strong",[a("code",[e._v("_geo")]),e._v(" column definition")])]),e._v(" "),a("ul",[a("li",[e._v("Name: "),a("code",[e._v("_geo")])]),e._v(" "),a("li",[e._v("Type: String")]),e._v(" "),a("li",[e._v("Format: "),a("code",[e._v('"lat:float,lng:float"')])]),e._v(" "),a("li",[e._v("Not required")])]),e._v(" "),a("h4",{attrs:{id:"post-add-or-replace-documents-indexes-indexuid-documents"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#post-add-or-replace-documents-indexes-indexuid-documents"}},[e._v("#")]),e._v(" POST Add or replace documents "),a("code",[e._v("/indexes/{indexUid}/documents")])]),e._v(" "),a("h5",{attrs:{id:"request-body"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#request-body"}},[e._v("#")]),e._v(" Request body")]),e._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"id"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"label"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"F40"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"brand"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"Ferrari"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"_geo"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"lat"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("48.862725")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"lng"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("2.287592")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n")])])]),a("h5",{attrs:{id:"_202-accepted-response-body"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_202-accepted-response-body"}},[e._v("#")]),e._v(" 202 Accepted - Response body")]),e._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"updateId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("1")]),e._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),a("h4",{attrs:{id:"put-add-or-replace-documents-indexes-indexuid-documents"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#put-add-or-replace-documents-indexes-indexuid-documents"}},[e._v("#")]),e._v(" PUT Add or replace documents "),a("code",[e._v("/indexes/{indexUid}/documents")])]),e._v(" "),a("h5",{attrs:{id:"request-body-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#request-body-2"}},[e._v("#")]),e._v(" Request body")]),e._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"id"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"brand"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"F40 LM"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"brand"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"Ferrari"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"_geo"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"lat"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"48.862725"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"lng"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"2.287592"')]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n")])])]),a("h5",{attrs:{id:"_202-accepted-response-body-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_202-accepted-response-body-2"}},[e._v("#")]),e._v(" 202 Accepted - Response body")]),e._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"updateId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("2")]),e._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),a("ul",[a("li",[e._v("🔴 Giving a bad formed "),a("code",[e._v("_geo")]),e._v(" that do not conform to the format causes the "),a("code",[e._v("task")]),e._v(" payload to fail and returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_document_geo_field"}},[e._v("invalid_document_geo_field")]),e._v(" error.")],1)]),e._v(" "),a("hr"),e._v(" "),a("h3",{attrs:{id:"as-an-end-user-i-want-to-filter-documents-within-a-geo-radius"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#as-an-end-user-i-want-to-filter-documents-within-a-geo-radius"}},[e._v("#")]),e._v(" "),a("strong",[e._v("As an end-user, I want to filter documents within a geo radius.")])]),e._v(" "),a("ul",[a("li",[e._v("Introduce a "),a("code",[e._v("_geoRadius({lat}, {lng}, {distance_in_meters})")]),e._v(" built-in filter rule to "),a("code",[e._v("filter")]),e._v(" documents in a geo radius.shape.")])]),e._v(" "),a("p",[a("strong",[a("code",[e._v("_geoRadius")]),e._v(" built-in filter rule definition")])]),e._v(" "),a("ul",[a("li",[e._v("Name: "),a("code",[e._v("_geoRadius")])]),e._v(" "),a("li",[e._v("Signature: ({lat:float}:required, {lng:float}:required, {distance_in_meters:int}:required)")]),e._v(" "),a("li",[e._v("Not required")]),e._v(" "),a("li",[a("code",[e._v("distance_in_meters")]),e._v(" only accepts positive value.")])]),e._v(" "),a("blockquote",[a("p",[e._v("The "),a("code",[e._v("_geo")]),e._v(" field has to be set in "),a("code",[e._v("filterableAttributes")]),e._v(" setting by the developer to activate geo filtering capabilities at search.")])]),e._v(" "),a("p",[a("strong",[a("code",[e._v("_geoBoundingBox")]),e._v(" built-in filter rule definition")])]),e._v(" "),a("ul",[a("li",[e._v("Name: "),a("code",[e._v("_geoBoundingBox")])]),e._v(" "),a("li",[e._v("Signature: ([{lat:float}:required, {lng:float}:required)], [{lat:float}:required, {lng:float}:required])")]),e._v(" "),a("li",[e._v("Not required")])]),e._v(" "),a("p",[e._v("The first pair of coordinates represents the top right corner of the bounding box, while the second pair represents the bottom left corner.")]),e._v(" "),a("blockquote",[a("p",[e._v("The "),a("code",[e._v("_geo")]),e._v(" field has to be set in "),a("code",[e._v("filterableAttributes")]),e._v(" setting by the developer to activate geo filtering capabilities at search.")])]),e._v(" "),a("h4",{attrs:{id:"get-search-indexes-indexuid-search"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#get-search-indexes-indexuid-search"}},[e._v("#")]),e._v(" GET Search "),a("code",[e._v("/indexes/{indexUid}/search")])]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('...&filter="brand=Mercedes AND _geoRadius(48.862725, 2.287592, 2000)"`\n')])])]),a("h4",{attrs:{id:"post-search-indexes-indexuid-search"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#post-search-indexes-indexuid-search"}},[e._v("#")]),e._v(" POST Search "),a("code",[e._v("/indexes/{indexUid}/search")])]),e._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"filter"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"brand = Ferrari"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"_geoRadius(48.862725, 2.287592, 2000)"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),a("ul",[a("li",[e._v("🔴 Specifying parameters that do not conform to the "),a("code",[e._v("_geoRadius")]),e._v(" or "),a("code",[e._v("_geoBoundingBox")]),e._v(" signature causes the API to return an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_search_parameter_filter"}},[e._v("invalid_search_parameter_filter")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Using "),a("code",[e._v("_geoDistance")]),e._v(", "),a("code",[e._v("_geo")]),e._v(" or "),a("code",[e._v("_geoPoint")]),e._v(" in a filter expression causes the API to return an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_search_parameter_filter"}},[e._v("invalid_search_parameter_filter")]),e._v(" error.")],1)]),e._v(" "),a("hr"),e._v(" "),a("h3",{attrs:{id:"as-an-end-user-i-want-to-sort-documents-around-a-geo-point"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#as-an-end-user-i-want-to-sort-documents-around-a-geo-point"}},[e._v("#")]),e._v(" "),a("strong",[e._v("As an end-user, I want to sort documents around a geo point.")])]),e._v(" "),a("ul",[a("li",[e._v("Introduce a "),a("code",[e._v("_geoPoint({lat}, {lng})")]),e._v(" function parameter to "),a("code",[e._v("sort")]),e._v(" documents around a central point.")])]),e._v(" "),a("p",[a("strong",[a("code",[e._v("_geoPoint")]),e._v(" built-in sort rule definition")])]),e._v(" "),a("ul",[a("li",[e._v("Name: "),a("code",[e._v("_geoPoint")])]),e._v(" "),a("li",[e._v("Signature: ({lat:float}:required, {lng:float}:required)")]),e._v(" "),a("li",[e._v("Not required")])]),e._v(" "),a("p",[e._v("Following the "),a("a",{attrs:{href:"https://github.com/meilisearch/specifications/pull/55",target:"_blank",rel:"noopener noreferrer"}},[a("code",[e._v("sort")]),e._v(" specification feature"),a("OutboundLink")],1),e._v(":")]),e._v(" "),a("blockquote",[a("p",[e._v("The "),a("code",[e._v("_geo")]),e._v(" field has to be set in "),a("code",[e._v("sortableAttributes")]),e._v(" setting by the developer to activate geo sorting capabilities at search.")]),e._v(" "),a("p",[e._v("There is no "),a("code",[e._v("geo")]),e._v(" ranking rule as such. It is in fact within the "),a("code",[e._v("sort")]),e._v(" ranking rule in an obfuscated way.")]),e._v(" "),a("p",[a("code",[e._v("_geoPoint")]),e._v(" built-in sort rule can sort documents in ascending/descending order.")])]),e._v(" "),a("h4",{attrs:{id:"get-search-indexes-indexuid-search-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#get-search-indexes-indexuid-search-2"}},[e._v("#")]),e._v(" GET Search "),a("code",[e._v("/indexes/{indexUid}/search")])]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v(" ...&sort=_geoPoint({lat, lng}):asc,price:desc\n")])])]),a("h4",{attrs:{id:"post-search-indexes-indexuid-search-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#post-search-indexes-indexuid-search-2"}},[e._v("#")]),e._v(" POST Search "),a("code",[e._v("/indexes/{indexUid}/search")])]),e._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"sort"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"_geoPoint({lat, lng}):asc,price:desc"')]),e._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),a("ul",[a("li",[e._v("🔴 Specifying parameters that do not conform to the "),a("code",[e._v("_geoPoint")]),e._v(" signature causes the API to return an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_search_parameter_sort"}},[e._v("invalid_search_parameter_sort")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Using "),a("code",[e._v("_geoDistance")]),e._v(", "),a("code",[e._v("_geo")]),e._v(", "),a("code",[e._v("_geoRadius")]),e._v(" or "),a("code",[e._v("_geoBoundingBox")]),e._v(" in a sort expression causes the API to return an"),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_search_parameter_sort"}},[e._v("invalid_search_parameter_sort")]),e._v(" error.")],1)]),e._v(" "),a("hr"),e._v(" "),a("h3",{attrs:{id:"as-an-end-user-i-want-to-know-the-document-distance-when-i-am-sorting-around-a-geo-point"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#as-an-end-user-i-want-to-know-the-document-distance-when-i-am-sorting-around-a-geo-point"}},[e._v("#")]),e._v(" "),a("strong",[e._v("As an end-user, I want to know the document distance when I am sorting around a geo point.")])]),e._v(" "),a("ul",[a("li",[e._v("Introduce a "),a("code",[e._v("_geoDistance")]),e._v(" parameter to the search result "),a("code",[e._v("hit")]),e._v(" object.")])]),e._v(" "),a("p",[a("strong",[a("code",[e._v("_geoDistance")]),e._v(" field definition")])]),e._v(" "),a("ul",[a("li",[e._v("Name: "),a("code",[e._v("_geoDistance")])]),e._v(" "),a("li",[e._v("Description: Return document distance when the end-user sorts document from a "),a("code",[e._v("_geoPoint")]),e._v(" in meters.")]),e._v(" "),a("li",[e._v("Type: int")]),e._v(" "),a("li",[e._v("Not required")])]),e._v(" "),a("blockquote",[a("p",[e._v("💡 "),a("code",[e._v("_geoDistance")]),e._v(" response field is only computed and shown when the end-user have sorted documents around a "),a("code",[e._v("_geoPoint")]),e._v(". So if the end-user filters documents using a "),a("code",[e._v("_geoRadius/_geoBoundingBox")]),e._v(" built-in filter without sorting them around a "),a("code",[e._v("_geoPoint")]),e._v(", this field "),a("code",[e._v("_geoDistance")]),e._v(" will not appear in the search response.")])]),e._v(" "),a("hr"),e._v(" "),a("h4",{attrs:{id:"related-ranking-rules-settings-api-errors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#related-ranking-rules-settings-api-errors"}},[e._v("#")]),e._v(" Related Ranking Rules Settings API Errors")]),e._v(" "),a("ul",[a("li",[e._v("🔴 Specifying a custom ranking rule with "),a("code",[e._v("_geo")]),e._v(", "),a("code",[e._v("_geoDistance")]),e._v(", "),a("code",[e._v("_geoPoint")]),e._v(", "),a("code",[e._v("_geoRadius")]),e._v(" or "),a("code",[e._v("_geoBoundinBox")]),e._v(" returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_settings_ranking_rules"}},[e._v("invalid_settings_ranking_rules")]),e._v(" error.")],1)]),e._v(" "),a("hr"),e._v(" "),a("h2",{attrs:{id:"_2-technical-aspects"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-technical-aspects"}},[e._v("#")]),e._v(" 2. Technical Aspects")]),e._v(" "),a("h3",{attrs:{id:"i-measuring"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#i-measuring"}},[e._v("#")]),e._v(" I. Measuring")]),e._v(" "),a("ul",[a("li",[a("code",[e._v("filterableAttribute")]),e._v(" setting definition to evaluate "),a("code",[e._v("_geo")]),e._v(" presence.")]),e._v(" "),a("li",[a("code",[e._v("sortableAttribute")]),e._v(" setting definition to evaluate "),a("code",[e._v("_geo")]),e._v(" presence.")])]),e._v(" "),a("h2",{attrs:{id:"_3-future-possibilities"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-future-possibilities"}},[e._v("#")]),e._v(" 3. Future Possibilities")]),e._v(" "),a("ul",[a("li",[e._v("Add built-in filter to filter documents within "),a("code",[e._v("polygon")]),e._v(".")]),e._v(" "),a("li",[e._v("Handling array of geo points in the document object.")]),e._v(" "),a("li",[e._v("Handling distance in other formats (like the imperial format). "),a("strong",[e._v("It's easy to implement on the user side though.")])]),e._v(" "),a("li",[e._v("Handling position in other formats. It seems that "),a("a",{attrs:{href:"https://www.pacioos.hawaii.edu/voyager-news/lat-long-formats/",target:"_blank",rel:"noopener noreferrer"}},[e._v("degrees and minutes"),a("OutboundLink")],1),e._v(" are also used a lot. "),a("strong",[e._v("It's easy to implement on the user side though.")])])])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[25],{451:function(e,t,a){"use strict";a.r(t);var s=a(62),r=Object(s.a)({},(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[a("ul",[a("li",[e._v("Title: Geosearch")]),e._v(" "),a("li",[e._v("Start Date: 2021-08-02")]),e._v(" "),a("li",[e._v("Specification PR: "),a("a",{attrs:{href:"https://github.com/meilisearch/specifications/pull/59",target:"_blank",rel:"noopener noreferrer"}},[e._v("#59"),a("OutboundLink")],1)]),e._v(" "),a("li",[e._v("Discovery Issue: "),a("a",{attrs:{href:"https://github.com/meilisearch/product/issues/42",target:"_blank",rel:"noopener noreferrer"}},[e._v("#42"),a("OutboundLink")],1)])]),e._v(" "),a("h1",{attrs:{id:"geosearch"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#geosearch"}},[e._v("#")]),e._v(" Geosearch")]),e._v(" "),a("h2",{attrs:{id:"_1-functional-specification"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-functional-specification"}},[e._v("#")]),e._v(" 1. Functional Specification")]),e._v(" "),a("h3",{attrs:{id:"i-summary"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#i-summary"}},[e._v("#")]),e._v(" I. Summary")]),e._v(" "),a("p",[e._v("The purpose of this specification is to add a first iteration of the "),a("strong",[e._v("geosearch")]),e._v(" feature to give geo-filtering and geosorting capabilities at search time.")]),e._v(" "),a("h4",{attrs:{id:"summary-key-points"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#summary-key-points"}},[e._v("#")]),e._v(" Summary Key points")]),e._v(" "),a("ul",[a("li",[e._v("Documents MUST have a "),a("code",[e._v("_geo")]),e._v(" reserved object to be geosearchable.")]),e._v(" "),a("li",[e._v("Filter documents by a given geo radius using the built-in filter "),a("code",[e._v("_geoRadius({lat}, {lng}, {distance_in_meters})")]),e._v(".")]),e._v(" "),a("li",[e._v("Filter documents by a given geo bounding box using the built-in filter "),a("code",[e._v("_geoBoundingBox([{lat}, {lng}], [{lat, lng}])")]),e._v(". The first pair of coordinates represents the top right corner of the bounding box, while the second pair represents the bottom left corner.")]),e._v(" "),a("li",[e._v("It is possible to cumulate several geosearch filters within the "),a("code",[e._v("filter")]),e._v(" field.")]),e._v(" "),a("li",[e._v("Sort documents in ascending/descending order around a geo point. e.g. "),a("code",[e._v("_geoPoint({lat}, {lng}):asc")]),e._v(".")]),e._v(" "),a("li",[e._v("It is possible to filter and/or sort by geographical criteria of the user's choice.")]),e._v(" "),a("li",[a("code",[e._v("_geo")]),e._v(" must be set as a filterable attribute to use geo filtering capabilities.")]),e._v(" "),a("li",[a("code",[e._v("_geo")]),e._v(" must be set as a sortable attribute to use geo sort capabilities.")]),e._v(" "),a("li",[e._v("There is no "),a("code",[e._v("geo")]),e._v(" ranking rule that can be manipulated by the user. This one is automatically integrated in the ranking rule "),a("code",[e._v("sort")]),e._v(" by default and activated by sorting using the "),a("code",[e._v("_geoPoint({lat}, {lng})")]),e._v(" built-in sort rule.")]),e._v(" "),a("li",[e._v("Using "),a("code",[e._v("_geoPoint({lat}, {lng})")]),e._v(" in the "),a("code",[e._v("sort")]),e._v(" parameter at search leads the engine to return a "),a("code",[e._v("_geoDistance")]),e._v(" within the search results. This field represents the distance in meters of the document from the specified "),a("code",[e._v("_geoPoint")]),e._v(".")])]),e._v(" "),a("h3",{attrs:{id:"ii-motivation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#ii-motivation"}},[e._v("#")]),e._v(" II. Motivation")]),e._v(" "),a("p",[e._v("According to our user feedback, the lack of a geosearch feature is mentioned as one of the biggest deal-breakers for choosing MeiliSearch as a search engine. A search engine must offer this feature. Some use cases specifically require integrated geosearch capabilities. Moreover, a lot of direct competitors offer it. Users today must find workarounds like using geohash to be able to geosearch documents. We hope to better serve the needs of users by implementing this feature. It allows multiplying the use-cases to which MeiliSearch can respond.")]),e._v(" "),a("h3",{attrs:{id:"iii-technical-explanations"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#iii-technical-explanations"}},[e._v("#")]),e._v(" III. Technical Explanations")]),e._v(" "),a("h4",{attrs:{id:"as-a-developer-i-want-to-add-geospatial-coordinates-to-a-document-so-that-the-document-can-be-geosearchable"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#as-a-developer-i-want-to-add-geospatial-coordinates-to-a-document-so-that-the-document-can-be-geosearchable"}},[e._v("#")]),e._v(" "),a("strong",[e._v("As a developer, I want to add geospatial coordinates to a document so that the document can be geosearchable.")])]),e._v(" "),a("ul",[a("li",[e._v("Introduce a reserved field "),a("code",[e._v("_geo")]),e._v(" for documents to store geo spatial data from an "),a("strong",[e._v("object")]),e._v(" made of "),a("code",[e._v("lat")]),e._v(" and "),a("code",[e._v("lng")]),e._v(" fields for a "),a("strong",[e._v("JSON format")]),e._v(". If the "),a("code",[e._v("_geo")]),e._v(" field is set to "),a("code",[e._v("null")]),e._v(", my document won't be geosearchable.")]),e._v(" "),a("li",[e._v("Introduce a reserved column "),a("code",[e._v("_geo")]),e._v(" for documents to store geo spatial data from a "),a("strong",[e._v("string")]),e._v(" made of "),a("code",[e._v("lat,lng")]),e._v(" for a "),a("strong",[e._v("CSV format")]),e._v(".")])]),e._v(" "),a("h5",{attrs:{id:"json-format"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#json-format"}},[e._v("#")]),e._v(" "),a("strong",[e._v("JSON Format")])]),e._v(" "),a("p",[a("strong",[a("code",[e._v("_geo")]),e._v(" field definition")])]),e._v(" "),a("ul",[a("li",[e._v("Name: "),a("code",[e._v("_geo")])]),e._v(" "),a("li",[e._v("Type: Object")]),e._v(" "),a("li",[e._v("Format: "),a("code",[e._v("{lat:number|string, lng:number|string}")])]),e._v(" "),a("li",[e._v("Not required")])]),e._v(" "),a("blockquote",[a("p",[e._v("💡 if "),a("code",[e._v("_geo")]),e._v(" is found in the document payload, "),a("code",[e._v("lat")]),e._v(" and "),a("code",[e._v("lng")]),e._v(" are required.\n💡 "),a("code",[e._v("lat")]),e._v(" and "),a("code",[e._v("lng")]),e._v(" must be of float value.\n💡 "),a("code",[e._v("lat")]),e._v(" and "),a("code",[e._v("lng")]),e._v(" field type can be mixed. e.g. "),a("code",[e._v("lat")]),e._v(" can be a string while "),a("code",[e._v("lng")]),e._v(" is a number in the same "),a("code",[e._v("_geo")]),e._v(" object.")])]),e._v(" "),a("h5",{attrs:{id:"csv-format"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#csv-format"}},[e._v("#")]),e._v(" "),a("strong",[e._v("CSV Format")])]),e._v(" "),a("p",[e._v("Following the format already defined in the https://github.com/meilisearch/specifications/pull/28/files specification for document indexing from a CSV format. A reserved column "),a("code",[e._v("_geo")]),e._v(" can be added to specify the geographical coordinates of a document.")]),e._v(" "),a("p",[e._v("csv format example")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('"id:number","label","brand","_geo"\n"1","F40","Ferrari","48.862725,2.287592"\n')])])]),a("p",[a("strong",[a("code",[e._v("_geo")]),e._v(" column definition")])]),e._v(" "),a("ul",[a("li",[e._v("Name: "),a("code",[e._v("_geo")])]),e._v(" "),a("li",[e._v("Type: String")]),e._v(" "),a("li",[e._v("Format: "),a("code",[e._v('"lat:float,lng:float"')])]),e._v(" "),a("li",[e._v("Not required")])]),e._v(" "),a("h4",{attrs:{id:"post-add-or-replace-documents-indexes-indexuid-documents"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#post-add-or-replace-documents-indexes-indexuid-documents"}},[e._v("#")]),e._v(" POST Add or replace documents "),a("code",[e._v("/indexes/{indexUid}/documents")])]),e._v(" "),a("h5",{attrs:{id:"request-body"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#request-body"}},[e._v("#")]),e._v(" Request body")]),e._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"id"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"label"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"F40"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"brand"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"Ferrari"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"_geo"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"lat"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("48.862725")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"lng"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("2.287592")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n")])])]),a("h5",{attrs:{id:"_202-accepted-response-body"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_202-accepted-response-body"}},[e._v("#")]),e._v(" 202 Accepted - Response body")]),e._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"updateId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("1")]),e._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),a("h4",{attrs:{id:"put-add-or-replace-documents-indexes-indexuid-documents"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#put-add-or-replace-documents-indexes-indexuid-documents"}},[e._v("#")]),e._v(" PUT Add or replace documents "),a("code",[e._v("/indexes/{indexUid}/documents")])]),e._v(" "),a("h5",{attrs:{id:"request-body-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#request-body-2"}},[e._v("#")]),e._v(" Request body")]),e._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"id"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"brand"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"F40 LM"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"brand"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"Ferrari"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"_geo"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"lat"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"48.862725"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"lng"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"2.287592"')]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n")])])]),a("h5",{attrs:{id:"_202-accepted-response-body-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_202-accepted-response-body-2"}},[e._v("#")]),e._v(" 202 Accepted - Response body")]),e._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"updateId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("2")]),e._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),a("ul",[a("li",[e._v("🔴 Giving a bad formed "),a("code",[e._v("_geo")]),e._v(" that do not conform to the format causes the "),a("code",[e._v("task")]),e._v(" payload to fail and returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_document_geo_field"}},[e._v("invalid_document_geo_field")]),e._v(" error.")],1)]),e._v(" "),a("hr"),e._v(" "),a("h3",{attrs:{id:"as-an-end-user-i-want-to-filter-documents-within-a-geo-radius"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#as-an-end-user-i-want-to-filter-documents-within-a-geo-radius"}},[e._v("#")]),e._v(" "),a("strong",[e._v("As an end-user, I want to filter documents within a geo radius.")])]),e._v(" "),a("ul",[a("li",[e._v("Introduce a "),a("code",[e._v("_geoRadius({lat}, {lng}, {distance_in_meters})")]),e._v(" built-in filter rule to "),a("code",[e._v("filter")]),e._v(" documents in a geo radius.shape.")])]),e._v(" "),a("p",[a("strong",[a("code",[e._v("_geoRadius")]),e._v(" built-in filter rule definition")])]),e._v(" "),a("ul",[a("li",[e._v("Name: "),a("code",[e._v("_geoRadius")])]),e._v(" "),a("li",[e._v("Signature: ({lat:float}:required, {lng:float}:required, {distance_in_meters:int}:required)")]),e._v(" "),a("li",[e._v("Not required")]),e._v(" "),a("li",[a("code",[e._v("distance_in_meters")]),e._v(" only accepts positive value.")])]),e._v(" "),a("blockquote",[a("p",[e._v("The "),a("code",[e._v("_geo")]),e._v(" field has to be set in "),a("code",[e._v("filterableAttributes")]),e._v(" setting by the developer to activate geo filtering capabilities at search.")])]),e._v(" "),a("p",[a("strong",[a("code",[e._v("_geoBoundingBox")]),e._v(" built-in filter rule definition")])]),e._v(" "),a("ul",[a("li",[e._v("Name: "),a("code",[e._v("_geoBoundingBox")])]),e._v(" "),a("li",[e._v("Signature: ([{lat:float}:required, {lng:float}:required)], [{lat:float}:required, {lng:float}:required])")]),e._v(" "),a("li",[e._v("Not required")])]),e._v(" "),a("p",[e._v("The first pair of coordinates represents the top right corner of the bounding box, while the second pair represents the bottom left corner.")]),e._v(" "),a("blockquote",[a("p",[e._v("The "),a("code",[e._v("_geo")]),e._v(" field has to be set in "),a("code",[e._v("filterableAttributes")]),e._v(" setting by the developer to activate geo filtering capabilities at search.")])]),e._v(" "),a("h4",{attrs:{id:"get-search-indexes-indexuid-search"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#get-search-indexes-indexuid-search"}},[e._v("#")]),e._v(" GET Search "),a("code",[e._v("/indexes/{indexUid}/search")])]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('...&filter="brand=Mercedes AND _geoRadius(48.862725, 2.287592, 2000)"`\n')])])]),a("h4",{attrs:{id:"post-search-indexes-indexuid-search"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#post-search-indexes-indexuid-search"}},[e._v("#")]),e._v(" POST Search "),a("code",[e._v("/indexes/{indexUid}/search")])]),e._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"filter"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"brand = Ferrari"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"_geoRadius(48.862725, 2.287592, 2000)"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),a("ul",[a("li",[e._v("🔴 Specifying parameters that do not conform to the "),a("code",[e._v("_geoRadius")]),e._v(" or "),a("code",[e._v("_geoBoundingBox")]),e._v(" signature causes the API to return an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_search_parameter_filter"}},[e._v("invalid_search_parameter_filter")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Using "),a("code",[e._v("_geoDistance")]),e._v(", "),a("code",[e._v("_geo")]),e._v(" or "),a("code",[e._v("_geoPoint")]),e._v(" in a filter expression causes the API to return an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_search_parameter_filter"}},[e._v("invalid_search_parameter_filter")]),e._v(" error.")],1)]),e._v(" "),a("hr"),e._v(" "),a("h3",{attrs:{id:"as-an-end-user-i-want-to-sort-documents-around-a-geo-point"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#as-an-end-user-i-want-to-sort-documents-around-a-geo-point"}},[e._v("#")]),e._v(" "),a("strong",[e._v("As an end-user, I want to sort documents around a geo point.")])]),e._v(" "),a("ul",[a("li",[e._v("Introduce a "),a("code",[e._v("_geoPoint({lat}, {lng})")]),e._v(" function parameter to "),a("code",[e._v("sort")]),e._v(" documents around a central point.")])]),e._v(" "),a("p",[a("strong",[a("code",[e._v("_geoPoint")]),e._v(" built-in sort rule definition")])]),e._v(" "),a("ul",[a("li",[e._v("Name: "),a("code",[e._v("_geoPoint")])]),e._v(" "),a("li",[e._v("Signature: ({lat:float}:required, {lng:float}:required)")]),e._v(" "),a("li",[e._v("Not required")])]),e._v(" "),a("p",[e._v("Following the "),a("a",{attrs:{href:"https://github.com/meilisearch/specifications/pull/55",target:"_blank",rel:"noopener noreferrer"}},[a("code",[e._v("sort")]),e._v(" specification feature"),a("OutboundLink")],1),e._v(":")]),e._v(" "),a("blockquote",[a("p",[e._v("The "),a("code",[e._v("_geo")]),e._v(" field has to be set in "),a("code",[e._v("sortableAttributes")]),e._v(" setting by the developer to activate geo sorting capabilities at search.")]),e._v(" "),a("p",[e._v("There is no "),a("code",[e._v("geo")]),e._v(" ranking rule as such. It is in fact within the "),a("code",[e._v("sort")]),e._v(" ranking rule in an obfuscated way.")]),e._v(" "),a("p",[a("code",[e._v("_geoPoint")]),e._v(" built-in sort rule can sort documents in ascending/descending order.")])]),e._v(" "),a("h4",{attrs:{id:"get-search-indexes-indexuid-search-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#get-search-indexes-indexuid-search-2"}},[e._v("#")]),e._v(" GET Search "),a("code",[e._v("/indexes/{indexUid}/search")])]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v(" ...&sort=_geoPoint({lat, lng}):asc,price:desc\n")])])]),a("h4",{attrs:{id:"post-search-indexes-indexuid-search-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#post-search-indexes-indexuid-search-2"}},[e._v("#")]),e._v(" POST Search "),a("code",[e._v("/indexes/{indexUid}/search")])]),e._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"sort"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"_geoPoint({lat, lng}):asc,price:desc"')]),e._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),a("ul",[a("li",[e._v("🔴 Specifying parameters that do not conform to the "),a("code",[e._v("_geoPoint")]),e._v(" signature causes the API to return an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_search_parameter_sort"}},[e._v("invalid_search_parameter_sort")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Using "),a("code",[e._v("_geoDistance")]),e._v(", "),a("code",[e._v("_geo")]),e._v(", "),a("code",[e._v("_geoRadius")]),e._v(" or "),a("code",[e._v("_geoBoundingBox")]),e._v(" in a sort expression causes the API to return an"),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_search_parameter_sort"}},[e._v("invalid_search_parameter_sort")]),e._v(" error.")],1)]),e._v(" "),a("hr"),e._v(" "),a("h3",{attrs:{id:"as-an-end-user-i-want-to-know-the-document-distance-when-i-am-sorting-around-a-geo-point"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#as-an-end-user-i-want-to-know-the-document-distance-when-i-am-sorting-around-a-geo-point"}},[e._v("#")]),e._v(" "),a("strong",[e._v("As an end-user, I want to know the document distance when I am sorting around a geo point.")])]),e._v(" "),a("ul",[a("li",[e._v("Introduce a "),a("code",[e._v("_geoDistance")]),e._v(" parameter to the search result "),a("code",[e._v("hit")]),e._v(" object.")])]),e._v(" "),a("p",[a("strong",[a("code",[e._v("_geoDistance")]),e._v(" field definition")])]),e._v(" "),a("ul",[a("li",[e._v("Name: "),a("code",[e._v("_geoDistance")])]),e._v(" "),a("li",[e._v("Description: Return document distance when the end-user sorts document from a "),a("code",[e._v("_geoPoint")]),e._v(" in meters.")]),e._v(" "),a("li",[e._v("Type: int")]),e._v(" "),a("li",[e._v("Not required")])]),e._v(" "),a("blockquote",[a("p",[e._v("💡 "),a("code",[e._v("_geoDistance")]),e._v(" response field is only computed and shown when the end-user have sorted documents around a "),a("code",[e._v("_geoPoint")]),e._v(". So if the end-user filters documents using a "),a("code",[e._v("_geoRadius/_geoBoundingBox")]),e._v(" built-in filter without sorting them around a "),a("code",[e._v("_geoPoint")]),e._v(", this field "),a("code",[e._v("_geoDistance")]),e._v(" will not appear in the search response.")])]),e._v(" "),a("hr"),e._v(" "),a("h4",{attrs:{id:"related-ranking-rules-settings-api-errors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#related-ranking-rules-settings-api-errors"}},[e._v("#")]),e._v(" Related Ranking Rules Settings API Errors")]),e._v(" "),a("ul",[a("li",[e._v("🔴 Specifying a custom ranking rule with "),a("code",[e._v("_geo")]),e._v(", "),a("code",[e._v("_geoDistance")]),e._v(", "),a("code",[e._v("_geoPoint")]),e._v(", "),a("code",[e._v("_geoRadius")]),e._v(" or "),a("code",[e._v("_geoBoundinBox")]),e._v(" returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_settings_ranking_rules"}},[e._v("invalid_settings_ranking_rules")]),e._v(" error.")],1)]),e._v(" "),a("hr"),e._v(" "),a("h2",{attrs:{id:"_2-technical-aspects"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-technical-aspects"}},[e._v("#")]),e._v(" 2. Technical Aspects")]),e._v(" "),a("h3",{attrs:{id:"i-measuring"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#i-measuring"}},[e._v("#")]),e._v(" I. Measuring")]),e._v(" "),a("ul",[a("li",[a("code",[e._v("filterableAttribute")]),e._v(" setting definition to evaluate "),a("code",[e._v("_geo")]),e._v(" presence.")]),e._v(" "),a("li",[a("code",[e._v("sortableAttribute")]),e._v(" setting definition to evaluate "),a("code",[e._v("_geo")]),e._v(" presence.")])]),e._v(" "),a("h2",{attrs:{id:"_3-future-possibilities"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-future-possibilities"}},[e._v("#")]),e._v(" 3. Future Possibilities")]),e._v(" "),a("ul",[a("li",[e._v("Add built-in filter to filter documents within "),a("code",[e._v("polygon")]),e._v(".")]),e._v(" "),a("li",[e._v("Handling array of geo points in the document object.")]),e._v(" "),a("li",[e._v("Handling distance in other formats (like the imperial format). "),a("strong",[e._v("It's easy to implement on the user side though.")])]),e._v(" "),a("li",[e._v("Handling position in other formats. It seems that "),a("a",{attrs:{href:"https://www.pacioos.hawaii.edu/voyager-news/lat-long-formats/",target:"_blank",rel:"noopener noreferrer"}},[e._v("degrees and minutes"),a("OutboundLink")],1),e._v(" are also used a lot. "),a("strong",[e._v("It's easy to implement on the user side though.")])])])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file diff --git a/docs/assets/js/28.41999e7c.js b/docs/assets/js/28.d2c2cee7.js similarity index 97% rename from docs/assets/js/28.41999e7c.js rename to docs/assets/js/28.d2c2cee7.js index f0113a28c..80dbea0bd 100644 --- a/docs/assets/js/28.41999e7c.js +++ b/docs/assets/js/28.d2c2cee7.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[28],{453:function(t,i,e){"use strict";e.r(i);var s=e(62),a=Object(s.a)({},(function(){var t=this,i=t.$createElement,e=t._self._c||i;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("ul",[e("li",[t._v("Title: Words position limit")]),t._v(" "),e("li",[t._v("Start Date: 2021-10-06")]),t._v(" "),e("li",[t._v("Specification PR: "),e("a",{attrs:{href:"https://github.com/meilisearch/specifications/pull/77",target:"_blank",rel:"noopener noreferrer"}},[t._v("#77"),e("OutboundLink")],1)]),t._v(" "),e("li",[t._v("Discovery Issue: "),e("a",{attrs:{href:"https://github.com/meilisearch/product/issues/202",target:"_blank",rel:"noopener noreferrer"}},[t._v("#202"),e("OutboundLink")],1)])]),t._v(" "),e("h1",{attrs:{id:"words-position-limit"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#words-position-limit"}},[t._v("#")]),t._v(" Words position limit")]),t._v(" "),e("h2",{attrs:{id:"_1-functional-specification"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-functional-specification"}},[t._v("#")]),t._v(" 1. Functional Specification")]),t._v(" "),e("h3",{attrs:{id:"i-summary"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#i-summary"}},[t._v("#")]),t._v(" I. Summary")]),t._v(" "),e("p",[t._v("The purpose of this specification is to remove the limit of 1000 positions per attribute.")]),t._v(" "),e("h4",{attrs:{id:"summary-key-points"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#summary-key-points"}},[t._v("#")]),t._v(" Summary Key points")]),t._v(" "),e("ul",[e("li",[t._v("1000 positions limit per document field is now raised at 65535.")])]),t._v(" "),e("h3",{attrs:{id:"ii-motivation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#ii-motivation"}},[t._v("#")]),t._v(" II. Motivation")]),t._v(" "),e("p",[t._v("We've seen many users denormalizing fields into multiple fields to index all the words because of the initial limit. This change will increases the limit to 65535, which should greatly reduce frictions on this issue. We expect to reduce the changes to be made to the document schema in order to use MeiliSearch more quickly and easily.")]),t._v(" "),e("h3",{attrs:{id:"iii-technical-explanations"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#iii-technical-explanations"}},[t._v("#")]),t._v(" III. Technical Explanations")]),t._v(" "),e("p",[t._v("n/a")]),t._v(" "),e("h2",{attrs:{id:"_2-technical-aspects"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-technical-aspects"}},[t._v("#")]),t._v(" 2. Technical Aspects")]),t._v(" "),e("p",[t._v("When MeiliSearch indexes a document, it indexes several word positions per field until a limit is reached.")]),t._v(" "),e("p",[t._v("It is important to note that the limit is not strictly related to the number of words. Indeed, soft separators are also counted as "),e("code",[t._v("1")]),t._v(" position while hard separators are counted as "),e("code",[t._v("8")]),t._v(" positions.")]),t._v(" "),e("h2",{attrs:{id:"_3-future-possibilities"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-future-possibilities"}},[t._v("#")]),t._v(" 3. Future Possibilities")]),t._v(" "),e("ul",[e("li",[t._v("Expose a configurable default limit up to 65535.")])])])}),[],!1,null,null,null);i.default=a.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[28],{452:function(t,i,e){"use strict";e.r(i);var s=e(62),a=Object(s.a)({},(function(){var t=this,i=t.$createElement,e=t._self._c||i;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("ul",[e("li",[t._v("Title: Words position limit")]),t._v(" "),e("li",[t._v("Start Date: 2021-10-06")]),t._v(" "),e("li",[t._v("Specification PR: "),e("a",{attrs:{href:"https://github.com/meilisearch/specifications/pull/77",target:"_blank",rel:"noopener noreferrer"}},[t._v("#77"),e("OutboundLink")],1)]),t._v(" "),e("li",[t._v("Discovery Issue: "),e("a",{attrs:{href:"https://github.com/meilisearch/product/issues/202",target:"_blank",rel:"noopener noreferrer"}},[t._v("#202"),e("OutboundLink")],1)])]),t._v(" "),e("h1",{attrs:{id:"words-position-limit"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#words-position-limit"}},[t._v("#")]),t._v(" Words position limit")]),t._v(" "),e("h2",{attrs:{id:"_1-functional-specification"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_1-functional-specification"}},[t._v("#")]),t._v(" 1. Functional Specification")]),t._v(" "),e("h3",{attrs:{id:"i-summary"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#i-summary"}},[t._v("#")]),t._v(" I. Summary")]),t._v(" "),e("p",[t._v("The purpose of this specification is to remove the limit of 1000 positions per attribute.")]),t._v(" "),e("h4",{attrs:{id:"summary-key-points"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#summary-key-points"}},[t._v("#")]),t._v(" Summary Key points")]),t._v(" "),e("ul",[e("li",[t._v("1000 positions limit per document field is now raised at 65535.")])]),t._v(" "),e("h3",{attrs:{id:"ii-motivation"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#ii-motivation"}},[t._v("#")]),t._v(" II. Motivation")]),t._v(" "),e("p",[t._v("We've seen many users denormalizing fields into multiple fields to index all the words because of the initial limit. This change will increases the limit to 65535, which should greatly reduce frictions on this issue. We expect to reduce the changes to be made to the document schema in order to use MeiliSearch more quickly and easily.")]),t._v(" "),e("h3",{attrs:{id:"iii-technical-explanations"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#iii-technical-explanations"}},[t._v("#")]),t._v(" III. Technical Explanations")]),t._v(" "),e("p",[t._v("n/a")]),t._v(" "),e("h2",{attrs:{id:"_2-technical-aspects"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_2-technical-aspects"}},[t._v("#")]),t._v(" 2. Technical Aspects")]),t._v(" "),e("p",[t._v("When MeiliSearch indexes a document, it indexes several word positions per field until a limit is reached.")]),t._v(" "),e("p",[t._v("It is important to note that the limit is not strictly related to the number of words. Indeed, soft separators are also counted as "),e("code",[t._v("1")]),t._v(" position while hard separators are counted as "),e("code",[t._v("8")]),t._v(" positions.")]),t._v(" "),e("h2",{attrs:{id:"_3-future-possibilities"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#_3-future-possibilities"}},[t._v("#")]),t._v(" 3. Future Possibilities")]),t._v(" "),e("ul",[e("li",[t._v("Expose a configurable default limit up to 65535.")])])])}),[],!1,null,null,null);i.default=a.exports}}]); \ No newline at end of file diff --git a/docs/assets/js/29.a05f4317.js b/docs/assets/js/29.239d404a.js similarity index 99% rename from docs/assets/js/29.a05f4317.js rename to docs/assets/js/29.239d404a.js index 694a8b64d..0a1d80747 100644 --- a/docs/assets/js/29.a05f4317.js +++ b/docs/assets/js/29.239d404a.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[29],{452:function(e,t,a){"use strict";a.r(t);var s=a(62),r=Object(s.a)({},(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[a("h1",{attrs:{id:"api-keys"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#api-keys"}},[e._v("#")]),e._v(" API Keys")]),e._v(" "),a("h2",{attrs:{id:"_1-summary"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-summary"}},[e._v("#")]),e._v(" 1. Summary")]),e._v(" "),a("p",[e._v("API keys allows to define which actions and which indexes are accessible by the holder of an API key. The use of API keys allows to secure the access to the routes in a fine-grained manner of a Meilisearch instance.")]),e._v(" "),a("h2",{attrs:{id:"_2-motivation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-motivation"}},[e._v("#")]),e._v(" 2. Motivation")]),e._v(" "),a("p",[e._v("To make Meilisearch more reliable for teams and more adapted to production cases, we extend the management and the possibilities of restrictions regarding write and read requests on a Meilisearch instance by introducing a way to manage custom API keys.")]),e._v(" "),a("h2",{attrs:{id:"_3-functional-specification"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-functional-specification"}},[e._v("#")]),e._v(" 3. Functional Specification")]),e._v(" "),a("h3",{attrs:{id:"_3-1-glossary"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-glossary"}},[e._v("#")]),e._v(" 3.1. Glossary")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("Term")]),e._v(" "),a("th",[e._v("Definition")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("Master Key")]),e._v(" "),a("td",[e._v("This is the master key that allows managing API keys. The master key is defined by the user when launching Meilisearch, thus gives access to the "),a("code",[e._v("/keys")]),e._v(" API endpoint and requiring requests to be authorized.")])]),e._v(" "),a("tr",[a("td",[e._v("API Key")]),e._v(" "),a("td",[e._v("API keys are stored and managed from the endpoint "),a("code",[e._v("/keys")]),e._v(" by the master key holder.")])])])]),e._v(" "),a("h3",{attrs:{id:"_3-2-explanation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-explanation"}},[e._v("#")]),e._v(" 3.2. Explanation")]),e._v(" "),a("h4",{attrs:{id:"_3-2-1-summary-key-points"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-1-summary-key-points"}},[e._v("#")]),e._v(" 3.2.1 Summary Key Points")]),e._v(" "),a("ul",[a("li",[e._v("API keys management is restricted to the master key or API keys having "),a("code",[e._v("keys.get")]),e._v(", "),a("code",[e._v("keys.create")]),e._v(", "),a("code",[e._v("keys.update")]),e._v(", "),a("code",[e._v("keys.delete")]),e._v(" or "),a("code",[e._v("*")]),e._v(" actions.")]),e._v(" "),a("li",[e._v("API keys must be provided via the "),a("code",[e._v("Authorization")]),e._v(" header using the bearer method to authorize a request.")]),e._v(" "),a("li",[e._v("The value of the "),a("code",[e._v("key")]),e._v(" field of an API Key is generated from its "),a("code",[e._v("uid")]),e._v(" and the master key.")]),e._v(" "),a("li",[e._v("When a master key is set at Meilisearch first-launch, it generate two pre-configured default "),a("code",[e._v("API Key")]),e._v(" resources. A "),a("code",[e._v("Default Search API Key")]),e._v(" authorizing the search action on all indexes and a "),a("code",[e._v("Default Admin API Key")]),e._v(" authorizing all actions.")]),e._v(" "),a("li",[e._v("If the master-key changes, the "),a("code",[e._v("key")]),e._v(" field is re-generated.")]),e._v(" "),a("li",[e._v("Default API keys can be modified/deleted from the "),a("code",[e._v("/keys")]),e._v(" endpoints but are not re-created if Meilisearch has already created them.")]),e._v(" "),a("li",[e._v("API keys can have restrictions on which methods can be accessed via an "),a("code",[e._v("actions")]),e._v(" list; they also "),a("code",[e._v("expiresAt")]),e._v(" a specific date time and are restricted to a specific set of "),a("code",[e._v("indexes")]),e._v(".")]),e._v(" "),a("li",[a("code",[e._v("name")]),e._v(" and "),a("code",[e._v("description")]),e._v(" fields are the only editable fields of an API key.")]),e._v(" "),a("li",[e._v("API key resources are propagated to snapshots and dumps.")])]),e._v(" "),a("h4",{attrs:{id:"_3-2-2-master-key"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-2-master-key"}},[e._v("#")]),e._v(" 3.2.2. Master Key")]),e._v(" "),a("p",[e._v("The master key exists to secure a Meilisearch instance. As soon as a master key is set via the "),a("code",[e._v("MEILI_MASTER_KEY")]),e._v(" environment variable or the "),a("code",[e._v("--master-key")]),e._v(" CLI option, the endpoint "),a("code",[e._v("/keys")]),e._v(" is accessible for the master key holder. It can be seen as a super admin key; It must be securely shared only with people who have to manage the security of a Meilisearch instance.")]),e._v(" "),a("p",[e._v("This master key is not an API key, thus is not stored and fetchable from the "),a("code",[e._v("/keys")]),e._v(" API endpoint. It must be seen as a runtime lock that activates the security of Meilisearch as soon as an instance is launched with it. The master key should only be used to fetch API Keys the first time. The default Admin API key should be preferred to manage the API keys resources.")]),e._v(" "),a("p",[e._v("At the first launch of Meilisearch with a master key, Meilisearch automatically generates two default API keys to cover the basic needs a user may encounter. It generates a "),a("code",[e._v("Default Search API Key")]),e._v(" dedicated to the search that can be used on the client-side and a "),a("code",[e._v("Default Admin API Key")]),e._v(" to manipulate a MeiliSearch instance from a backend side.")]),e._v(" "),a("p",[e._v("If the master key is removed at Meilisearch launch, the previously generated API keys no longer secure the Meilisearch instance.")]),e._v(" "),a("p",[e._v("If Meilisearch is launched with the "),a("code",[e._v("production")]),e._v(" value for the "),a("code",[e._v("MEILI_ENV")]),e._v(" environment variable or the "),a("code",[e._v("--env")]),e._v(" CLI option, a master key of at least 16 bytes is mandatory.")]),e._v(" "),a("p",[e._v("If the master key is omitted in that particular case, or is too short, Meilisearch launch is aborted and displays an error.")]),e._v(" "),a("p",[e._v("If Meilisearch is launched with the "),a("code",[e._v("development")]),e._v(" value for the "),a("code",[e._v("MEILI_ENV")]),e._v(" environment variable or the "),a("code",[e._v("--env")]),e._v(" CLI option, Meilisearch displays warning messages given different cases.")]),e._v(" "),a("p",[e._v("See "),a("a",{attrs:{href:"0119-instance-options#334-master-key"}},[a("code",[e._v("MEILI_MASTER_KEY")]),e._v("/"),a("code",[e._v("--master-key")]),e._v(" launch option")]),e._v(".")]),e._v(" "),a("p",[e._v("The master key must be composed of valid utf-8 characters. It is advisable to enclose it in "),a("code",[e._v("'")]),e._v(" when specified via the "),a("code",[e._v("--master-key")]),e._v(" option.")]),e._v(" "),a("blockquote",[a("p",[e._v("🚨 The master key should never be exposed to the public as it may compromise a Meilisearch instance.")])]),e._v(" "),a("blockquote",[a("p",[e._v("🚨 If the value of the master key changes, all the previously generated "),a("code",[e._v("API Keys")]),e._v(" changes, thus allowing to invalidate the set of API keys previously generated by regenerating a different value for their "),a("code",[e._v("key")]),e._v(" field. This is particularly useful in the case where the master key might have been leaked and the user needs to re-generate the whole set of keys at once to re-secure the instance.")])]),e._v(" "),a("blockquote",[a("p",[e._v("The master key does not appear on the "),a("code",[e._v("/keys")]),e._v(" endpoints and can't be used to authorize requests other than on the "),a("code",[e._v("/keys")]),e._v(" endpoint.")])]),e._v(" "),a("blockquote",[a("p",[e._v("The only route not secured in the presence of a master key is the "),a("code",[e._v("/health")]),e._v(" route.")])]),e._v(" "),a("h4",{attrs:{id:"_3-2-3-default-api-keys"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-3-default-api-keys"}},[e._v("#")]),e._v(" 3.2.3. Default API Keys")]),e._v(" "),a("p",[e._v("The first time a Meilisearch instance is launched with a "),a("code",[e._v("master key")]),e._v(", Meilisearch will generate two API keys described below.")]),e._v(" "),a("p",[e._v("If the user changes the value of the master key later, these two default keys are not created again but the "),a("code",[e._v("key")]),e._v(" field is re-generated. However, these two API keys can be updated/deleted using the "),a("code",[e._v("/keys")]),e._v(" endpoints.")]),e._v(" "),a("p",[e._v("If these API keys are deleted, the engine should not create them again when Meilisearch is launched again with a master key.")]),e._v(" "),a("h5",{attrs:{id:"_3-2-3-1-default-search-api-key"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-3-1-default-search-api-key"}},[e._v("#")]),e._v(" 3.2.3.1. Default Search API Key")]),e._v(" "),a("p",[e._v("The "),a("code",[e._v("Default Search API key")]),e._v(" gives access to the search endpoints on all indexes.")]),e._v(" "),a("p",[e._v("Here is how the "),a("code",[e._v("Default Search API Key")]),e._v(" is represented after its generation.")]),e._v(" "),a("div",{staticClass:"language-jsonc extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "uid": "01b4bc42-eb33-4041-b481-254d00cce834", //auto-generated value\n "key": "0a6e572506c52ab0bd6195921575d23092b7f0c284ab4ac86d12346c33057f99", //auto-generated value\n "name": "Default Search API Key",\n "description": "Use it to search from the frontend",\n "actions": [\n "search"\n ],\n "indexes": [\n "*"\n ],\n "expiresAt": null,\n "createdAt": "2021-08-11T10:00:00Z",\n "updatedAt": "2021-08-11T10:00:00Z"\n}\n')])])]),a("h5",{attrs:{id:"_3-2-3-2-default-admin-api-key"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-3-2-default-admin-api-key"}},[e._v("#")]),e._v(" 3.2.3.2. Default Admin API Key")]),e._v(" "),a("p",[e._v("The "),a("code",[e._v("Default Admin API key")]),e._v(" gives access to all actions by default.")]),e._v(" "),a("p",[e._v("Here is how the "),a("code",[e._v("Default Admin API Key")]),e._v(" is represented after its generation.")]),e._v(" "),a("div",{staticClass:"language-jsonc extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "uid": "ac06a7e1-6956-4699-bb04-dbeb72a231df", //auto-generated value\n "key": "380689dd379232519a54d15935750cc7625620a2ea2fc06907cb40ba5b421b6f", //auto-generated value\n "name": "Default Admin API Key",\n "description": "Use it for anything that is not a search operation. Caution! Do not expose it on a public frontend",\n "actions": [\n "*"\n ],\n "indexes": [\n "*"\n ],\n "expiresAt": null,\n "createdAt": "2021-08-11T10:00:00Z",\n "updatedAt": "2021-08-11T10:00:00Z"\n}\n')])])]),a("h4",{attrs:{id:"_3-2-4-api-endpoints-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-api-endpoints-definition"}},[e._v("#")]),e._v(" 3.2.4. API Endpoints Definition")]),e._v(" "),a("p",[e._v("Manipulate API keys of a Meilisearch instance. "),a("code",[e._v("/keys")]),e._v(" endpoints are "),a("strong",[e._v("only accessible by the master key holder.")])]),e._v(" "),a("h5",{attrs:{id:"_3-2-4-1-api-key-resource-representation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-1-api-key-resource-representation"}},[e._v("#")]),e._v(" 3.2.4.1. "),a("code",[e._v("API Key")]),e._v(" Resource Representation")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("field")]),e._v(" "),a("th",[e._v("type")]),e._v(" "),a("th",[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("uid")]),e._v(" "),a("td",[e._v("string")]),e._v(" "),a("td",[e._v("A unique identifier represented by a uuid v4. Can be specified at creation or generated by Meilisearch if ommited.")])]),e._v(" "),a("tr",[a("td",[e._v("key")]),e._v(" "),a("td",[e._v("string")]),e._v(" "),a("td",[e._v("The generated key to use when in the Authorization header when making requests. "),a("strong",[e._v("Generated by MeiliSearch by a combination of uid and the master key")]),e._v(".")])]),e._v(" "),a("tr",[a("td",[e._v("name")]),e._v(" "),a("td",[e._v("string")]),e._v(" "),a("td",[e._v("A non unique human readable name to ease identification of the API key. "),a("code",[e._v("null")]),e._v(" if empty.")])]),e._v(" "),a("tr",[a("td",[e._v("description")]),e._v(" "),a("td",[e._v("string")]),e._v(" "),a("td",[e._v("A description for the key. "),a("code",[e._v("null")]),e._v(" if empty.")])]),e._v(" "),a("tr",[a("td",[e._v("actions")]),e._v(" "),a("td",[e._v("array")]),e._v(" "),a("td",[e._v("A list of actions permitted for the key. "),a("code",[e._v('["*"]')]),e._v(" for all actions. See Actions List Definition part.")])]),e._v(" "),a("tr",[a("td",[e._v("indexes")]),e._v(" "),a("td",[e._v("array")]),e._v(" "),a("td",[e._v("A list of indexes permitted for the key. "),a("code",[e._v('["*"]')]),e._v(" for all indexes.")])]),e._v(" "),a("tr",[a("td",[e._v("expiresAt")]),e._v(" "),a("td",[e._v("string")]),e._v(" "),a("td",[e._v("Represent the expiration date and time as "),a("code",[e._v("RFC 3339")]),e._v(" format. "),a("code",[e._v("null")]),e._v(" equals to no expiration time.")])]),e._v(" "),a("tr",[a("td",[e._v("createdAt")]),e._v(" "),a("td",[e._v("string")]),e._v(" "),a("td",[e._v("Represent the date and time as "),a("code",[e._v("RFC 3339")]),e._v(" format when the API key has been created. "),a("strong",[e._v("Generated by MeiliSearch")])])]),e._v(" "),a("tr",[a("td",[e._v("updatedAt")]),e._v(" "),a("td",[e._v("string")]),e._v(" "),a("td",[e._v("Represent the date and time as "),a("code",[e._v("RFC 3339")]),e._v(" format when the API key has been updated. "),a("strong",[e._v("Default")]),e._v(": Value of "),a("code",[e._v("createdAt")]),e._v(". "),a("strong",[e._v("Generated by MeiliSearch")])])])])]),e._v(" "),a("h5",{attrs:{id:"_3-2-4-2-get-keys"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-2-get-keys"}},[e._v("#")]),e._v(" 3.2.4.2. "),a("code",[e._v("GET")]),e._v(" - "),a("code",[e._v("/keys")])]),e._v(" "),a("p",[e._v("Fetch the API keys of a Meilisearch instance.")]),e._v(" "),a("h6",{attrs:{id:"_3-2-4-2-1-query-parameter-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-2-1-query-parameter-definition"}},[e._v("#")]),e._v(" 3.2.4.2.1. Query Parameter Definition")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("Field")]),e._v(" "),a("th",[e._v("Type")]),e._v(" "),a("th",[e._v("Required")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[a("code",[e._v("offset")])]),e._v(" "),a("td",[e._v("Integer / "),a("code",[e._v("null")])]),e._v(" "),a("td",[e._v("false")])]),e._v(" "),a("tr",[a("td",[a("code",[e._v("limit")])]),e._v(" "),a("td",[e._v("Integer / "),a("code",[e._v("null")])]),e._v(" "),a("td",[e._v("false")])])])]),e._v(" "),a("h6",{attrs:{id:"offset"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#offset"}},[e._v("#")]),e._v(" "),a("code",[e._v("offset")])]),e._v(" "),a("ul",[a("li",[e._v("Type: Integer")]),e._v(" "),a("li",[e._v("Required: False")]),e._v(" "),a("li",[e._v("Default: "),a("code",[e._v("0")])])]),e._v(" "),a("p",[e._v("Sets the starting point in the results, effectively skipping over a given number of API keys.")]),e._v(" "),a("ul",[a("li",[e._v("🔴 Sending a value with a different type than "),a("code",[e._v("Integer")]),e._v(" for "),a("code",[e._v("offset")]),e._v(" returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key_offset"}},[e._v("invalid_api_key_offset")]),e._v(" error.")],1)]),e._v(" "),a("h6",{attrs:{id:"limit"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#limit"}},[e._v("#")]),e._v(" "),a("code",[e._v("limit")])]),e._v(" "),a("ul",[a("li",[e._v("Type: Integer")]),e._v(" "),a("li",[e._v("Required: False")]),e._v(" "),a("li",[e._v("Default: "),a("code",[e._v("20")])])]),e._v(" "),a("p",[e._v("Sets the maximum number of documents to be returned by the current request.")]),e._v(" "),a("ul",[a("li",[e._v("🔴 Sending a value with a different type than "),a("code",[e._v("Integer")]),e._v(" for "),a("code",[e._v("limit")]),e._v(" returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key_limit"}},[e._v("invalid_api_key_limit")]),e._v(" error.")],1)]),e._v(" "),a("h6",{attrs:{id:"_3-2-4-2-2-response-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-2-2-response-definition"}},[e._v("#")]),e._v(" 3.2.4.2.2. Response Definition")]),e._v(" "),a("p",[e._v("Returns a "),a("code",[e._v("200 Success")]),e._v(" HTTP code when the request is successful.")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("Field")]),e._v(" "),a("th",[e._v("Type")]),e._v(" "),a("th",[e._v("Required")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[a("code",[e._v("results")])]),e._v(" "),a("td",[e._v("Array of "),a("a",{attrs:{href:"#3241-api-key-resource-representation"}},[e._v("APIKey")])]),e._v(" "),a("td",[e._v("true")])]),e._v(" "),a("tr",[a("td",[a("code",[e._v("offset")])]),e._v(" "),a("td",[e._v("Integer")]),e._v(" "),a("td",[e._v("true")])]),e._v(" "),a("tr",[a("td",[a("code",[e._v("limit")])]),e._v(" "),a("td",[e._v("Integer")]),e._v(" "),a("td",[e._v("true")])]),e._v(" "),a("tr",[a("td",[a("code",[e._v("total")])]),e._v(" "),a("td",[e._v("Integer")]),e._v(" "),a("td",[e._v("true")])])])]),e._v(" "),a("h6",{attrs:{id:"results"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#results"}},[e._v("#")]),e._v(" "),a("code",[e._v("results")])]),e._v(" "),a("ul",[a("li",[e._v("Type: Array[APIKey]")]),e._v(" "),a("li",[e._v("Required: True")])]),e._v(" "),a("p",[e._v("An array containing the fetched API keys.")]),e._v(" "),a("h6",{attrs:{id:"offset-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#offset-2"}},[e._v("#")]),e._v(" "),a("code",[e._v("offset")])]),e._v(" "),a("ul",[a("li",[e._v("Type: Integer")]),e._v(" "),a("li",[e._v("Required: True")])]),e._v(" "),a("p",[e._v("Gives the "),a("code",[e._v("offset")]),e._v(" parameter used for the query.")]),e._v(" "),a("h6",{attrs:{id:"limit-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#limit-2"}},[e._v("#")]),e._v(" "),a("code",[e._v("limit")])]),e._v(" "),a("ul",[a("li",[e._v("Type: Integer")]),e._v(" "),a("li",[e._v("Required: True")])]),e._v(" "),a("p",[e._v("Gives the "),a("code",[e._v("limit")]),e._v(" parameter used for the query.")]),e._v(" "),a("h6",{attrs:{id:"total"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#total"}},[e._v("#")]),e._v(" "),a("code",[e._v("total")])]),e._v(" "),a("ul",[a("li",[e._v("Type: Integer")]),e._v(" "),a("li",[e._v("Required: True")])]),e._v(" "),a("p",[e._v("Gives the total number of API keys that can be browsed.")]),e._v(" "),a("blockquote",[a("p",[e._v("API Keys are ordered by "),a("code",[e._v("createdAt")]),e._v(" in "),a("code",[e._v("desc")]),e._v(" order. (Most recent first)")])]),e._v(" "),a("blockquote",[a("p",[e._v("Expired API keys can be found on the "),a("code",[e._v("/keys")]),e._v(" endpoints. An archiving system or a filter could allow to not display them by default. See Future Possibilities part.")])]),e._v(" "),a("h6",{attrs:{id:"_3-2-4-2-3-errors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-2-3-errors"}},[e._v("#")]),e._v(" 3.2.4.2.3. Errors")]),e._v(" "),a("ul",[a("li",[e._v("🔴 Accessing this route while a master key is not set for the instance returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_master_key"}},[e._v("missing_master_key")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Accessing this route without the "),a("code",[e._v("Authorization")]),e._v(" header returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_authorization_header"}},[e._v("missing_authorization_header")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Accessing this route without the master key returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key"}},[e._v("invalid_api_key")]),e._v(" error.")],1)]),e._v(" "),a("h6",{attrs:{id:"_3-2-4-2-4-example"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-2-4-example"}},[e._v("#")]),e._v(" 3.2.4.2.4. Example")]),e._v(" "),a("p",[a("code",[e._v("200 Success")])]),e._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"results"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"description"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"Manage Products/Reviews Documents API key"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"uid"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"ac06a7e1-6956-4699-bb04-dbeb72a231df"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"key"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"2fcdddd16ab75a4aeea6b74577874bc2888938a69ffafe3d05547560fa72e15b"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"actions"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"documents.add"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"documents.delete"')]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"indexes"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"products"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"reviews"')]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"expiresAt"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"2021-12-31T23:59:59Z"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"createdAt"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"2021-10-12T00:00:00Z"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"updatedAt"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"2021-10-13T15:00:00Z"')]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"description"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"Default Search API Key (Use it to search from the frontend code)"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"uid"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"87861fb0-e948-41da-ae7f-89617d57d5f5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"key"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"0fe6fc6d94a21b5ca0b5a714bcb338865108039efc048e99e5ba2e7a976fa330"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"actions"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"search"')]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"indexes"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"*"')]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"expiresAt"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token null keyword"}},[e._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"createdAt"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"2021-08-11T10:00:00Z"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"updatedAt"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"2021-08-11T10:00:00Z"')]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"description"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"Default Admin API Key (Use it for all other operations. Caution! Do not share it on the client side)"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"uid"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"ad9af94e-d2db-420f-9ee3-9375f091e565"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"key"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"1846b591d7fd0454bc2b7f1c7ad80c411b1cfe46a51b0d44e6554a30f4bc0a18"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"actions"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"*"')]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"indexes"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"*"')]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"expiresAt"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token null keyword"}},[e._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"createdAt"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"2021-08-11T10:00:00Z"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"updatedAt"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"2021-08-11T10:00:00Z"')]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"offset"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"limit"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("20")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"total"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("3")]),e._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),a("blockquote",[a("p",[e._v("👉 Note the two default generated API keys here. When a master key is set at MeiliSearch's launch, it generates two pre-configured "),a("code",[e._v("API Keys")]),e._v(". A Default Search API Key restricted to the search action on all indexes and a Default Admin API Key on all indexes to handle all operations (except managing API Keys).")])]),e._v(" "),a("h5",{attrs:{id:"_3-2-4-3-get-keys-uid-or-key"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-3-get-keys-uid-or-key"}},[e._v("#")]),e._v(" 3.2.4.3. "),a("code",[e._v("GET")]),e._v(" - "),a("code",[e._v("/keys/:uid_or_key")])]),e._v(" "),a("p",[e._v("Fetch a specific API key of a Meilisearch instance from it's "),a("code",[e._v("uid")]),e._v(" or "),a("code",[e._v("key")]),e._v(" field.")]),e._v(" "),a("h6",{attrs:{id:"_3-2-4-3-1-query-parameter-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-3-1-query-parameter-definition"}},[e._v("#")]),e._v(" 3.2.4.3.1. Query Parameter Definition")]),e._v(" "),a("p",[e._v("n/a")]),e._v(" "),a("h6",{attrs:{id:"_3-2-4-3-2-response-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-3-2-response-definition"}},[e._v("#")]),e._v(" 3.2.4.3.2. Response Definition")]),e._v(" "),a("p",[e._v("Returns a "),a("code",[e._v("200 Success")]),e._v(" HTTP code when the request is successful.")]),e._v(" "),a("p",[e._v("See "),a("a",{attrs:{href:"#3241-api-key-resource-representation"}},[e._v("API Key Resource Representation")]),e._v(" section for the response body.")]),e._v(" "),a("h6",{attrs:{id:"_3-2-4-3-3-errors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-3-3-errors"}},[e._v("#")]),e._v(" 3.2.4.3.3. Errors")]),e._v(" "),a("ul",[a("li",[e._v("🔴 Accessing this route while a master key is not set for the instance returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_master_key"}},[e._v("missing_master_key")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Accessing this route without the "),a("code",[e._v("Authorization")]),e._v(" header returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_authorization_header"}},[e._v("missing_authorization_header")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Accessing this route without the master key or an API key missing the "),a("code",[e._v("keys.get")]),e._v(" permission returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key"}},[e._v("invalid_api_key")]),e._v(" error.")],1)]),e._v(" "),a("h5",{attrs:{id:"_3-2-4-4-post-keys"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-4-post-keys"}},[e._v("#")]),e._v(" 3.2.4.4. "),a("code",[e._v("POST")]),e._v(" - "),a("code",[e._v("/keys")])]),e._v(" "),a("p",[e._v("Create an API key.")]),e._v(" "),a("h6",{attrs:{id:"_3-2-4-4-1-payload-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-4-1-payload-definition"}},[e._v("#")]),e._v(" 3.2.4.4.1. Payload Definition")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("field")]),e._v(" "),a("th",[e._v("type")]),e._v(" "),a("th",[e._v("required")]),e._v(" "),a("th",[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("uid")]),e._v(" "),a("td",[e._v("string")]),e._v(" "),a("td",[e._v("Optional")]),e._v(" "),a("td",[e._v("A unique identifier represented by a "),a("a",{attrs:{href:"https://fr.wikipedia.org/wiki/Universally_unique_identifier",target:"_blank",rel:"noopener noreferrer"}},[e._v("uuid v4"),a("OutboundLink")],1),e._v(". Specified at creation or generated by Meilisearch if ommited.")])]),e._v(" "),a("tr",[a("td",[e._v("name")]),e._v(" "),a("td",[e._v("string")]),e._v(" "),a("td",[e._v("Optional")]),e._v(" "),a("td",[e._v("A non unique human readable name to ease identification of the API key. "),a("strong",[e._v("Default")]),e._v(": "),a("code",[e._v("null")])])]),e._v(" "),a("tr",[a("td",[e._v("description")]),e._v(" "),a("td",[e._v("string")]),e._v(" "),a("td",[e._v("Optional")]),e._v(" "),a("td",[e._v("A description for the API key. "),a("strong",[e._v("Default")]),e._v(": "),a("code",[e._v("null")])])]),e._v(" "),a("tr",[a("td",[e._v("actions")]),e._v(" "),a("td",[e._v("array")]),e._v(" "),a("td",[e._v("Required")]),e._v(" "),a("td",[e._v("A list of actions permitted for the API key. "),a("code",[e._v('["*"]')]),e._v(" for all actions. "),a("strong",[e._v("See Actions list definition part")]),e._v(". The "),a("code",[e._v("*")]),e._v(" character can be used as a wildcard when located at the last position. e.g. "),a("code",[e._v("documents.*")]),e._v(" to authorize access on all documents endpoints. "),a("strong",[e._v("Default")]),e._v(": "),a("code",[e._v("No default")])])]),e._v(" "),a("tr",[a("td",[e._v("indexes")]),e._v(" "),a("td",[e._v("array")]),e._v(" "),a("td",[e._v("Required")]),e._v(" "),a("td",[a("code",[e._v("[*]")]),e._v(" for all indexes. The "),a("code",[e._v("*")]),e._v(" character can be used as a wildcard when located in the last position. e.g. "),a("code",[e._v("products_*")]),e._v(" to allow access to all indexes whose names start with "),a("code",[e._v("products_")]),e._v(". "),a("strong",[e._v("Default")]),e._v(": "),a("code",[e._v("No Default")])])]),e._v(" "),a("tr",[a("td",[e._v("expiresAt")]),e._v(" "),a("td",[e._v("string")]),e._v(" "),a("td",[e._v("Required")]),e._v(" "),a("td",[e._v("The expiration date and time as "),a("code",[e._v("RFC 3339")]),e._v(" format. "),a("code",[e._v("null")]),e._v(" equals to no expiration time. Sending only the date part e.g "),a("code",[e._v("2021-12-01")]),e._v(" leads to having an "),a("code",[e._v("expiresAt")]),e._v(" value set to "),a("code",[e._v("2021-12-01T00:00:00")]),e._v(". "),a("strong",[e._v("Default")]),e._v(": "),a("code",[e._v("No Default")])])])])]),e._v(" "),a("h6",{attrs:{id:"_3-2-4-4-2-actions-list-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-4-2-actions-list-definition"}},[e._v("#")]),e._v(" 3.2.4.4.2. "),a("code",[e._v("actions")]),e._v(" List Definition")]),e._v(" "),a("blockquote",[a("p",[a("code",[e._v(":authorizedIndexes")]),e._v(" can be any value extracted from the "),a("code",[e._v("indexes")]),e._v(" field of an API key resource.")])]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("name")]),e._v(" "),a("th",[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("search")]),e._v(" "),a("td",[e._v("Provides access to "),a("code",[e._v("GET")]),e._v(" and "),a("code",[e._v("POST")]),e._v(" methods on "),a("code",[e._v("/indexes/:authorizedIndexes/search")]),e._v(" routes.")])]),e._v(" "),a("tr",[a("td",[e._v("documents.add")]),e._v(" "),a("td",[e._v("Provides access to "),a("code",[e._v("POST")]),e._v(" and "),a("code",[e._v("PUT")]),e._v(" on "),a("code",[e._v("/indexes/:authorizedIndexes/documents")]),e._v(" routes.")])]),e._v(" "),a("tr",[a("td",[e._v("documents.get")]),e._v(" "),a("td",[e._v("Provides access to "),a("code",[e._v("GET")]),e._v(" methods on "),a("code",[e._v("/indexes/:authorizedIndexes/documents")]),e._v(", "),a("code",[e._v("/indexes/:authorizedIndexes/documents/:documentId")]),e._v(" and "),a("code",[e._v("POST")]),e._v(" methods on "),a("code",[e._v("/indexes/:authorizedIndexes/documents/fetch")]),e._v(" routes.")])]),e._v(" "),a("tr",[a("td",[e._v("documents.delete")]),e._v(" "),a("td",[e._v("Provides access to "),a("code",[e._v("DELETE")]),e._v(" method on "),a("code",[e._v("/indexes/:authorizedIndexes/documents/:documentId")]),e._v(", "),a("code",[e._v("indexes/:authorizedIndexes/documents/:documentId")]),e._v(" and "),a("code",[e._v("POST")]),e._v(" method on "),a("code",[e._v("/indexes/:authorizedIndexes/documents/delete-batch")]),e._v(" and "),a("code",[e._v("/indexes/:authorizedIndexes/documents/delete")]),e._v(" routes.")])]),e._v(" "),a("tr",[a("td",[e._v("indexes.create")]),e._v(" "),a("td",[e._v("Provides access to "),a("code",[e._v("POST")]),e._v(" "),a("code",[e._v("/indexes")]),e._v(". "),a("strong",[e._v("⚠️ "),a("code",[e._v("indexes")]),e._v(" field should indicate the newly created index or having "),a("code",[e._v("[*]")]),e._v(" to permits access on it.")]),e._v(".")])]),e._v(" "),a("tr",[a("td",[e._v("indexes.get")]),e._v(" "),a("td",[e._v("Provides access to "),a("code",[e._v("GET")]),e._v(" "),a("code",[e._v("/indexes")]),e._v(" and "),a("code",[e._v("/indexes/:authorizedIndexes")]),e._v(". "),a("strong",[e._v("⚠️Non-authorized "),a("code",[e._v("indexes")]),e._v(" are omitted from the response on "),a("code",[e._v("/indexes")])]),e._v(".")])]),e._v(" "),a("tr",[a("td",[e._v("indexes.update")]),e._v(" "),a("td",[e._v("Provides access to "),a("code",[e._v("PUT")]),e._v(" "),a("code",[e._v("/indexes/:authorizedIndexes")]),e._v(".")])]),e._v(" "),a("tr",[a("td",[e._v("indexes.delete")]),e._v(" "),a("td",[e._v("Provides access to "),a("code",[e._v("DELETE")]),e._v(" "),a("code",[e._v("/indexes/:authorizedIndexes")]),e._v(".")])]),e._v(" "),a("tr",[a("td",[e._v("indexes.swap")]),e._v(" "),a("td",[e._v("Provides access to "),a("code",[e._v("POST")]),e._v(" "),a("code",[e._v("/swap-indexes")]),e._v(". See "),a("RouterLink",{attrs:{to:"/specifications/text/0191-swap-indexes-api.html"}},[e._v("Swap Indexes API")]),e._v(" specification.")],1)]),e._v(" "),a("tr",[a("td",[e._v("tasks.get")]),e._v(" "),a("td",[e._v("Provides access to "),a("code",[e._v("GET")]),e._v(" "),a("code",[e._v("/tasks")]),e._v(". "),a("strong",[e._v("⚠️Non-authorized "),a("code",[e._v("indexes")]),e._v(" are omitted from the response on "),a("code",[e._v("/tasks")])]),e._v(". Also add access to "),a("code",[e._v("GET")]),e._v(" "),a("code",[e._v("/indexes/:authorizedIndexes/tasks")]),e._v(" routes.")])]),e._v(" "),a("tr",[a("td",[e._v("tasks.cancel")]),e._v(" "),a("td",[e._v("Provides access to "),a("code",[e._v("POST")]),e._v(" "),a("code",[e._v("/tasks/cancel")]),e._v(". route.")])]),e._v(" "),a("tr",[a("td",[e._v("tasks.delete")]),e._v(" "),a("td",[e._v("Provides access to "),a("code",[e._v("DELETE")]),e._v(" "),a("code",[e._v("/tasks")]),e._v(" route.")])]),e._v(" "),a("tr",[a("td",[e._v("settings.get")]),e._v(" "),a("td",[e._v("Provides access to "),a("code",[e._v("GET")]),e._v(" "),a("code",[e._v("/indexes/:authorizedIndexes/settings")]),e._v(" and "),a("code",[e._v("/indexes/:authorizedIndexes/settings/*")]),e._v(" routes.")])]),e._v(" "),a("tr",[a("td",[e._v("settings.update")]),e._v(" "),a("td",[e._v("Provides access to "),a("code",[e._v("POST / DELETE")]),e._v(" "),a("code",[e._v("/indexes/:authorizedIndexes/settings")]),e._v(" and "),a("code",[e._v("/indexes/:authorizedIndexes/settings/*")]),e._v(" routes.")])]),e._v(" "),a("tr",[a("td",[e._v("stats.get")]),e._v(" "),a("td",[e._v("Provides access to "),a("code",[e._v("GET")]),e._v(" "),a("code",[e._v("/stats")]),e._v(". "),a("strong",[e._v("⚠️Non-authorized "),a("code",[e._v("indexes")]),e._v(" are omitted from the response on "),a("code",[e._v("/stats")])]),e._v(". Also add access to "),a("code",[e._v("GET")]),e._v(" "),a("code",[e._v("/indexes/:authorizedIndexes/stats")]),e._v(".")])]),e._v(" "),a("tr",[a("td",[e._v("metrics.get")]),e._v(" "),a("td",[e._v("Provides access to "),a("code",[e._v("GET")]),e._v(" "),a("code",[e._v("/metrics")]),e._v(" route. "),a("strong",[e._v("A restriction on "),a("code",[e._v("indexes")]),e._v(" stops you from calling the route.")])])]),e._v(" "),a("tr",[a("td",[e._v("dumps.create")]),e._v(" "),a("td",[e._v("Provides access to "),a("code",[e._v("POST")]),e._v(" "),a("code",[e._v("/dumps")]),e._v(" route. "),a("strong",[e._v("As dumps are not scoped by indexes, a restriction on "),a("code",[e._v("indexes")]),e._v(" does not affect this action.")])])]),e._v(" "),a("tr",[a("td",[e._v("snapshots.create")]),e._v(" "),a("td",[e._v("Provides access to "),a("code",[e._v("POST")]),e._v(" "),a("code",[e._v("/snapshots")]),e._v(" route. "),a("strong",[e._v("As snapshots are not scoped by indexes, a restriction on "),a("code",[e._v("indexes")]),e._v(" does not affect this action.")])])]),e._v(" "),a("tr",[a("td",[e._v("version")]),e._v(" "),a("td",[e._v("Provides access to "),a("code",[e._v("GET")]),e._v(" "),a("code",[e._v("/version")]),e._v(" route.")])]),e._v(" "),a("tr",[a("td",[e._v("keys.get")]),e._v(" "),a("td",[e._v("Provides access to "),a("code",[e._v("GET")]),e._v(" "),a("code",[e._v("/keys")]),e._v(" route.")])]),e._v(" "),a("tr",[a("td",[e._v("keys.create")]),e._v(" "),a("td",[e._v("Provides access to "),a("code",[e._v("POST")]),e._v(" "),a("code",[e._v("/keys")]),e._v(" route.")])]),e._v(" "),a("tr",[a("td",[e._v("keys.update")]),e._v(" "),a("td",[e._v("Provides access to "),a("code",[e._v("PATCH")]),e._v(" "),a("code",[e._v("/keys")]),e._v(" routes.")])]),e._v(" "),a("tr",[a("td",[e._v("keys.delete")]),e._v(" "),a("td",[e._v("Provides access to "),a("code",[e._v("DELETE")]),e._v(" "),a("code",[e._v("/keys")]),e._v(" routes.")])]),e._v(" "),a("tr",[a("td",[e._v("experimental.get")]),e._v(" "),a("td",[e._v("Provides access to "),a("code",[e._v("GET")]),e._v(" "),a("code",[e._v("/experimental-features")]),e._v(" routes.")])]),e._v(" "),a("tr",[a("td",[e._v("experimental.update")]),e._v(" "),a("td",[e._v("Provides access to "),a("code",[e._v("PATCH")]),e._v(" "),a("code",[e._v("/experimental-features")]),e._v(" routes.")])])])]),e._v(" "),a("h6",{attrs:{id:"_3-2-4-4-3-response-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-4-3-response-definition"}},[e._v("#")]),e._v(" 3.2.4.4.3. Response Definition")]),e._v(" "),a("p",[e._v("Returns a "),a("code",[e._v("201 Created")]),e._v(" HTTP code when the request is successful.")]),e._v(" "),a("p",[e._v("See "),a("a",{attrs:{href:"#3241-api-key-resource-representation"}},[e._v("API Key Resource Representation")]),e._v(" section for the response body.")]),e._v(" "),a("h6",{attrs:{id:"_3-2-4-4-3-errors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-4-3-errors"}},[e._v("#")]),e._v(" 3.2.4.4.3. Errors")]),e._v(" "),a("ul",[a("li",[e._v("🔴 Accessing this route while a master key is not set for the instance returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_master_key"}},[e._v("missing_master_key")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Accessing this route without the "),a("code",[e._v("Authorization")]),e._v(" header returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_authorization_header"}},[e._v("missing_authorization_header")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Accessing this route without the master key or an API key missing the "),a("code",[e._v("keys.create")]),e._v(" permission returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key"}},[e._v("invalid_api_key")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Omitting Content-Type header returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_content_type"}},[e._v("missing_content_type")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending an empty Content-Type returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_content_type"}},[e._v("invalid_content_type")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending a different Content-Type than "),a("code",[e._v("application/json")]),e._v(" returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_content_type"}},[e._v("invalid_content_type")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending an empty payload returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_payload"}},[e._v("missing_payload")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending a different payload type than the Content-Type header returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#malformed_payload"}},[e._v("malformed_payload")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending an invalid json format returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#malformed_payload"}},[e._v("malformed_payload")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Omitting "),a("code",[e._v("actions")]),e._v(" field from the payload returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_api_key_actions"}},[e._v("missing_api_key_actions")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Omitting "),a("code",[e._v("indexes")]),e._v(" field from the payload returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_api_key_indexes"}},[e._v("missing_api_key_indexes")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Omitting "),a("code",[e._v("expiresAt")]),e._v(" field from the payload returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_api_key_expires_at"}},[e._v("missing_api_key_expires_at")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending an "),a("code",[e._v("uid")]),e._v(" field that already exists returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#api_key_already_exists"}},[e._v("api_key_already_exists")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending an invalid value for the "),a("code",[e._v("uid")]),e._v(" field returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key_uid"}},[e._v("invalid_api_key_uid")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending an invalid value for the "),a("code",[e._v("actions")]),e._v(" field returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key_actions"}},[e._v("invalid_api_key_actions")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending an invalid value for the "),a("code",[e._v("indexes")]),e._v(" field returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key_indexes"}},[e._v("invalid_api_key_indexes")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending an invalid value for the "),a("code",[e._v("expiresAt")]),e._v(" field returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key_expires_at"}},[e._v("invalid_api_key_expires_at")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending an invalid value for the "),a("code",[e._v("name")]),e._v(" field returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key_name"}},[e._v("invalid_api_key_name")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending an invalid value for the "),a("code",[e._v("description")]),e._v(" field returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key_description"}},[e._v("invalid_api_key_description")]),e._v(" error.")],1)]),e._v(" "),a("h5",{attrs:{id:"_3-2-4-5-patch-keys-uid-or-key"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-5-patch-keys-uid-or-key"}},[e._v("#")]),e._v(" 3.2.4.5. "),a("code",[e._v("PATCH")]),e._v(" - "),a("code",[e._v("/keys/:uid_or_key")])]),e._v(" "),a("p",[e._v("Update an API key found by it's "),a("code",[e._v("uid")]),e._v(" or "),a("code",[e._v("key")]),e._v(" field. Only the "),a("code",[e._v("name")]),e._v(" and "),a("code",[e._v("description")]),e._v(" fields of an API key can be modified.")]),e._v(" "),a("h6",{attrs:{id:"_3-2-4-5-1-payload-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-5-1-payload-definition"}},[e._v("#")]),e._v(" 3.2.4.5.1. Payload Definition")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("field")]),e._v(" "),a("th",[e._v("type")]),e._v(" "),a("th",[e._v("required")]),e._v(" "),a("th",[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("name")]),e._v(" "),a("td",[e._v("string")]),e._v(" "),a("td",[e._v("Optional")]),e._v(" "),a("td",[e._v("A name for the API Key. "),a("strong",[e._v("Default")]),e._v(": "),a("code",[e._v("null")])])]),e._v(" "),a("tr",[a("td",[e._v("description")]),e._v(" "),a("td",[e._v("string")]),e._v(" "),a("td",[e._v("Optional")]),e._v(" "),a("td",[e._v("A description for the API key. "),a("strong",[e._v("Default")]),e._v(": "),a("code",[e._v("null")])])])])]),e._v(" "),a("h6",{attrs:{id:"_3-2-4-5-2-response-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-5-2-response-definition"}},[e._v("#")]),e._v(" 3.2.4.5.2. Response Definition")]),e._v(" "),a("p",[e._v("Returns a "),a("code",[e._v("200 Success")]),e._v(" HTTP code when the request is successful.")]),e._v(" "),a("p",[e._v("See "),a("a",{attrs:{href:"#3241-api-key-resource-representation"}},[e._v("API Key Resource Representation")]),e._v(" section for the response body.")]),e._v(" "),a("h6",{attrs:{id:"_3-2-4-5-3-errors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-5-3-errors"}},[e._v("#")]),e._v(" 3.2.4.5.3. Errors")]),e._v(" "),a("ul",[a("li",[e._v("🔴 Accessing this route while a master key is not set for the instance returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_master_key"}},[e._v("missing_master_key")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Accessing this route without the "),a("code",[e._v("Authorization")]),e._v(" header returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_authorization_header"}},[e._v("missing_authorization_header")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Accessing this route without the master key or an API key missing the "),a("code",[e._v("keys.update")]),e._v(" permission returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key"}},[e._v("invalid_api_key")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Attempting to access an API key that does not exist returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#api_key_not_found"}},[e._v("api_key_not_found")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Omitting Content-Type header returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_content_type"}},[e._v("missing_content_type")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending an empty Content-Type returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_content_type"}},[e._v("invalid_content_type")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending a different Content-Type than "),a("code",[e._v("application/json")]),e._v(" returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_content_type"}},[e._v("invalid_content_type")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending an empty payload returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_payload"}},[e._v("missing_payload")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending a different payload type than the Content-Type header returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#malformed_payload"}},[e._v("malformed_payload")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending an invalid json format returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#malformed_payload"}},[e._v("malformed_payload")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending an invalid value for the "),a("code",[e._v("name")]),e._v(" field returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key_name"}},[e._v("invalid_api_key_name")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending an invalid value for the "),a("code",[e._v("description")]),e._v(" field returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key_description"}},[e._v("invalid_api_key_description")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending "),a("code",[e._v("uid")]),e._v(" in the payload request returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#immutable_api_key_uid"}},[e._v("immutable_api_key_uid")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending "),a("code",[e._v("key")]),e._v(" in the payload request returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#immutable_api_key_key"}},[e._v("immutable_api_key_key")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending "),a("code",[e._v("actions")]),e._v(" in the payload request returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#immutable_api_key_actions"}},[e._v("immutable_api_key_actions")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending "),a("code",[e._v("indexes")]),e._v(" in the payload request returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#immutable_api_key_indexes"}},[e._v("immutable_api_key_indexes")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending "),a("code",[e._v("expiresAt")]),e._v(" in the payload request returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#immutable_api_key_expires_at"}},[e._v("immutable_api_key_expires_at")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending "),a("code",[e._v("createdAt")]),e._v(" in the payload request returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#immutable_api_key_created_at"}},[e._v("immutable_api_key_created_at")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending "),a("code",[e._v("updatedAt")]),e._v(" in the payload request returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#immutable_api_key_updated_at"}},[e._v("immutable_api_key_updated_at")]),e._v(" error.")],1)]),e._v(" "),a("h5",{attrs:{id:"_3-2-4-6-delete-keys-uid-or-key"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-6-delete-keys-uid-or-key"}},[e._v("#")]),e._v(" 3.2.4.6. "),a("code",[e._v("DELETE")]),e._v(" - "),a("code",[e._v("/keys/:uid_or_key")])]),e._v(" "),a("p",[e._v("Delete an API key found by it's "),a("code",[e._v("uid")]),e._v(" or "),a("code",[e._v("key")]),e._v(" field.")]),e._v(" "),a("h6",{attrs:{id:"_3-2-4-6-1-payload-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-6-1-payload-definition"}},[e._v("#")]),e._v(" 3.2.4.6.1. Payload Definition")]),e._v(" "),a("p",[e._v("n/a")]),e._v(" "),a("h6",{attrs:{id:"_3-2-4-6-2-response-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-6-2-response-definition"}},[e._v("#")]),e._v(" 3.2.4.6.2. Response Definition")]),e._v(" "),a("p",[e._v("Returns a "),a("code",[e._v("204 No-Content")]),e._v(" HTTP code when the request is successful.")]),e._v(" "),a("h6",{attrs:{id:"_3-2-4-6-3-errors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-6-3-errors"}},[e._v("#")]),e._v(" 3.2.4.6.3. Errors")]),e._v(" "),a("ul",[a("li",[e._v("🔴 Accessing this route while a master key is not set for the instance returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_master_key"}},[e._v("missing_master_key")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Accessing this route without the "),a("code",[e._v("Authorization")]),e._v(" header returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_authorization_header"}},[e._v("missing_authorization_header")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Accessing this route without the master key or an API key missing the "),a("code",[e._v("keys.delete")]),e._v(" permission returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key"}},[e._v("invalid_api_key")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Attempting to access an API key that does not exist returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#api_key_not_found"}},[a("code",[e._v("api_key_not_found")])]),e._v(" error.")],1)]),e._v(" "),a("h5",{attrs:{id:"_3-2-4-7-using-an-api-key-on-client-code"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-7-using-an-api-key-on-client-code"}},[e._v("#")]),e._v(" 3.2.4.7. Using an API key on client-code")]),e._v(" "),a("h6",{attrs:{id:"_3-2-4-7-1-authorization-bearer-header"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-7-1-authorization-bearer-header"}},[e._v("#")]),e._v(" 3.2.4.7.1 Authorization Bearer Header")]),e._v(" "),a("p",[e._v("When the Meilisearch API is secured by the presence of a master key, the "),a("code",[e._v("Authorization")]),e._v(" header must be used with a bearer to authorize requests. The specified value must be the value of the "),a("code",[e._v("key")]),e._v(" field of an API key.")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v(' "Authorization: Bearer `:key`"\n "Content-Type: application/json"\n')])])]),a("ul",[a("li",[e._v("🔴 Accessing a route with an "),a("code",[e._v("API Key")]),e._v(" that has expired, been deleted or don't have sufficient permissions returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key"}},[e._v("invalid_api_key")]),e._v(" error.")],1)]),e._v(" "),a("h2",{attrs:{id:"_4-technical-aspects"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-technical-aspects"}},[e._v("#")]),e._v(" 4. Technical Aspects")]),e._v(" "),a("h3",{attrs:{id:"_4-1-api-key-generation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-api-key-generation"}},[e._v("#")]),e._v(" 4.1. API Key generation")]),e._v(" "),a("p",[e._v("An "),a("code",[e._v("uid")]),e._v(" representing by a uuid v4 is generated if not specified at creation by the user.")]),e._v(" "),a("p",[e._v("The final key is then an HMAC with the master key, as the secret, and the "),a("code",[e._v("uid")]),e._v(", a hyphenated Uuidv4, as the data. HMAC uses an SHA-256 algorithm internally.")]),e._v(" "),a("p",[e._v("The final key could be generated with openssl as below:")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",[a("code",[e._v("echo -n $HYPHENATED_UUID | openssl dgst -sha256 -hmac $MASTER_KEY\n")])])]),a("h3",{attrs:{id:"_4-2-synchronous-write-of-api-key-resources"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-synchronous-write-of-api-key-resources"}},[e._v("#")]),e._v(" 4.2. Synchronous write of "),a("code",[e._v("API Key")]),e._v(" resources")]),e._v(" "),a("p",[e._v("Writing to "),a("code",[e._v("/keys")]),e._v(" endpoints are synchronous in order to return errors directly to the user when he performs an operation on them. This means that API key management operations do not appear as a task on "),a("code",[e._v("/tasks")]),e._v(".")]),e._v(" "),a("h3",{attrs:{id:"_4-3-propagating-api-key-to-dumps"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-3-propagating-api-key-to-dumps"}},[e._v("#")]),e._v(" 4.3. Propagating "),a("code",[e._v("API Key")]),e._v(" to dumps.")]),e._v(" "),a("p",[e._v("The generated API keys must also transit within a dump to facilitate the upgrade of a MeiliSearch instance.")]),e._v(" "),a("blockquote",[a("p",[e._v("🚨 As a reminder, dumps must be stored in secure areas not accessible to the public or unaccredited persons. In general, you should avoid moving them off the host machine or do so via a secure channel as a security measure.")])]),e._v(" "),a("p",[e._v("If the dumps ever leak, the api keys cannot be spoofed from the dump inspection because it needs the master key to have the full value of a valid API key. Only the "),a("code",[e._v("uid")]),e._v(" value is propagated in the dumps.")]),e._v(" "),a("h3",{attrs:{id:"_4-4-propagating-api-key-to-snapshots"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-4-propagating-api-key-to-snapshots"}},[e._v("#")]),e._v(" 4.4. Propagating "),a("code",[e._v("API Key")]),e._v(" to snapshots.")]),e._v(" "),a("p",[e._v("The generated API keys must also transit within a snapshot to facilitate the recovery of a MeiliSearch instance.")]),e._v(" "),a("blockquote",[a("p",[e._v("🚨 As a reminder, snapshots must be stored in secure areas not accessible to the public or unaccredited persons. In general, you should avoid moving them off the host machine or do so via a secure channel as a security measure.")])]),e._v(" "),a("p",[e._v("If the snapshot ever leak, the "),a("code",[e._v("API keys")]),e._v(" cannot be spoofed from the snapshot inspection because it needs the master key to have the full value of a valid "),a("code",[e._v("API key")]),e._v(". Only the "),a("code",[e._v("uid")]),e._v(" value is propagated in the snapshots.")]),e._v(" "),a("h3",{attrs:{id:"_4-5-api-keys-storage-size-limit"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-5-api-keys-storage-size-limit"}},[e._v("#")]),e._v(" 4.5. API Keys storage size limit")]),e._v(" "),a("p",[e._v("The maximum size of the API key storage layer is "),a("code",[e._v("100GB")]),e._v(".")]),e._v(" "),a("h2",{attrs:{id:"_5-future-possibilities"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-future-possibilities"}},[e._v("#")]),e._v(" 5. Future Possibilities")]),e._v(" "),a("ul",[a("li",[e._v("Regenerate a specific "),a("code",[e._v("API Key")]),e._v(".")]),e._v(" "),a("li",[e._v('Have an "archive" state where manually deleted API Keys can be restored for a certain amount of time.')]),e._v(" "),a("li",[e._v("Add rate-limiting per API Key.")]),e._v(" "),a("li",[e._v("A restriction on the maximum offset/limit.")]),e._v(" "),a("li",[e._v("Add search parameters restrictions for an API Key.")]),e._v(" "),a("li",[e._v("Add rfc2822 format expression for "),a("code",[e._v("expiredAt")]),e._v(" field. e.g. "),a("code",[e._v("Wed, 18 Feb 2022 23:16:09 GMT")])]),e._v(" "),a("li",[e._v("Add an alias that can only be associated to one API Key to retrieve it easily on client side. e.g. "),a("code",[e._v("GET /keys/:uid_or_alias")])]),e._v(" "),a("li",[e._v("Supports wildcard expressions at the start/middle of a string.")])])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[29],{453:function(e,t,a){"use strict";a.r(t);var s=a(62),r=Object(s.a)({},(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[a("h1",{attrs:{id:"api-keys"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#api-keys"}},[e._v("#")]),e._v(" API Keys")]),e._v(" "),a("h2",{attrs:{id:"_1-summary"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-summary"}},[e._v("#")]),e._v(" 1. Summary")]),e._v(" "),a("p",[e._v("API keys allows to define which actions and which indexes are accessible by the holder of an API key. The use of API keys allows to secure the access to the routes in a fine-grained manner of a Meilisearch instance.")]),e._v(" "),a("h2",{attrs:{id:"_2-motivation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-motivation"}},[e._v("#")]),e._v(" 2. Motivation")]),e._v(" "),a("p",[e._v("To make Meilisearch more reliable for teams and more adapted to production cases, we extend the management and the possibilities of restrictions regarding write and read requests on a Meilisearch instance by introducing a way to manage custom API keys.")]),e._v(" "),a("h2",{attrs:{id:"_3-functional-specification"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-functional-specification"}},[e._v("#")]),e._v(" 3. Functional Specification")]),e._v(" "),a("h3",{attrs:{id:"_3-1-glossary"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-glossary"}},[e._v("#")]),e._v(" 3.1. Glossary")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("Term")]),e._v(" "),a("th",[e._v("Definition")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("Master Key")]),e._v(" "),a("td",[e._v("This is the master key that allows managing API keys. The master key is defined by the user when launching Meilisearch, thus gives access to the "),a("code",[e._v("/keys")]),e._v(" API endpoint and requiring requests to be authorized.")])]),e._v(" "),a("tr",[a("td",[e._v("API Key")]),e._v(" "),a("td",[e._v("API keys are stored and managed from the endpoint "),a("code",[e._v("/keys")]),e._v(" by the master key holder.")])])])]),e._v(" "),a("h3",{attrs:{id:"_3-2-explanation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-explanation"}},[e._v("#")]),e._v(" 3.2. Explanation")]),e._v(" "),a("h4",{attrs:{id:"_3-2-1-summary-key-points"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-1-summary-key-points"}},[e._v("#")]),e._v(" 3.2.1 Summary Key Points")]),e._v(" "),a("ul",[a("li",[e._v("API keys management is restricted to the master key or API keys having "),a("code",[e._v("keys.get")]),e._v(", "),a("code",[e._v("keys.create")]),e._v(", "),a("code",[e._v("keys.update")]),e._v(", "),a("code",[e._v("keys.delete")]),e._v(" or "),a("code",[e._v("*")]),e._v(" actions.")]),e._v(" "),a("li",[e._v("API keys must be provided via the "),a("code",[e._v("Authorization")]),e._v(" header using the bearer method to authorize a request.")]),e._v(" "),a("li",[e._v("The value of the "),a("code",[e._v("key")]),e._v(" field of an API Key is generated from its "),a("code",[e._v("uid")]),e._v(" and the master key.")]),e._v(" "),a("li",[e._v("When a master key is set at Meilisearch first-launch, it generate two pre-configured default "),a("code",[e._v("API Key")]),e._v(" resources. A "),a("code",[e._v("Default Search API Key")]),e._v(" authorizing the search action on all indexes and a "),a("code",[e._v("Default Admin API Key")]),e._v(" authorizing all actions.")]),e._v(" "),a("li",[e._v("If the master-key changes, the "),a("code",[e._v("key")]),e._v(" field is re-generated.")]),e._v(" "),a("li",[e._v("Default API keys can be modified/deleted from the "),a("code",[e._v("/keys")]),e._v(" endpoints but are not re-created if Meilisearch has already created them.")]),e._v(" "),a("li",[e._v("API keys can have restrictions on which methods can be accessed via an "),a("code",[e._v("actions")]),e._v(" list; they also "),a("code",[e._v("expiresAt")]),e._v(" a specific date time and are restricted to a specific set of "),a("code",[e._v("indexes")]),e._v(".")]),e._v(" "),a("li",[a("code",[e._v("name")]),e._v(" and "),a("code",[e._v("description")]),e._v(" fields are the only editable fields of an API key.")]),e._v(" "),a("li",[e._v("API key resources are propagated to snapshots and dumps.")])]),e._v(" "),a("h4",{attrs:{id:"_3-2-2-master-key"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-2-master-key"}},[e._v("#")]),e._v(" 3.2.2. Master Key")]),e._v(" "),a("p",[e._v("The master key exists to secure a Meilisearch instance. As soon as a master key is set via the "),a("code",[e._v("MEILI_MASTER_KEY")]),e._v(" environment variable or the "),a("code",[e._v("--master-key")]),e._v(" CLI option, the endpoint "),a("code",[e._v("/keys")]),e._v(" is accessible for the master key holder. It can be seen as a super admin key; It must be securely shared only with people who have to manage the security of a Meilisearch instance.")]),e._v(" "),a("p",[e._v("This master key is not an API key, thus is not stored and fetchable from the "),a("code",[e._v("/keys")]),e._v(" API endpoint. It must be seen as a runtime lock that activates the security of Meilisearch as soon as an instance is launched with it. The master key should only be used to fetch API Keys the first time. The default Admin API key should be preferred to manage the API keys resources.")]),e._v(" "),a("p",[e._v("At the first launch of Meilisearch with a master key, Meilisearch automatically generates two default API keys to cover the basic needs a user may encounter. It generates a "),a("code",[e._v("Default Search API Key")]),e._v(" dedicated to the search that can be used on the client-side and a "),a("code",[e._v("Default Admin API Key")]),e._v(" to manipulate a MeiliSearch instance from a backend side.")]),e._v(" "),a("p",[e._v("If the master key is removed at Meilisearch launch, the previously generated API keys no longer secure the Meilisearch instance.")]),e._v(" "),a("p",[e._v("If Meilisearch is launched with the "),a("code",[e._v("production")]),e._v(" value for the "),a("code",[e._v("MEILI_ENV")]),e._v(" environment variable or the "),a("code",[e._v("--env")]),e._v(" CLI option, a master key of at least 16 bytes is mandatory.")]),e._v(" "),a("p",[e._v("If the master key is omitted in that particular case, or is too short, Meilisearch launch is aborted and displays an error.")]),e._v(" "),a("p",[e._v("If Meilisearch is launched with the "),a("code",[e._v("development")]),e._v(" value for the "),a("code",[e._v("MEILI_ENV")]),e._v(" environment variable or the "),a("code",[e._v("--env")]),e._v(" CLI option, Meilisearch displays warning messages given different cases.")]),e._v(" "),a("p",[e._v("See "),a("a",{attrs:{href:"0119-instance-options#334-master-key"}},[a("code",[e._v("MEILI_MASTER_KEY")]),e._v("/"),a("code",[e._v("--master-key")]),e._v(" launch option")]),e._v(".")]),e._v(" "),a("p",[e._v("The master key must be composed of valid utf-8 characters. It is advisable to enclose it in "),a("code",[e._v("'")]),e._v(" when specified via the "),a("code",[e._v("--master-key")]),e._v(" option.")]),e._v(" "),a("blockquote",[a("p",[e._v("🚨 The master key should never be exposed to the public as it may compromise a Meilisearch instance.")])]),e._v(" "),a("blockquote",[a("p",[e._v("🚨 If the value of the master key changes, all the previously generated "),a("code",[e._v("API Keys")]),e._v(" changes, thus allowing to invalidate the set of API keys previously generated by regenerating a different value for their "),a("code",[e._v("key")]),e._v(" field. This is particularly useful in the case where the master key might have been leaked and the user needs to re-generate the whole set of keys at once to re-secure the instance.")])]),e._v(" "),a("blockquote",[a("p",[e._v("The master key does not appear on the "),a("code",[e._v("/keys")]),e._v(" endpoints and can't be used to authorize requests other than on the "),a("code",[e._v("/keys")]),e._v(" endpoint.")])]),e._v(" "),a("blockquote",[a("p",[e._v("The only route not secured in the presence of a master key is the "),a("code",[e._v("/health")]),e._v(" route.")])]),e._v(" "),a("h4",{attrs:{id:"_3-2-3-default-api-keys"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-3-default-api-keys"}},[e._v("#")]),e._v(" 3.2.3. Default API Keys")]),e._v(" "),a("p",[e._v("The first time a Meilisearch instance is launched with a "),a("code",[e._v("master key")]),e._v(", Meilisearch will generate two API keys described below.")]),e._v(" "),a("p",[e._v("If the user changes the value of the master key later, these two default keys are not created again but the "),a("code",[e._v("key")]),e._v(" field is re-generated. However, these two API keys can be updated/deleted using the "),a("code",[e._v("/keys")]),e._v(" endpoints.")]),e._v(" "),a("p",[e._v("If these API keys are deleted, the engine should not create them again when Meilisearch is launched again with a master key.")]),e._v(" "),a("h5",{attrs:{id:"_3-2-3-1-default-search-api-key"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-3-1-default-search-api-key"}},[e._v("#")]),e._v(" 3.2.3.1. Default Search API Key")]),e._v(" "),a("p",[e._v("The "),a("code",[e._v("Default Search API key")]),e._v(" gives access to the search endpoints on all indexes.")]),e._v(" "),a("p",[e._v("Here is how the "),a("code",[e._v("Default Search API Key")]),e._v(" is represented after its generation.")]),e._v(" "),a("div",{staticClass:"language-jsonc extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "uid": "01b4bc42-eb33-4041-b481-254d00cce834", //auto-generated value\n "key": "0a6e572506c52ab0bd6195921575d23092b7f0c284ab4ac86d12346c33057f99", //auto-generated value\n "name": "Default Search API Key",\n "description": "Use it to search from the frontend",\n "actions": [\n "search"\n ],\n "indexes": [\n "*"\n ],\n "expiresAt": null,\n "createdAt": "2021-08-11T10:00:00Z",\n "updatedAt": "2021-08-11T10:00:00Z"\n}\n')])])]),a("h5",{attrs:{id:"_3-2-3-2-default-admin-api-key"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-3-2-default-admin-api-key"}},[e._v("#")]),e._v(" 3.2.3.2. Default Admin API Key")]),e._v(" "),a("p",[e._v("The "),a("code",[e._v("Default Admin API key")]),e._v(" gives access to all actions by default.")]),e._v(" "),a("p",[e._v("Here is how the "),a("code",[e._v("Default Admin API Key")]),e._v(" is represented after its generation.")]),e._v(" "),a("div",{staticClass:"language-jsonc extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('{\n "uid": "ac06a7e1-6956-4699-bb04-dbeb72a231df", //auto-generated value\n "key": "380689dd379232519a54d15935750cc7625620a2ea2fc06907cb40ba5b421b6f", //auto-generated value\n "name": "Default Admin API Key",\n "description": "Use it for anything that is not a search operation. Caution! Do not expose it on a public frontend",\n "actions": [\n "*"\n ],\n "indexes": [\n "*"\n ],\n "expiresAt": null,\n "createdAt": "2021-08-11T10:00:00Z",\n "updatedAt": "2021-08-11T10:00:00Z"\n}\n')])])]),a("h4",{attrs:{id:"_3-2-4-api-endpoints-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-api-endpoints-definition"}},[e._v("#")]),e._v(" 3.2.4. API Endpoints Definition")]),e._v(" "),a("p",[e._v("Manipulate API keys of a Meilisearch instance. "),a("code",[e._v("/keys")]),e._v(" endpoints are "),a("strong",[e._v("only accessible by the master key holder.")])]),e._v(" "),a("h5",{attrs:{id:"_3-2-4-1-api-key-resource-representation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-1-api-key-resource-representation"}},[e._v("#")]),e._v(" 3.2.4.1. "),a("code",[e._v("API Key")]),e._v(" Resource Representation")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("field")]),e._v(" "),a("th",[e._v("type")]),e._v(" "),a("th",[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("uid")]),e._v(" "),a("td",[e._v("string")]),e._v(" "),a("td",[e._v("A unique identifier represented by a uuid v4. Can be specified at creation or generated by Meilisearch if ommited.")])]),e._v(" "),a("tr",[a("td",[e._v("key")]),e._v(" "),a("td",[e._v("string")]),e._v(" "),a("td",[e._v("The generated key to use when in the Authorization header when making requests. "),a("strong",[e._v("Generated by MeiliSearch by a combination of uid and the master key")]),e._v(".")])]),e._v(" "),a("tr",[a("td",[e._v("name")]),e._v(" "),a("td",[e._v("string")]),e._v(" "),a("td",[e._v("A non unique human readable name to ease identification of the API key. "),a("code",[e._v("null")]),e._v(" if empty.")])]),e._v(" "),a("tr",[a("td",[e._v("description")]),e._v(" "),a("td",[e._v("string")]),e._v(" "),a("td",[e._v("A description for the key. "),a("code",[e._v("null")]),e._v(" if empty.")])]),e._v(" "),a("tr",[a("td",[e._v("actions")]),e._v(" "),a("td",[e._v("array")]),e._v(" "),a("td",[e._v("A list of actions permitted for the key. "),a("code",[e._v('["*"]')]),e._v(" for all actions. See Actions List Definition part.")])]),e._v(" "),a("tr",[a("td",[e._v("indexes")]),e._v(" "),a("td",[e._v("array")]),e._v(" "),a("td",[e._v("A list of indexes permitted for the key. "),a("code",[e._v('["*"]')]),e._v(" for all indexes.")])]),e._v(" "),a("tr",[a("td",[e._v("expiresAt")]),e._v(" "),a("td",[e._v("string")]),e._v(" "),a("td",[e._v("Represent the expiration date and time as "),a("code",[e._v("RFC 3339")]),e._v(" format. "),a("code",[e._v("null")]),e._v(" equals to no expiration time.")])]),e._v(" "),a("tr",[a("td",[e._v("createdAt")]),e._v(" "),a("td",[e._v("string")]),e._v(" "),a("td",[e._v("Represent the date and time as "),a("code",[e._v("RFC 3339")]),e._v(" format when the API key has been created. "),a("strong",[e._v("Generated by MeiliSearch")])])]),e._v(" "),a("tr",[a("td",[e._v("updatedAt")]),e._v(" "),a("td",[e._v("string")]),e._v(" "),a("td",[e._v("Represent the date and time as "),a("code",[e._v("RFC 3339")]),e._v(" format when the API key has been updated. "),a("strong",[e._v("Default")]),e._v(": Value of "),a("code",[e._v("createdAt")]),e._v(". "),a("strong",[e._v("Generated by MeiliSearch")])])])])]),e._v(" "),a("h5",{attrs:{id:"_3-2-4-2-get-keys"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-2-get-keys"}},[e._v("#")]),e._v(" 3.2.4.2. "),a("code",[e._v("GET")]),e._v(" - "),a("code",[e._v("/keys")])]),e._v(" "),a("p",[e._v("Fetch the API keys of a Meilisearch instance.")]),e._v(" "),a("h6",{attrs:{id:"_3-2-4-2-1-query-parameter-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-2-1-query-parameter-definition"}},[e._v("#")]),e._v(" 3.2.4.2.1. Query Parameter Definition")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("Field")]),e._v(" "),a("th",[e._v("Type")]),e._v(" "),a("th",[e._v("Required")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[a("code",[e._v("offset")])]),e._v(" "),a("td",[e._v("Integer / "),a("code",[e._v("null")])]),e._v(" "),a("td",[e._v("false")])]),e._v(" "),a("tr",[a("td",[a("code",[e._v("limit")])]),e._v(" "),a("td",[e._v("Integer / "),a("code",[e._v("null")])]),e._v(" "),a("td",[e._v("false")])])])]),e._v(" "),a("h6",{attrs:{id:"offset"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#offset"}},[e._v("#")]),e._v(" "),a("code",[e._v("offset")])]),e._v(" "),a("ul",[a("li",[e._v("Type: Integer")]),e._v(" "),a("li",[e._v("Required: False")]),e._v(" "),a("li",[e._v("Default: "),a("code",[e._v("0")])])]),e._v(" "),a("p",[e._v("Sets the starting point in the results, effectively skipping over a given number of API keys.")]),e._v(" "),a("ul",[a("li",[e._v("🔴 Sending a value with a different type than "),a("code",[e._v("Integer")]),e._v(" for "),a("code",[e._v("offset")]),e._v(" returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key_offset"}},[e._v("invalid_api_key_offset")]),e._v(" error.")],1)]),e._v(" "),a("h6",{attrs:{id:"limit"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#limit"}},[e._v("#")]),e._v(" "),a("code",[e._v("limit")])]),e._v(" "),a("ul",[a("li",[e._v("Type: Integer")]),e._v(" "),a("li",[e._v("Required: False")]),e._v(" "),a("li",[e._v("Default: "),a("code",[e._v("20")])])]),e._v(" "),a("p",[e._v("Sets the maximum number of documents to be returned by the current request.")]),e._v(" "),a("ul",[a("li",[e._v("🔴 Sending a value with a different type than "),a("code",[e._v("Integer")]),e._v(" for "),a("code",[e._v("limit")]),e._v(" returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key_limit"}},[e._v("invalid_api_key_limit")]),e._v(" error.")],1)]),e._v(" "),a("h6",{attrs:{id:"_3-2-4-2-2-response-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-2-2-response-definition"}},[e._v("#")]),e._v(" 3.2.4.2.2. Response Definition")]),e._v(" "),a("p",[e._v("Returns a "),a("code",[e._v("200 Success")]),e._v(" HTTP code when the request is successful.")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("Field")]),e._v(" "),a("th",[e._v("Type")]),e._v(" "),a("th",[e._v("Required")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[a("code",[e._v("results")])]),e._v(" "),a("td",[e._v("Array of "),a("a",{attrs:{href:"#3241-api-key-resource-representation"}},[e._v("APIKey")])]),e._v(" "),a("td",[e._v("true")])]),e._v(" "),a("tr",[a("td",[a("code",[e._v("offset")])]),e._v(" "),a("td",[e._v("Integer")]),e._v(" "),a("td",[e._v("true")])]),e._v(" "),a("tr",[a("td",[a("code",[e._v("limit")])]),e._v(" "),a("td",[e._v("Integer")]),e._v(" "),a("td",[e._v("true")])]),e._v(" "),a("tr",[a("td",[a("code",[e._v("total")])]),e._v(" "),a("td",[e._v("Integer")]),e._v(" "),a("td",[e._v("true")])])])]),e._v(" "),a("h6",{attrs:{id:"results"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#results"}},[e._v("#")]),e._v(" "),a("code",[e._v("results")])]),e._v(" "),a("ul",[a("li",[e._v("Type: Array[APIKey]")]),e._v(" "),a("li",[e._v("Required: True")])]),e._v(" "),a("p",[e._v("An array containing the fetched API keys.")]),e._v(" "),a("h6",{attrs:{id:"offset-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#offset-2"}},[e._v("#")]),e._v(" "),a("code",[e._v("offset")])]),e._v(" "),a("ul",[a("li",[e._v("Type: Integer")]),e._v(" "),a("li",[e._v("Required: True")])]),e._v(" "),a("p",[e._v("Gives the "),a("code",[e._v("offset")]),e._v(" parameter used for the query.")]),e._v(" "),a("h6",{attrs:{id:"limit-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#limit-2"}},[e._v("#")]),e._v(" "),a("code",[e._v("limit")])]),e._v(" "),a("ul",[a("li",[e._v("Type: Integer")]),e._v(" "),a("li",[e._v("Required: True")])]),e._v(" "),a("p",[e._v("Gives the "),a("code",[e._v("limit")]),e._v(" parameter used for the query.")]),e._v(" "),a("h6",{attrs:{id:"total"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#total"}},[e._v("#")]),e._v(" "),a("code",[e._v("total")])]),e._v(" "),a("ul",[a("li",[e._v("Type: Integer")]),e._v(" "),a("li",[e._v("Required: True")])]),e._v(" "),a("p",[e._v("Gives the total number of API keys that can be browsed.")]),e._v(" "),a("blockquote",[a("p",[e._v("API Keys are ordered by "),a("code",[e._v("createdAt")]),e._v(" in "),a("code",[e._v("desc")]),e._v(" order. (Most recent first)")])]),e._v(" "),a("blockquote",[a("p",[e._v("Expired API keys can be found on the "),a("code",[e._v("/keys")]),e._v(" endpoints. An archiving system or a filter could allow to not display them by default. See Future Possibilities part.")])]),e._v(" "),a("h6",{attrs:{id:"_3-2-4-2-3-errors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-2-3-errors"}},[e._v("#")]),e._v(" 3.2.4.2.3. Errors")]),e._v(" "),a("ul",[a("li",[e._v("🔴 Accessing this route while a master key is not set for the instance returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_master_key"}},[e._v("missing_master_key")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Accessing this route without the "),a("code",[e._v("Authorization")]),e._v(" header returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_authorization_header"}},[e._v("missing_authorization_header")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Accessing this route without the master key returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key"}},[e._v("invalid_api_key")]),e._v(" error.")],1)]),e._v(" "),a("h6",{attrs:{id:"_3-2-4-2-4-example"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-2-4-example"}},[e._v("#")]),e._v(" 3.2.4.2.4. Example")]),e._v(" "),a("p",[a("code",[e._v("200 Success")])]),e._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"results"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"description"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"Manage Products/Reviews Documents API key"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"uid"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"ac06a7e1-6956-4699-bb04-dbeb72a231df"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"key"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"2fcdddd16ab75a4aeea6b74577874bc2888938a69ffafe3d05547560fa72e15b"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"actions"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"documents.add"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"documents.delete"')]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"indexes"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"products"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"reviews"')]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"expiresAt"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"2021-12-31T23:59:59Z"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"createdAt"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"2021-10-12T00:00:00Z"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"updatedAt"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"2021-10-13T15:00:00Z"')]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"description"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"Default Search API Key (Use it to search from the frontend code)"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"uid"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"87861fb0-e948-41da-ae7f-89617d57d5f5"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"key"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"0fe6fc6d94a21b5ca0b5a714bcb338865108039efc048e99e5ba2e7a976fa330"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"actions"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"search"')]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"indexes"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"*"')]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"expiresAt"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token null keyword"}},[e._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"createdAt"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"2021-08-11T10:00:00Z"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"updatedAt"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"2021-08-11T10:00:00Z"')]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"description"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"Default Admin API Key (Use it for all other operations. Caution! Do not share it on the client side)"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"uid"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"ad9af94e-d2db-420f-9ee3-9375f091e565"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"key"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"1846b591d7fd0454bc2b7f1c7ad80c411b1cfe46a51b0d44e6554a30f4bc0a18"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"actions"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"*"')]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"indexes"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"*"')]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"expiresAt"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token null keyword"}},[e._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"createdAt"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"2021-08-11T10:00:00Z"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"updatedAt"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"2021-08-11T10:00:00Z"')]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"offset"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"limit"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("20")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"total"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("3")]),e._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),a("blockquote",[a("p",[e._v("👉 Note the two default generated API keys here. When a master key is set at MeiliSearch's launch, it generates two pre-configured "),a("code",[e._v("API Keys")]),e._v(". A Default Search API Key restricted to the search action on all indexes and a Default Admin API Key on all indexes to handle all operations (except managing API Keys).")])]),e._v(" "),a("h5",{attrs:{id:"_3-2-4-3-get-keys-uid-or-key"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-3-get-keys-uid-or-key"}},[e._v("#")]),e._v(" 3.2.4.3. "),a("code",[e._v("GET")]),e._v(" - "),a("code",[e._v("/keys/:uid_or_key")])]),e._v(" "),a("p",[e._v("Fetch a specific API key of a Meilisearch instance from it's "),a("code",[e._v("uid")]),e._v(" or "),a("code",[e._v("key")]),e._v(" field.")]),e._v(" "),a("h6",{attrs:{id:"_3-2-4-3-1-query-parameter-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-3-1-query-parameter-definition"}},[e._v("#")]),e._v(" 3.2.4.3.1. Query Parameter Definition")]),e._v(" "),a("p",[e._v("n/a")]),e._v(" "),a("h6",{attrs:{id:"_3-2-4-3-2-response-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-3-2-response-definition"}},[e._v("#")]),e._v(" 3.2.4.3.2. Response Definition")]),e._v(" "),a("p",[e._v("Returns a "),a("code",[e._v("200 Success")]),e._v(" HTTP code when the request is successful.")]),e._v(" "),a("p",[e._v("See "),a("a",{attrs:{href:"#3241-api-key-resource-representation"}},[e._v("API Key Resource Representation")]),e._v(" section for the response body.")]),e._v(" "),a("h6",{attrs:{id:"_3-2-4-3-3-errors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-3-3-errors"}},[e._v("#")]),e._v(" 3.2.4.3.3. Errors")]),e._v(" "),a("ul",[a("li",[e._v("🔴 Accessing this route while a master key is not set for the instance returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_master_key"}},[e._v("missing_master_key")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Accessing this route without the "),a("code",[e._v("Authorization")]),e._v(" header returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_authorization_header"}},[e._v("missing_authorization_header")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Accessing this route without the master key or an API key missing the "),a("code",[e._v("keys.get")]),e._v(" permission returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key"}},[e._v("invalid_api_key")]),e._v(" error.")],1)]),e._v(" "),a("h5",{attrs:{id:"_3-2-4-4-post-keys"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-4-post-keys"}},[e._v("#")]),e._v(" 3.2.4.4. "),a("code",[e._v("POST")]),e._v(" - "),a("code",[e._v("/keys")])]),e._v(" "),a("p",[e._v("Create an API key.")]),e._v(" "),a("h6",{attrs:{id:"_3-2-4-4-1-payload-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-4-1-payload-definition"}},[e._v("#")]),e._v(" 3.2.4.4.1. Payload Definition")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("field")]),e._v(" "),a("th",[e._v("type")]),e._v(" "),a("th",[e._v("required")]),e._v(" "),a("th",[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("uid")]),e._v(" "),a("td",[e._v("string")]),e._v(" "),a("td",[e._v("Optional")]),e._v(" "),a("td",[e._v("A unique identifier represented by a "),a("a",{attrs:{href:"https://fr.wikipedia.org/wiki/Universally_unique_identifier",target:"_blank",rel:"noopener noreferrer"}},[e._v("uuid v4"),a("OutboundLink")],1),e._v(". Specified at creation or generated by Meilisearch if ommited.")])]),e._v(" "),a("tr",[a("td",[e._v("name")]),e._v(" "),a("td",[e._v("string")]),e._v(" "),a("td",[e._v("Optional")]),e._v(" "),a("td",[e._v("A non unique human readable name to ease identification of the API key. "),a("strong",[e._v("Default")]),e._v(": "),a("code",[e._v("null")])])]),e._v(" "),a("tr",[a("td",[e._v("description")]),e._v(" "),a("td",[e._v("string")]),e._v(" "),a("td",[e._v("Optional")]),e._v(" "),a("td",[e._v("A description for the API key. "),a("strong",[e._v("Default")]),e._v(": "),a("code",[e._v("null")])])]),e._v(" "),a("tr",[a("td",[e._v("actions")]),e._v(" "),a("td",[e._v("array")]),e._v(" "),a("td",[e._v("Required")]),e._v(" "),a("td",[e._v("A list of actions permitted for the API key. "),a("code",[e._v('["*"]')]),e._v(" for all actions. "),a("strong",[e._v("See Actions list definition part")]),e._v(". The "),a("code",[e._v("*")]),e._v(" character can be used as a wildcard when located at the last position. e.g. "),a("code",[e._v("documents.*")]),e._v(" to authorize access on all documents endpoints. "),a("strong",[e._v("Default")]),e._v(": "),a("code",[e._v("No default")])])]),e._v(" "),a("tr",[a("td",[e._v("indexes")]),e._v(" "),a("td",[e._v("array")]),e._v(" "),a("td",[e._v("Required")]),e._v(" "),a("td",[a("code",[e._v("[*]")]),e._v(" for all indexes. The "),a("code",[e._v("*")]),e._v(" character can be used as a wildcard when located in the last position. e.g. "),a("code",[e._v("products_*")]),e._v(" to allow access to all indexes whose names start with "),a("code",[e._v("products_")]),e._v(". "),a("strong",[e._v("Default")]),e._v(": "),a("code",[e._v("No Default")])])]),e._v(" "),a("tr",[a("td",[e._v("expiresAt")]),e._v(" "),a("td",[e._v("string")]),e._v(" "),a("td",[e._v("Required")]),e._v(" "),a("td",[e._v("The expiration date and time as "),a("code",[e._v("RFC 3339")]),e._v(" format. "),a("code",[e._v("null")]),e._v(" equals to no expiration time. Sending only the date part e.g "),a("code",[e._v("2021-12-01")]),e._v(" leads to having an "),a("code",[e._v("expiresAt")]),e._v(" value set to "),a("code",[e._v("2021-12-01T00:00:00")]),e._v(". "),a("strong",[e._v("Default")]),e._v(": "),a("code",[e._v("No Default")])])])])]),e._v(" "),a("h6",{attrs:{id:"_3-2-4-4-2-actions-list-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-4-2-actions-list-definition"}},[e._v("#")]),e._v(" 3.2.4.4.2. "),a("code",[e._v("actions")]),e._v(" List Definition")]),e._v(" "),a("blockquote",[a("p",[a("code",[e._v(":authorizedIndexes")]),e._v(" can be any value extracted from the "),a("code",[e._v("indexes")]),e._v(" field of an API key resource.")])]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("name")]),e._v(" "),a("th",[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("search")]),e._v(" "),a("td",[e._v("Provides access to "),a("code",[e._v("GET")]),e._v(" and "),a("code",[e._v("POST")]),e._v(" methods on "),a("code",[e._v("/indexes/:authorizedIndexes/search")]),e._v(" routes.")])]),e._v(" "),a("tr",[a("td",[e._v("documents.add")]),e._v(" "),a("td",[e._v("Provides access to "),a("code",[e._v("POST")]),e._v(" and "),a("code",[e._v("PUT")]),e._v(" on "),a("code",[e._v("/indexes/:authorizedIndexes/documents")]),e._v(" routes.")])]),e._v(" "),a("tr",[a("td",[e._v("documents.get")]),e._v(" "),a("td",[e._v("Provides access to "),a("code",[e._v("GET")]),e._v(" methods on "),a("code",[e._v("/indexes/:authorizedIndexes/documents")]),e._v(", "),a("code",[e._v("/indexes/:authorizedIndexes/documents/:documentId")]),e._v(" and "),a("code",[e._v("POST")]),e._v(" methods on "),a("code",[e._v("/indexes/:authorizedIndexes/documents/fetch")]),e._v(" routes.")])]),e._v(" "),a("tr",[a("td",[e._v("documents.delete")]),e._v(" "),a("td",[e._v("Provides access to "),a("code",[e._v("DELETE")]),e._v(" method on "),a("code",[e._v("/indexes/:authorizedIndexes/documents/:documentId")]),e._v(", "),a("code",[e._v("indexes/:authorizedIndexes/documents/:documentId")]),e._v(" and "),a("code",[e._v("POST")]),e._v(" method on "),a("code",[e._v("/indexes/:authorizedIndexes/documents/delete-batch")]),e._v(" and "),a("code",[e._v("/indexes/:authorizedIndexes/documents/delete")]),e._v(" routes.")])]),e._v(" "),a("tr",[a("td",[e._v("indexes.create")]),e._v(" "),a("td",[e._v("Provides access to "),a("code",[e._v("POST")]),e._v(" "),a("code",[e._v("/indexes")]),e._v(". "),a("strong",[e._v("⚠️ "),a("code",[e._v("indexes")]),e._v(" field should indicate the newly created index or having "),a("code",[e._v("[*]")]),e._v(" to permits access on it.")]),e._v(".")])]),e._v(" "),a("tr",[a("td",[e._v("indexes.get")]),e._v(" "),a("td",[e._v("Provides access to "),a("code",[e._v("GET")]),e._v(" "),a("code",[e._v("/indexes")]),e._v(" and "),a("code",[e._v("/indexes/:authorizedIndexes")]),e._v(". "),a("strong",[e._v("⚠️Non-authorized "),a("code",[e._v("indexes")]),e._v(" are omitted from the response on "),a("code",[e._v("/indexes")])]),e._v(".")])]),e._v(" "),a("tr",[a("td",[e._v("indexes.update")]),e._v(" "),a("td",[e._v("Provides access to "),a("code",[e._v("PUT")]),e._v(" "),a("code",[e._v("/indexes/:authorizedIndexes")]),e._v(".")])]),e._v(" "),a("tr",[a("td",[e._v("indexes.delete")]),e._v(" "),a("td",[e._v("Provides access to "),a("code",[e._v("DELETE")]),e._v(" "),a("code",[e._v("/indexes/:authorizedIndexes")]),e._v(".")])]),e._v(" "),a("tr",[a("td",[e._v("indexes.swap")]),e._v(" "),a("td",[e._v("Provides access to "),a("code",[e._v("POST")]),e._v(" "),a("code",[e._v("/swap-indexes")]),e._v(". See "),a("RouterLink",{attrs:{to:"/specifications/text/0191-swap-indexes-api.html"}},[e._v("Swap Indexes API")]),e._v(" specification.")],1)]),e._v(" "),a("tr",[a("td",[e._v("tasks.get")]),e._v(" "),a("td",[e._v("Provides access to "),a("code",[e._v("GET")]),e._v(" "),a("code",[e._v("/tasks")]),e._v(". "),a("strong",[e._v("⚠️Non-authorized "),a("code",[e._v("indexes")]),e._v(" are omitted from the response on "),a("code",[e._v("/tasks")])]),e._v(". Also add access to "),a("code",[e._v("GET")]),e._v(" "),a("code",[e._v("/indexes/:authorizedIndexes/tasks")]),e._v(" routes.")])]),e._v(" "),a("tr",[a("td",[e._v("tasks.cancel")]),e._v(" "),a("td",[e._v("Provides access to "),a("code",[e._v("POST")]),e._v(" "),a("code",[e._v("/tasks/cancel")]),e._v(". route.")])]),e._v(" "),a("tr",[a("td",[e._v("tasks.delete")]),e._v(" "),a("td",[e._v("Provides access to "),a("code",[e._v("DELETE")]),e._v(" "),a("code",[e._v("/tasks")]),e._v(" route.")])]),e._v(" "),a("tr",[a("td",[e._v("settings.get")]),e._v(" "),a("td",[e._v("Provides access to "),a("code",[e._v("GET")]),e._v(" "),a("code",[e._v("/indexes/:authorizedIndexes/settings")]),e._v(" and "),a("code",[e._v("/indexes/:authorizedIndexes/settings/*")]),e._v(" routes.")])]),e._v(" "),a("tr",[a("td",[e._v("settings.update")]),e._v(" "),a("td",[e._v("Provides access to "),a("code",[e._v("POST / DELETE")]),e._v(" "),a("code",[e._v("/indexes/:authorizedIndexes/settings")]),e._v(" and "),a("code",[e._v("/indexes/:authorizedIndexes/settings/*")]),e._v(" routes.")])]),e._v(" "),a("tr",[a("td",[e._v("stats.get")]),e._v(" "),a("td",[e._v("Provides access to "),a("code",[e._v("GET")]),e._v(" "),a("code",[e._v("/stats")]),e._v(". "),a("strong",[e._v("⚠️Non-authorized "),a("code",[e._v("indexes")]),e._v(" are omitted from the response on "),a("code",[e._v("/stats")])]),e._v(". Also add access to "),a("code",[e._v("GET")]),e._v(" "),a("code",[e._v("/indexes/:authorizedIndexes/stats")]),e._v(".")])]),e._v(" "),a("tr",[a("td",[e._v("metrics.get")]),e._v(" "),a("td",[e._v("Provides access to "),a("code",[e._v("GET")]),e._v(" "),a("code",[e._v("/metrics")]),e._v(" route. "),a("strong",[e._v("A restriction on "),a("code",[e._v("indexes")]),e._v(" stops you from calling the route.")])])]),e._v(" "),a("tr",[a("td",[e._v("dumps.create")]),e._v(" "),a("td",[e._v("Provides access to "),a("code",[e._v("POST")]),e._v(" "),a("code",[e._v("/dumps")]),e._v(" route. "),a("strong",[e._v("As dumps are not scoped by indexes, a restriction on "),a("code",[e._v("indexes")]),e._v(" does not affect this action.")])])]),e._v(" "),a("tr",[a("td",[e._v("snapshots.create")]),e._v(" "),a("td",[e._v("Provides access to "),a("code",[e._v("POST")]),e._v(" "),a("code",[e._v("/snapshots")]),e._v(" route. "),a("strong",[e._v("As snapshots are not scoped by indexes, a restriction on "),a("code",[e._v("indexes")]),e._v(" does not affect this action.")])])]),e._v(" "),a("tr",[a("td",[e._v("version")]),e._v(" "),a("td",[e._v("Provides access to "),a("code",[e._v("GET")]),e._v(" "),a("code",[e._v("/version")]),e._v(" route.")])]),e._v(" "),a("tr",[a("td",[e._v("keys.get")]),e._v(" "),a("td",[e._v("Provides access to "),a("code",[e._v("GET")]),e._v(" "),a("code",[e._v("/keys")]),e._v(" route.")])]),e._v(" "),a("tr",[a("td",[e._v("keys.create")]),e._v(" "),a("td",[e._v("Provides access to "),a("code",[e._v("POST")]),e._v(" "),a("code",[e._v("/keys")]),e._v(" route.")])]),e._v(" "),a("tr",[a("td",[e._v("keys.update")]),e._v(" "),a("td",[e._v("Provides access to "),a("code",[e._v("PATCH")]),e._v(" "),a("code",[e._v("/keys")]),e._v(" routes.")])]),e._v(" "),a("tr",[a("td",[e._v("keys.delete")]),e._v(" "),a("td",[e._v("Provides access to "),a("code",[e._v("DELETE")]),e._v(" "),a("code",[e._v("/keys")]),e._v(" routes.")])]),e._v(" "),a("tr",[a("td",[e._v("experimental.get")]),e._v(" "),a("td",[e._v("Provides access to "),a("code",[e._v("GET")]),e._v(" "),a("code",[e._v("/experimental-features")]),e._v(" routes.")])]),e._v(" "),a("tr",[a("td",[e._v("experimental.update")]),e._v(" "),a("td",[e._v("Provides access to "),a("code",[e._v("PATCH")]),e._v(" "),a("code",[e._v("/experimental-features")]),e._v(" routes.")])])])]),e._v(" "),a("h6",{attrs:{id:"_3-2-4-4-3-response-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-4-3-response-definition"}},[e._v("#")]),e._v(" 3.2.4.4.3. Response Definition")]),e._v(" "),a("p",[e._v("Returns a "),a("code",[e._v("201 Created")]),e._v(" HTTP code when the request is successful.")]),e._v(" "),a("p",[e._v("See "),a("a",{attrs:{href:"#3241-api-key-resource-representation"}},[e._v("API Key Resource Representation")]),e._v(" section for the response body.")]),e._v(" "),a("h6",{attrs:{id:"_3-2-4-4-3-errors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-4-3-errors"}},[e._v("#")]),e._v(" 3.2.4.4.3. Errors")]),e._v(" "),a("ul",[a("li",[e._v("🔴 Accessing this route while a master key is not set for the instance returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_master_key"}},[e._v("missing_master_key")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Accessing this route without the "),a("code",[e._v("Authorization")]),e._v(" header returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_authorization_header"}},[e._v("missing_authorization_header")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Accessing this route without the master key or an API key missing the "),a("code",[e._v("keys.create")]),e._v(" permission returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key"}},[e._v("invalid_api_key")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Omitting Content-Type header returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_content_type"}},[e._v("missing_content_type")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending an empty Content-Type returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_content_type"}},[e._v("invalid_content_type")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending a different Content-Type than "),a("code",[e._v("application/json")]),e._v(" returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_content_type"}},[e._v("invalid_content_type")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending an empty payload returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_payload"}},[e._v("missing_payload")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending a different payload type than the Content-Type header returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#malformed_payload"}},[e._v("malformed_payload")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending an invalid json format returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#malformed_payload"}},[e._v("malformed_payload")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Omitting "),a("code",[e._v("actions")]),e._v(" field from the payload returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_api_key_actions"}},[e._v("missing_api_key_actions")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Omitting "),a("code",[e._v("indexes")]),e._v(" field from the payload returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_api_key_indexes"}},[e._v("missing_api_key_indexes")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Omitting "),a("code",[e._v("expiresAt")]),e._v(" field from the payload returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_api_key_expires_at"}},[e._v("missing_api_key_expires_at")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending an "),a("code",[e._v("uid")]),e._v(" field that already exists returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#api_key_already_exists"}},[e._v("api_key_already_exists")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending an invalid value for the "),a("code",[e._v("uid")]),e._v(" field returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key_uid"}},[e._v("invalid_api_key_uid")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending an invalid value for the "),a("code",[e._v("actions")]),e._v(" field returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key_actions"}},[e._v("invalid_api_key_actions")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending an invalid value for the "),a("code",[e._v("indexes")]),e._v(" field returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key_indexes"}},[e._v("invalid_api_key_indexes")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending an invalid value for the "),a("code",[e._v("expiresAt")]),e._v(" field returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key_expires_at"}},[e._v("invalid_api_key_expires_at")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending an invalid value for the "),a("code",[e._v("name")]),e._v(" field returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key_name"}},[e._v("invalid_api_key_name")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending an invalid value for the "),a("code",[e._v("description")]),e._v(" field returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key_description"}},[e._v("invalid_api_key_description")]),e._v(" error.")],1)]),e._v(" "),a("h5",{attrs:{id:"_3-2-4-5-patch-keys-uid-or-key"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-5-patch-keys-uid-or-key"}},[e._v("#")]),e._v(" 3.2.4.5. "),a("code",[e._v("PATCH")]),e._v(" - "),a("code",[e._v("/keys/:uid_or_key")])]),e._v(" "),a("p",[e._v("Update an API key found by it's "),a("code",[e._v("uid")]),e._v(" or "),a("code",[e._v("key")]),e._v(" field. Only the "),a("code",[e._v("name")]),e._v(" and "),a("code",[e._v("description")]),e._v(" fields of an API key can be modified.")]),e._v(" "),a("h6",{attrs:{id:"_3-2-4-5-1-payload-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-5-1-payload-definition"}},[e._v("#")]),e._v(" 3.2.4.5.1. Payload Definition")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("field")]),e._v(" "),a("th",[e._v("type")]),e._v(" "),a("th",[e._v("required")]),e._v(" "),a("th",[e._v("description")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[e._v("name")]),e._v(" "),a("td",[e._v("string")]),e._v(" "),a("td",[e._v("Optional")]),e._v(" "),a("td",[e._v("A name for the API Key. "),a("strong",[e._v("Default")]),e._v(": "),a("code",[e._v("null")])])]),e._v(" "),a("tr",[a("td",[e._v("description")]),e._v(" "),a("td",[e._v("string")]),e._v(" "),a("td",[e._v("Optional")]),e._v(" "),a("td",[e._v("A description for the API key. "),a("strong",[e._v("Default")]),e._v(": "),a("code",[e._v("null")])])])])]),e._v(" "),a("h6",{attrs:{id:"_3-2-4-5-2-response-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-5-2-response-definition"}},[e._v("#")]),e._v(" 3.2.4.5.2. Response Definition")]),e._v(" "),a("p",[e._v("Returns a "),a("code",[e._v("200 Success")]),e._v(" HTTP code when the request is successful.")]),e._v(" "),a("p",[e._v("See "),a("a",{attrs:{href:"#3241-api-key-resource-representation"}},[e._v("API Key Resource Representation")]),e._v(" section for the response body.")]),e._v(" "),a("h6",{attrs:{id:"_3-2-4-5-3-errors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-5-3-errors"}},[e._v("#")]),e._v(" 3.2.4.5.3. Errors")]),e._v(" "),a("ul",[a("li",[e._v("🔴 Accessing this route while a master key is not set for the instance returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_master_key"}},[e._v("missing_master_key")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Accessing this route without the "),a("code",[e._v("Authorization")]),e._v(" header returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_authorization_header"}},[e._v("missing_authorization_header")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Accessing this route without the master key or an API key missing the "),a("code",[e._v("keys.update")]),e._v(" permission returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key"}},[e._v("invalid_api_key")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Attempting to access an API key that does not exist returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#api_key_not_found"}},[e._v("api_key_not_found")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Omitting Content-Type header returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_content_type"}},[e._v("missing_content_type")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending an empty Content-Type returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_content_type"}},[e._v("invalid_content_type")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending a different Content-Type than "),a("code",[e._v("application/json")]),e._v(" returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_content_type"}},[e._v("invalid_content_type")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending an empty payload returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_payload"}},[e._v("missing_payload")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending a different payload type than the Content-Type header returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#malformed_payload"}},[e._v("malformed_payload")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending an invalid json format returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#malformed_payload"}},[e._v("malformed_payload")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending an invalid value for the "),a("code",[e._v("name")]),e._v(" field returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key_name"}},[e._v("invalid_api_key_name")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending an invalid value for the "),a("code",[e._v("description")]),e._v(" field returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key_description"}},[e._v("invalid_api_key_description")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending "),a("code",[e._v("uid")]),e._v(" in the payload request returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#immutable_api_key_uid"}},[e._v("immutable_api_key_uid")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending "),a("code",[e._v("key")]),e._v(" in the payload request returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#immutable_api_key_key"}},[e._v("immutable_api_key_key")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending "),a("code",[e._v("actions")]),e._v(" in the payload request returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#immutable_api_key_actions"}},[e._v("immutable_api_key_actions")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending "),a("code",[e._v("indexes")]),e._v(" in the payload request returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#immutable_api_key_indexes"}},[e._v("immutable_api_key_indexes")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending "),a("code",[e._v("expiresAt")]),e._v(" in the payload request returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#immutable_api_key_expires_at"}},[e._v("immutable_api_key_expires_at")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending "),a("code",[e._v("createdAt")]),e._v(" in the payload request returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#immutable_api_key_created_at"}},[e._v("immutable_api_key_created_at")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending "),a("code",[e._v("updatedAt")]),e._v(" in the payload request returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#immutable_api_key_updated_at"}},[e._v("immutable_api_key_updated_at")]),e._v(" error.")],1)]),e._v(" "),a("h5",{attrs:{id:"_3-2-4-6-delete-keys-uid-or-key"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-6-delete-keys-uid-or-key"}},[e._v("#")]),e._v(" 3.2.4.6. "),a("code",[e._v("DELETE")]),e._v(" - "),a("code",[e._v("/keys/:uid_or_key")])]),e._v(" "),a("p",[e._v("Delete an API key found by it's "),a("code",[e._v("uid")]),e._v(" or "),a("code",[e._v("key")]),e._v(" field.")]),e._v(" "),a("h6",{attrs:{id:"_3-2-4-6-1-payload-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-6-1-payload-definition"}},[e._v("#")]),e._v(" 3.2.4.6.1. Payload Definition")]),e._v(" "),a("p",[e._v("n/a")]),e._v(" "),a("h6",{attrs:{id:"_3-2-4-6-2-response-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-6-2-response-definition"}},[e._v("#")]),e._v(" 3.2.4.6.2. Response Definition")]),e._v(" "),a("p",[e._v("Returns a "),a("code",[e._v("204 No-Content")]),e._v(" HTTP code when the request is successful.")]),e._v(" "),a("h6",{attrs:{id:"_3-2-4-6-3-errors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-6-3-errors"}},[e._v("#")]),e._v(" 3.2.4.6.3. Errors")]),e._v(" "),a("ul",[a("li",[e._v("🔴 Accessing this route while a master key is not set for the instance returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_master_key"}},[e._v("missing_master_key")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Accessing this route without the "),a("code",[e._v("Authorization")]),e._v(" header returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_authorization_header"}},[e._v("missing_authorization_header")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Accessing this route without the master key or an API key missing the "),a("code",[e._v("keys.delete")]),e._v(" permission returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key"}},[e._v("invalid_api_key")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Attempting to access an API key that does not exist returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#api_key_not_found"}},[a("code",[e._v("api_key_not_found")])]),e._v(" error.")],1)]),e._v(" "),a("h5",{attrs:{id:"_3-2-4-7-using-an-api-key-on-client-code"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-7-using-an-api-key-on-client-code"}},[e._v("#")]),e._v(" 3.2.4.7. Using an API key on client-code")]),e._v(" "),a("h6",{attrs:{id:"_3-2-4-7-1-authorization-bearer-header"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-7-1-authorization-bearer-header"}},[e._v("#")]),e._v(" 3.2.4.7.1 Authorization Bearer Header")]),e._v(" "),a("p",[e._v("When the Meilisearch API is secured by the presence of a master key, the "),a("code",[e._v("Authorization")]),e._v(" header must be used with a bearer to authorize requests. The specified value must be the value of the "),a("code",[e._v("key")]),e._v(" field of an API key.")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v(' "Authorization: Bearer `:key`"\n "Content-Type: application/json"\n')])])]),a("ul",[a("li",[e._v("🔴 Accessing a route with an "),a("code",[e._v("API Key")]),e._v(" that has expired, been deleted or don't have sufficient permissions returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key"}},[e._v("invalid_api_key")]),e._v(" error.")],1)]),e._v(" "),a("h2",{attrs:{id:"_4-technical-aspects"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-technical-aspects"}},[e._v("#")]),e._v(" 4. Technical Aspects")]),e._v(" "),a("h3",{attrs:{id:"_4-1-api-key-generation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-api-key-generation"}},[e._v("#")]),e._v(" 4.1. API Key generation")]),e._v(" "),a("p",[e._v("An "),a("code",[e._v("uid")]),e._v(" representing by a uuid v4 is generated if not specified at creation by the user.")]),e._v(" "),a("p",[e._v("The final key is then an HMAC with the master key, as the secret, and the "),a("code",[e._v("uid")]),e._v(", a hyphenated Uuidv4, as the data. HMAC uses an SHA-256 algorithm internally.")]),e._v(" "),a("p",[e._v("The final key could be generated with openssl as below:")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",[a("code",[e._v("echo -n $HYPHENATED_UUID | openssl dgst -sha256 -hmac $MASTER_KEY\n")])])]),a("h3",{attrs:{id:"_4-2-synchronous-write-of-api-key-resources"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-synchronous-write-of-api-key-resources"}},[e._v("#")]),e._v(" 4.2. Synchronous write of "),a("code",[e._v("API Key")]),e._v(" resources")]),e._v(" "),a("p",[e._v("Writing to "),a("code",[e._v("/keys")]),e._v(" endpoints are synchronous in order to return errors directly to the user when he performs an operation on them. This means that API key management operations do not appear as a task on "),a("code",[e._v("/tasks")]),e._v(".")]),e._v(" "),a("h3",{attrs:{id:"_4-3-propagating-api-key-to-dumps"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-3-propagating-api-key-to-dumps"}},[e._v("#")]),e._v(" 4.3. Propagating "),a("code",[e._v("API Key")]),e._v(" to dumps.")]),e._v(" "),a("p",[e._v("The generated API keys must also transit within a dump to facilitate the upgrade of a MeiliSearch instance.")]),e._v(" "),a("blockquote",[a("p",[e._v("🚨 As a reminder, dumps must be stored in secure areas not accessible to the public or unaccredited persons. In general, you should avoid moving them off the host machine or do so via a secure channel as a security measure.")])]),e._v(" "),a("p",[e._v("If the dumps ever leak, the api keys cannot be spoofed from the dump inspection because it needs the master key to have the full value of a valid API key. Only the "),a("code",[e._v("uid")]),e._v(" value is propagated in the dumps.")]),e._v(" "),a("h3",{attrs:{id:"_4-4-propagating-api-key-to-snapshots"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-4-propagating-api-key-to-snapshots"}},[e._v("#")]),e._v(" 4.4. Propagating "),a("code",[e._v("API Key")]),e._v(" to snapshots.")]),e._v(" "),a("p",[e._v("The generated API keys must also transit within a snapshot to facilitate the recovery of a MeiliSearch instance.")]),e._v(" "),a("blockquote",[a("p",[e._v("🚨 As a reminder, snapshots must be stored in secure areas not accessible to the public or unaccredited persons. In general, you should avoid moving them off the host machine or do so via a secure channel as a security measure.")])]),e._v(" "),a("p",[e._v("If the snapshot ever leak, the "),a("code",[e._v("API keys")]),e._v(" cannot be spoofed from the snapshot inspection because it needs the master key to have the full value of a valid "),a("code",[e._v("API key")]),e._v(". Only the "),a("code",[e._v("uid")]),e._v(" value is propagated in the snapshots.")]),e._v(" "),a("h3",{attrs:{id:"_4-5-api-keys-storage-size-limit"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-5-api-keys-storage-size-limit"}},[e._v("#")]),e._v(" 4.5. API Keys storage size limit")]),e._v(" "),a("p",[e._v("The maximum size of the API key storage layer is "),a("code",[e._v("100GB")]),e._v(".")]),e._v(" "),a("h2",{attrs:{id:"_5-future-possibilities"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-future-possibilities"}},[e._v("#")]),e._v(" 5. Future Possibilities")]),e._v(" "),a("ul",[a("li",[e._v("Regenerate a specific "),a("code",[e._v("API Key")]),e._v(".")]),e._v(" "),a("li",[e._v('Have an "archive" state where manually deleted API Keys can be restored for a certain amount of time.')]),e._v(" "),a("li",[e._v("Add rate-limiting per API Key.")]),e._v(" "),a("li",[e._v("A restriction on the maximum offset/limit.")]),e._v(" "),a("li",[e._v("Add search parameters restrictions for an API Key.")]),e._v(" "),a("li",[e._v("Add rfc2822 format expression for "),a("code",[e._v("expiredAt")]),e._v(" field. e.g. "),a("code",[e._v("Wed, 18 Feb 2022 23:16:09 GMT")])]),e._v(" "),a("li",[e._v("Add an alias that can only be associated to one API Key to retrieve it easily on client side. e.g. "),a("code",[e._v("GET /keys/:uid_or_alias")])]),e._v(" "),a("li",[e._v("Supports wildcard expressions at the start/middle of a string.")])])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file diff --git a/docs/assets/js/32.88319e61.js b/docs/assets/js/32.bac37d5d.js similarity index 99% rename from docs/assets/js/32.88319e61.js rename to docs/assets/js/32.bac37d5d.js index 9c2e4305b..97ad514fd 100644 --- a/docs/assets/js/32.88319e61.js +++ b/docs/assets/js/32.bac37d5d.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[32],{456:function(e,t,a){"use strict";a.r(t);var i=a(62),r=Object(i.a)({},(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[a("h1",{attrs:{id:"dumps-api-and-cli"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#dumps-api-and-cli"}},[e._v("#")]),e._v(" Dumps API and CLI")]),e._v(" "),a("h2",{attrs:{id:"_1-summary"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-summary"}},[e._v("#")]),e._v(" 1. Summary")]),e._v(" "),a("p",[e._v("A dump is a compressed file containing an export of a MeiliSearch instance. It contains all indexes, documents, settings, tasks, and API keys but in a raw unprocessed form. A dump isn't an exact copy of a database—it is closer to a blueprint that allows creating of an identical dataset.")]),e._v(" "),a("h2",{attrs:{id:"_2-motivation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-motivation"}},[e._v("#")]),e._v(" 2. Motivation")]),e._v(" "),a("p",[e._v("The dumps exist to upgrade a MeiliSearch instance from a previous version to a more recent version. It can also be a helpful tool for loading a production state on a staging server to make changes and test them before propagating them to production.")]),e._v(" "),a("h2",{attrs:{id:"_3-functional-specification"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-functional-specification"}},[e._v("#")]),e._v(" 3. Functional Specification")]),e._v(" "),a("h3",{attrs:{id:"_3-1-summary-key-points"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-summary-key-points"}},[e._v("#")]),e._v(" 3.1. Summary Key Points")]),e._v(" "),a("ul",[a("li",[e._v("A dump creation can be scheduled from the MeiliSearch API using the "),a("code",[e._v("POST - /dumps")]),e._v(" endpoint.")]),e._v(" "),a("li",[e._v("A dump creation status can be tracked using the "),a("code",[e._v("GET - /tasks/:task_uid")]),e._v(" endpoint.")]),e._v(" "),a("li",[e._v("MeiliSearch can only create one dump at a time.")]),e._v(" "),a("li",[e._v("By default, dumps are created in a folder named "),a("code",[e._v("dumps")]),e._v(", and can be found in the same directory as the MeiliSearch binary.")]),e._v(" "),a("li",[e._v("The "),a("code",[e._v("dumps")]),e._v(" directory can be customized using the "),a("code",[e._v("--dump-dir")]),e._v(" configuration option. If the dump directory does not already exist when the dump creation process is called, MeiliSearch will create it.")]),e._v(" "),a("li",[e._v("A "),a("code",[e._v(".dump")]),e._v(" file can be imported using the "),a("code",[e._v("--import-dump")]),e._v(" command-line flag.")]),e._v(" "),a("li",[e._v("The MeiliSearch server starts when the dump is fully imported and indexed.")]),e._v(" "),a("li",[e._v("By default, importing a dump when a database already exists (a non-empty data.ms folder in the same directory as the MeiliSearch binary) will stop the process and throw an error.")]),e._v(" "),a("li",[e._v("When using the command-line flag "),a("code",[e._v("--ignore-dump-if-db-exists=true")]),e._v(", MeiliSearch will use the existing database to start an instance instead of throwing an error. The dump will be ignored.")]),e._v(" "),a("li",[e._v("By default, trying to import a dump that does not exist, will stop the process and throw an error.")]),e._v(" "),a("li",[e._v("When using the command-line flag "),a("code",[e._v("--ignore-missing-dump")]),e._v(", MeiliSearch will continue its process and not throw an error.")]),e._v(" "),a("li",[e._v("When a dump is being imported, the http API is not available. Meilisearch can't receive read or write requests.")]),e._v(" "),a("li",[a("code",[e._v("dumpCreation")]),e._v(" task takes priority over enqueued "),a("code",[e._v("tasks")]),e._v(". This means that if a "),a("code",[e._v("dumpCreation")]),e._v(" task is created, it will be directly processed when the current processing task finishes even if other tasks have been enqueued before.")])]),e._v(" "),a("hr"),e._v(" "),a("h3",{attrs:{id:"_3-2-dumps-api-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-dumps-api-definition"}},[e._v("#")]),e._v(" 3.2. Dumps API Definition")]),e._v(" "),a("h4",{attrs:{id:"_3-2-1-post-dumps"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-1-post-dumps"}},[e._v("#")]),e._v(" 3.2.1. POST "),a("code",[e._v("/dumps")])]),e._v(" "),a("p",[e._v("Create a dump")]),e._v(" "),a("h5",{attrs:{id:"_3-2-1-1-body-payload"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-1-1-body-payload"}},[e._v("#")]),e._v(" 3.2.1.1. Body Payload")]),e._v(" "),a("p",[e._v("N/A")]),e._v(" "),a("h5",{attrs:{id:"_3-2-1-2-response-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-1-2-response-definition"}},[e._v("#")]),e._v(" 3.2.1.2. Response Definition")]),e._v(" "),a("p",[e._v("When the request is successful, Meilisearch returns the HTTP code "),a("code",[e._v("202 Accepted")]),e._v(". The response's content is the summarized representation of the received asynchronous task.")]),e._v(" "),a("p",[e._v("See "),a("RouterLink",{attrs:{to:"/specifications/text/0060-tasks-api.html#summarized-task-object-for-202-accepted"}},[e._v("Summarized "),a("code",[e._v("task")]),e._v(" Object for "),a("code",[e._v("202 Accepted")])]),e._v(".")],1),e._v(" "),a("p",[e._v("The uid of the generated dump can be found in the task details.")]),e._v(" "),a("h5",{attrs:{id:"_3-2-1-3-errors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-1-3-errors"}},[e._v("#")]),e._v(" 3.2.1.3. Errors")]),e._v(" "),a("ul",[a("li",[e._v("🔴 If Meilisearch is secured, accessing this route without the "),a("code",[e._v("Authorization")]),e._v(" header returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_authorization_header"}},[e._v("missing_authorization_header")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 If Meilisearch is secured, accessing this route with a key that does not have permissions (i.e. other than the master-key) returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key"}},[e._v("invalid_api_key")]),e._v(" error.")],1)]),e._v(" "),a("hr"),e._v(" "),a("h3",{attrs:{id:"_3-3-cli-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-cli-definition"}},[e._v("#")]),e._v(" 3.3. CLI Definition")]),e._v(" "),a("h4",{attrs:{id:"_3-3-1-dump-dir"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-1-dump-dir"}},[e._v("#")]),e._v(" 3.3.1. "),a("code",[e._v("--dump-dir")])]),e._v(" "),a("p",[e._v("By default, MeiliSearch creates dumps in a directory called "),a("code",[e._v("dumps")]),e._v(" at the root of your MeiliSearch.")]),e._v(" "),a("p",[e._v("The destination can be modified with the "),a("code",[e._v("--dump-dir")]),e._v(" flag. e.g. "),a("code",[e._v("--dump-dir myDumps")])]),e._v(" "),a("h4",{attrs:{id:"_3-3-2-import-dump"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-import-dump"}},[e._v("#")]),e._v(" 3.3.2. "),a("code",[e._v("--import-dump")])]),e._v(" "),a("p",[e._v("Using the CLI flag "),a("code",[e._v("--import-dump")]),e._v(", MeiliSearch will replace the data.ms with the dump data and start the server using the provided dump. e.g. "),a("code",[e._v("--import-dump dumps/20220117-144855452.dump")]),e._v(".")]),e._v(" "),a("p",[e._v("If the "),a("code",[e._v("--import-dump")]),e._v(" flag is specified when a database exists, an error occurs in the CLI.")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('Error: database already exists at ":pathToDataMs/data.ms", try to delete it or rename it\n')])])]),a("h4",{attrs:{id:"_3-3-3-ignore-dump-if-db-exists"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-3-ignore-dump-if-db-exists"}},[e._v("#")]),e._v(" 3.3.3. "),a("code",[e._v("--ignore-dump-if-db-exists")])]),e._v(" "),a("p",[e._v("To avoid MeiliSearch to throw an error when finding that a database already exists, the following flag: "),a("code",[e._v("--ignore-dump-if-db-exists")]),e._v(" can be used. When using this flag, MeiliSearch will use the existing database to start an instance instead of throwing an error. The dump will be ignored.")]),e._v(" "),a("h4",{attrs:{id:"_3-3-4-ignore-missing-dump"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-4-ignore-missing-dump"}},[e._v("#")]),e._v(" 3.3.4. "),a("code",[e._v("--ignore-missing-dump")])]),e._v(" "),a("p",[e._v("To avoid MeiliSearch to throw an error when there is no dump at the given path, the following flag: "),a("code",[e._v("--ignore-missing-dump")]),e._v(" can be used. MeiliSearch will then continue its process and not import any dump.")]),e._v(" "),a("p",[e._v("If the "),a("code",[e._v("--ignore-missing-dump")]),e._v(" flag is not specified and the file cannot be found, an error occurs in the CLI.")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('Error: dump doesn\'t exist at ":pathToDumps/:missingFile"\n')])])]),a("h4",{attrs:{id:"_3-3-5-other-dump-related-errors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-5-other-dump-related-errors"}},[e._v("#")]),e._v(" 3.3.5 Other dump related errors")]),e._v(" "),a("p",[e._v("When starting a new Meilisearch version, if Meilisearch tries to read an old data.ms and but cannot read it, the following message should appear:")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v("Error: Your database version (`:old_version`) is incompatible with your current engine (`:new_version`). To migrate data between Meilisearch versions, follow our guide on https://docs.meilisearch.com/learn/advanced/updating.html\n")])])]),a("hr"),e._v(" "),a("h3",{attrs:{id:"_3-4-dump-version-support"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-4-dump-version-support"}},[e._v("#")]),e._v(" 3.4. Dump version support")]),e._v(" "),a("p",[e._v("To handle dump and Meilisearch version compatibility, it is necessary to also versionize the dumps feature.")]),e._v(" "),a("p",[e._v("The following table describes which version of the dump correspond to which version of Meilisearch")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("Dump version")]),e._v(" "),a("th",[e._v("Meilisearch version")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[a("code",[e._v("v1")])]),e._v(" "),a("td",[a("code",[e._v("v0.20.0")]),e._v(" and below")])]),e._v(" "),a("tr",[a("td",[a("code",[e._v("v2")])]),e._v(" "),a("td",[a("code",[e._v("v0.21.0")]),e._v(" and "),a("code",[e._v("v0.21.1")])])]),e._v(" "),a("tr",[a("td",[a("code",[e._v("v3")])]),e._v(" "),a("td",[e._v("From "),a("code",[e._v("v0.22.0")]),e._v(" to "),a("code",[e._v("v0.24.0")]),e._v(" included")])]),e._v(" "),a("tr",[a("td",[a("code",[e._v("v4")])]),e._v(" "),a("td",[e._v("From "),a("code",[e._v("v0.25.0")]),e._v(" to "),a("code",[e._v("v0.27.2")]),e._v(" included")])]),e._v(" "),a("tr",[a("td",[a("code",[e._v("v5")])]),e._v(" "),a("td",[e._v("From "),a("code",[e._v("v0.28.0")]),e._v(" to "),a("code",[e._v("v0.29.1")]),e._v(" included")])]),e._v(" "),a("tr",[a("td",[a("code",[e._v("v6")])]),e._v(" "),a("td",[a("code",[e._v("v0.30.0")]),e._v(" and later")])])])]),e._v(" "),a("p",[e._v("All dumps created before and up to Meilisearch v1.0 can be imported into Meilisearch v1.X.Y.")]),e._v(" "),a("h2",{attrs:{id:"_4-technical-aspects"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-technical-aspects"}},[e._v("#")]),e._v(" 4. Technical Aspects")]),e._v(" "),a("h3",{attrs:{id:"_4-1-dump-creation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-dump-creation"}},[e._v("#")]),e._v(" 4.1. Dump Creation")]),e._v(" "),a("p",[e._v("When a dump is being created, the task queue can receive other future operations to perform.")]),e._v(" "),a("h3",{attrs:{id:"_4-2-importing-a-dump"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-importing-a-dump"}},[e._v("#")]),e._v(" 4.2. Importing a dump")]),e._v(" "),a("p",[e._v("When a dump is being imported, the http API is not available. Meilisearch can't receive read or write requests.")]),e._v(" "),a("h3",{attrs:{id:"_4-3-dump-creation-task-priority"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-3-dump-creation-task-priority"}},[e._v("#")]),e._v(" 4.3. Dump Creation Task Priority")]),e._v(" "),a("p",[e._v("Dump creation tasks have priority over other task types. If a "),a("code",[e._v("dumpCreation")]),e._v(" task is enqueued, it will be directly processed when the current processing task finishes even if other tasks have been enqueued before.")]),e._v(" "),a("h2",{attrs:{id:"_5-future-possibilities"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-future-possibilities"}},[e._v("#")]),e._v(" 5. Future Possibilities")]),e._v(" "),a("ul",[a("li",[e._v("Give information about the import of a dump within the tasks.")])])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[32],{457:function(e,t,a){"use strict";a.r(t);var i=a(62),r=Object(i.a)({},(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[a("h1",{attrs:{id:"dumps-api-and-cli"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#dumps-api-and-cli"}},[e._v("#")]),e._v(" Dumps API and CLI")]),e._v(" "),a("h2",{attrs:{id:"_1-summary"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-summary"}},[e._v("#")]),e._v(" 1. Summary")]),e._v(" "),a("p",[e._v("A dump is a compressed file containing an export of a MeiliSearch instance. It contains all indexes, documents, settings, tasks, and API keys but in a raw unprocessed form. A dump isn't an exact copy of a database—it is closer to a blueprint that allows creating of an identical dataset.")]),e._v(" "),a("h2",{attrs:{id:"_2-motivation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-motivation"}},[e._v("#")]),e._v(" 2. Motivation")]),e._v(" "),a("p",[e._v("The dumps exist to upgrade a MeiliSearch instance from a previous version to a more recent version. It can also be a helpful tool for loading a production state on a staging server to make changes and test them before propagating them to production.")]),e._v(" "),a("h2",{attrs:{id:"_3-functional-specification"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-functional-specification"}},[e._v("#")]),e._v(" 3. Functional Specification")]),e._v(" "),a("h3",{attrs:{id:"_3-1-summary-key-points"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-summary-key-points"}},[e._v("#")]),e._v(" 3.1. Summary Key Points")]),e._v(" "),a("ul",[a("li",[e._v("A dump creation can be scheduled from the MeiliSearch API using the "),a("code",[e._v("POST - /dumps")]),e._v(" endpoint.")]),e._v(" "),a("li",[e._v("A dump creation status can be tracked using the "),a("code",[e._v("GET - /tasks/:task_uid")]),e._v(" endpoint.")]),e._v(" "),a("li",[e._v("MeiliSearch can only create one dump at a time.")]),e._v(" "),a("li",[e._v("By default, dumps are created in a folder named "),a("code",[e._v("dumps")]),e._v(", and can be found in the same directory as the MeiliSearch binary.")]),e._v(" "),a("li",[e._v("The "),a("code",[e._v("dumps")]),e._v(" directory can be customized using the "),a("code",[e._v("--dump-dir")]),e._v(" configuration option. If the dump directory does not already exist when the dump creation process is called, MeiliSearch will create it.")]),e._v(" "),a("li",[e._v("A "),a("code",[e._v(".dump")]),e._v(" file can be imported using the "),a("code",[e._v("--import-dump")]),e._v(" command-line flag.")]),e._v(" "),a("li",[e._v("The MeiliSearch server starts when the dump is fully imported and indexed.")]),e._v(" "),a("li",[e._v("By default, importing a dump when a database already exists (a non-empty data.ms folder in the same directory as the MeiliSearch binary) will stop the process and throw an error.")]),e._v(" "),a("li",[e._v("When using the command-line flag "),a("code",[e._v("--ignore-dump-if-db-exists=true")]),e._v(", MeiliSearch will use the existing database to start an instance instead of throwing an error. The dump will be ignored.")]),e._v(" "),a("li",[e._v("By default, trying to import a dump that does not exist, will stop the process and throw an error.")]),e._v(" "),a("li",[e._v("When using the command-line flag "),a("code",[e._v("--ignore-missing-dump")]),e._v(", MeiliSearch will continue its process and not throw an error.")]),e._v(" "),a("li",[e._v("When a dump is being imported, the http API is not available. Meilisearch can't receive read or write requests.")]),e._v(" "),a("li",[a("code",[e._v("dumpCreation")]),e._v(" task takes priority over enqueued "),a("code",[e._v("tasks")]),e._v(". This means that if a "),a("code",[e._v("dumpCreation")]),e._v(" task is created, it will be directly processed when the current processing task finishes even if other tasks have been enqueued before.")])]),e._v(" "),a("hr"),e._v(" "),a("h3",{attrs:{id:"_3-2-dumps-api-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-dumps-api-definition"}},[e._v("#")]),e._v(" 3.2. Dumps API Definition")]),e._v(" "),a("h4",{attrs:{id:"_3-2-1-post-dumps"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-1-post-dumps"}},[e._v("#")]),e._v(" 3.2.1. POST "),a("code",[e._v("/dumps")])]),e._v(" "),a("p",[e._v("Create a dump")]),e._v(" "),a("h5",{attrs:{id:"_3-2-1-1-body-payload"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-1-1-body-payload"}},[e._v("#")]),e._v(" 3.2.1.1. Body Payload")]),e._v(" "),a("p",[e._v("N/A")]),e._v(" "),a("h5",{attrs:{id:"_3-2-1-2-response-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-1-2-response-definition"}},[e._v("#")]),e._v(" 3.2.1.2. Response Definition")]),e._v(" "),a("p",[e._v("When the request is successful, Meilisearch returns the HTTP code "),a("code",[e._v("202 Accepted")]),e._v(". The response's content is the summarized representation of the received asynchronous task.")]),e._v(" "),a("p",[e._v("See "),a("RouterLink",{attrs:{to:"/specifications/text/0060-tasks-api.html#summarized-task-object-for-202-accepted"}},[e._v("Summarized "),a("code",[e._v("task")]),e._v(" Object for "),a("code",[e._v("202 Accepted")])]),e._v(".")],1),e._v(" "),a("p",[e._v("The uid of the generated dump can be found in the task details.")]),e._v(" "),a("h5",{attrs:{id:"_3-2-1-3-errors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-1-3-errors"}},[e._v("#")]),e._v(" 3.2.1.3. Errors")]),e._v(" "),a("ul",[a("li",[e._v("🔴 If Meilisearch is secured, accessing this route without the "),a("code",[e._v("Authorization")]),e._v(" header returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_authorization_header"}},[e._v("missing_authorization_header")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 If Meilisearch is secured, accessing this route with a key that does not have permissions (i.e. other than the master-key) returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key"}},[e._v("invalid_api_key")]),e._v(" error.")],1)]),e._v(" "),a("hr"),e._v(" "),a("h3",{attrs:{id:"_3-3-cli-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-cli-definition"}},[e._v("#")]),e._v(" 3.3. CLI Definition")]),e._v(" "),a("h4",{attrs:{id:"_3-3-1-dump-dir"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-1-dump-dir"}},[e._v("#")]),e._v(" 3.3.1. "),a("code",[e._v("--dump-dir")])]),e._v(" "),a("p",[e._v("By default, MeiliSearch creates dumps in a directory called "),a("code",[e._v("dumps")]),e._v(" at the root of your MeiliSearch.")]),e._v(" "),a("p",[e._v("The destination can be modified with the "),a("code",[e._v("--dump-dir")]),e._v(" flag. e.g. "),a("code",[e._v("--dump-dir myDumps")])]),e._v(" "),a("h4",{attrs:{id:"_3-3-2-import-dump"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-import-dump"}},[e._v("#")]),e._v(" 3.3.2. "),a("code",[e._v("--import-dump")])]),e._v(" "),a("p",[e._v("Using the CLI flag "),a("code",[e._v("--import-dump")]),e._v(", MeiliSearch will replace the data.ms with the dump data and start the server using the provided dump. e.g. "),a("code",[e._v("--import-dump dumps/20220117-144855452.dump")]),e._v(".")]),e._v(" "),a("p",[e._v("If the "),a("code",[e._v("--import-dump")]),e._v(" flag is specified when a database exists, an error occurs in the CLI.")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('Error: database already exists at ":pathToDataMs/data.ms", try to delete it or rename it\n')])])]),a("h4",{attrs:{id:"_3-3-3-ignore-dump-if-db-exists"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-3-ignore-dump-if-db-exists"}},[e._v("#")]),e._v(" 3.3.3. "),a("code",[e._v("--ignore-dump-if-db-exists")])]),e._v(" "),a("p",[e._v("To avoid MeiliSearch to throw an error when finding that a database already exists, the following flag: "),a("code",[e._v("--ignore-dump-if-db-exists")]),e._v(" can be used. When using this flag, MeiliSearch will use the existing database to start an instance instead of throwing an error. The dump will be ignored.")]),e._v(" "),a("h4",{attrs:{id:"_3-3-4-ignore-missing-dump"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-4-ignore-missing-dump"}},[e._v("#")]),e._v(" 3.3.4. "),a("code",[e._v("--ignore-missing-dump")])]),e._v(" "),a("p",[e._v("To avoid MeiliSearch to throw an error when there is no dump at the given path, the following flag: "),a("code",[e._v("--ignore-missing-dump")]),e._v(" can be used. MeiliSearch will then continue its process and not import any dump.")]),e._v(" "),a("p",[e._v("If the "),a("code",[e._v("--ignore-missing-dump")]),e._v(" flag is not specified and the file cannot be found, an error occurs in the CLI.")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v('Error: dump doesn\'t exist at ":pathToDumps/:missingFile"\n')])])]),a("h4",{attrs:{id:"_3-3-5-other-dump-related-errors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-5-other-dump-related-errors"}},[e._v("#")]),e._v(" 3.3.5 Other dump related errors")]),e._v(" "),a("p",[e._v("When starting a new Meilisearch version, if Meilisearch tries to read an old data.ms and but cannot read it, the following message should appear:")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v("Error: Your database version (`:old_version`) is incompatible with your current engine (`:new_version`). To migrate data between Meilisearch versions, follow our guide on https://docs.meilisearch.com/learn/advanced/updating.html\n")])])]),a("hr"),e._v(" "),a("h3",{attrs:{id:"_3-4-dump-version-support"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-4-dump-version-support"}},[e._v("#")]),e._v(" 3.4. Dump version support")]),e._v(" "),a("p",[e._v("To handle dump and Meilisearch version compatibility, it is necessary to also versionize the dumps feature.")]),e._v(" "),a("p",[e._v("The following table describes which version of the dump correspond to which version of Meilisearch")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("Dump version")]),e._v(" "),a("th",[e._v("Meilisearch version")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[a("code",[e._v("v1")])]),e._v(" "),a("td",[a("code",[e._v("v0.20.0")]),e._v(" and below")])]),e._v(" "),a("tr",[a("td",[a("code",[e._v("v2")])]),e._v(" "),a("td",[a("code",[e._v("v0.21.0")]),e._v(" and "),a("code",[e._v("v0.21.1")])])]),e._v(" "),a("tr",[a("td",[a("code",[e._v("v3")])]),e._v(" "),a("td",[e._v("From "),a("code",[e._v("v0.22.0")]),e._v(" to "),a("code",[e._v("v0.24.0")]),e._v(" included")])]),e._v(" "),a("tr",[a("td",[a("code",[e._v("v4")])]),e._v(" "),a("td",[e._v("From "),a("code",[e._v("v0.25.0")]),e._v(" to "),a("code",[e._v("v0.27.2")]),e._v(" included")])]),e._v(" "),a("tr",[a("td",[a("code",[e._v("v5")])]),e._v(" "),a("td",[e._v("From "),a("code",[e._v("v0.28.0")]),e._v(" to "),a("code",[e._v("v0.29.1")]),e._v(" included")])]),e._v(" "),a("tr",[a("td",[a("code",[e._v("v6")])]),e._v(" "),a("td",[a("code",[e._v("v0.30.0")]),e._v(" and later")])])])]),e._v(" "),a("p",[e._v("All dumps created before and up to Meilisearch v1.0 can be imported into Meilisearch v1.X.Y.")]),e._v(" "),a("h2",{attrs:{id:"_4-technical-aspects"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-technical-aspects"}},[e._v("#")]),e._v(" 4. Technical Aspects")]),e._v(" "),a("h3",{attrs:{id:"_4-1-dump-creation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-dump-creation"}},[e._v("#")]),e._v(" 4.1. Dump Creation")]),e._v(" "),a("p",[e._v("When a dump is being created, the task queue can receive other future operations to perform.")]),e._v(" "),a("h3",{attrs:{id:"_4-2-importing-a-dump"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-importing-a-dump"}},[e._v("#")]),e._v(" 4.2. Importing a dump")]),e._v(" "),a("p",[e._v("When a dump is being imported, the http API is not available. Meilisearch can't receive read or write requests.")]),e._v(" "),a("h3",{attrs:{id:"_4-3-dump-creation-task-priority"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-3-dump-creation-task-priority"}},[e._v("#")]),e._v(" 4.3. Dump Creation Task Priority")]),e._v(" "),a("p",[e._v("Dump creation tasks have priority over other task types. If a "),a("code",[e._v("dumpCreation")]),e._v(" task is enqueued, it will be directly processed when the current processing task finishes even if other tasks have been enqueued before.")]),e._v(" "),a("h2",{attrs:{id:"_5-future-possibilities"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-future-possibilities"}},[e._v("#")]),e._v(" 5. Future Possibilities")]),e._v(" "),a("ul",[a("li",[e._v("Give information about the import of a dump within the tasks.")])])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file diff --git a/docs/assets/js/33.91d80bc8.js b/docs/assets/js/33.63b5ee32.js similarity index 99% rename from docs/assets/js/33.91d80bc8.js rename to docs/assets/js/33.63b5ee32.js index d75a6617a..3314d88f6 100644 --- a/docs/assets/js/33.91d80bc8.js +++ b/docs/assets/js/33.63b5ee32.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[33],{457:function(e,t,a){"use strict";a.r(t);var s=a(62),r=Object(s.a)({},(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[a("h1",{attrs:{id:"typo-tolerance-settings-api"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#typo-tolerance-settings-api"}},[e._v("#")]),e._v(" Typo Tolerance Settings API")]),e._v(" "),a("h2",{attrs:{id:"_1-summary"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-summary"}},[e._v("#")]),e._v(" 1. Summary")]),e._v(" "),a("p",[e._v("This specification describes the customizable options for the typo tolerance settings.")]),e._v(" "),a("h2",{attrs:{id:"_2-motivation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-motivation"}},[e._v("#")]),e._v(" 2. Motivation")]),e._v(" "),a("p",[e._v("Tolerance to typos is critical when building an enjoyable search experience. Meilisearch ranks typo-free matched documents above others based on the default settings that we believe are best for most users.")]),e._v(" "),a("p",[e._v("Meilisearch can adapt to different use-cases by providing customization options for the typo tolerance feature.")]),e._v(" "),a("h2",{attrs:{id:"_3-functional-specification"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-functional-specification"}},[e._v("#")]),e._v(" 3. Functional Specification")]),e._v(" "),a("h3",{attrs:{id:"_3-1-typotolerance-api-resource-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-typotolerance-api-resource-definition"}},[e._v("#")]),e._v(" 3.1. "),a("code",[e._v("typoTolerance")]),e._v(" API resource definition")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("Field")]),e._v(" "),a("th",[e._v("Type")]),e._v(" "),a("th",[e._v("Required")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[a("a",{attrs:{href:"#311-enabled"}},[e._v("enabled")])]),e._v(" "),a("td",[e._v("Boolean")]),e._v(" "),a("td",[e._v("False")])]),e._v(" "),a("tr",[a("td",[a("a",{attrs:{href:"#312-disableOnattributes"}},[e._v("disableOnAttributes")])]),e._v(" "),a("td",[e._v("Array of String")]),e._v(" "),a("td",[e._v("False")])]),e._v(" "),a("tr",[a("td",[a("a",{attrs:{href:"#313-disableOnwords"}},[e._v("disableOnWords")])]),e._v(" "),a("td",[e._v("Array of String")]),e._v(" "),a("td",[e._v("False")])]),e._v(" "),a("tr",[a("td",[a("a",{attrs:{href:"#314-minwordsizefortypos"}},[e._v("minWordSizeForTypos")])]),e._v(" "),a("td",[e._v("Object")]),e._v(" "),a("td",[e._v("False")])])])]),e._v(" "),a("h4",{attrs:{id:"_3-1-1-enabled"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-1-enabled"}},[e._v("#")]),e._v(" 3.1.1. "),a("code",[e._v("enabled")])]),e._v(" "),a("ul",[a("li",[e._v("Type: Boolean")]),e._v(" "),a("li",[e._v("Required: False")]),e._v(" "),a("li",[e._v("Default: "),a("code",[e._v("true")])])]),e._v(" "),a("p",[e._v("Whether the typo tolerance feature is enabled.")]),e._v(" "),a("h5",{attrs:{id:"_3-1-1-1-impacts-on-the-typo-ranking-rule"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-1-1-impacts-on-the-typo-ranking-rule"}},[e._v("#")]),e._v(" 3.1.1.1. Impacts on the "),a("code",[e._v("typo")]),e._v(" ranking rule")]),e._v(" "),a("p",[e._v("The presence of "),a("code",[e._v("typo")]),e._v(" in the ranking rules setting does not influence the activation/deactivation of the typo tolerance feature.")]),e._v(" "),a("p",[e._v("If the "),a("code",[e._v("rankingRules")]),e._v(" parameter of the index settings does not contain the "),a("code",[e._v("typo")]),e._v(" rule, the results are not sorted according to the number of typos found.")]),e._v(" "),a("p",[e._v("The typo tolerance feature is still used to match documents.")]),e._v(" "),a("h3",{attrs:{id:"_3-1-2-disableonattributes"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-2-disableonattributes"}},[e._v("#")]),e._v(" 3.1.2. "),a("code",[e._v("disableOnAttributes")])]),e._v(" "),a("ul",[a("li",[e._v("Type: Array of String")]),e._v(" "),a("li",[e._v("Required: False")]),e._v(" "),a("li",[e._v("Default: "),a("code",[e._v("[]")])])]),e._v(" "),a("p",[a("code",[e._v("disableOnAttributes")]),e._v(" disable the typo tolerance feature on the specified attributes list.")]),e._v(" "),a("p",[e._v("Any attributes defined in "),a("code",[e._v("disableOnAttributes")]),e._v(" won't have their values matched by the typo tolerance.")]),e._v(" "),a("h4",{attrs:{id:"_3-1-2-1-example"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-2-1-example"}},[e._v("#")]),e._v(" 3.1.2.1. Example")]),e._v(" "),a("p",[e._v("Given "),a("code",[e._v('["title"]')]),e._v(" as "),a("code",[e._v("disableOnAttributes")]),e._v(" and the following document")]),e._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"id"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"title"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"Hey World"')]),e._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),a("p",[e._v("The engine won't try to match query term with typos with values of the "),a("code",[e._v("title")]),e._v(" attribute at search time to match documents.")]),e._v(" "),a("ul",[a("li",[e._v("Typing "),a("code",[e._v("Warld")]),e._v(" won't bring the document as a candidate for the search results.")])]),e._v(" "),a("h3",{attrs:{id:"_3-1-3-disableonwords"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-3-disableonwords"}},[e._v("#")]),e._v(" 3.1.3. "),a("code",[e._v("disableOnWords")])]),e._v(" "),a("ul",[a("li",[e._v("Type: Array of String")]),e._v(" "),a("li",[e._v("Required: False")]),e._v(" "),a("li",[e._v("Default: "),a("code",[e._v("[]")])])]),e._v(" "),a("p",[a("code",[e._v("disableOnWords")]),e._v(" disable the typo tolerance feature on a list of search query terms.")]),e._v(" "),a("blockquote",[a("p",[e._v("This field is case insensitive since the document attributes values are lowercased and de-unicoded internally.")])]),e._v(" "),a("h4",{attrs:{id:"_3-1-3-1-example"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-3-1-example"}},[e._v("#")]),e._v(" 3.1.3.1. Example")]),e._v(" "),a("p",[e._v("If "),a("code",[e._v("Javascript")]),e._v(" is specified in "),a("code",[e._v("disableOnWords")]),e._v(", the engine won't apply the typo tolerance on the query term "),a("code",[e._v("Javascript")]),e._v(" or "),a("code",[e._v("javascript")]),e._v(" if typed at search time to match documents.")]),e._v(" "),a("h3",{attrs:{id:"_3-1-4-minwordsizefortypos"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-4-minwordsizefortypos"}},[e._v("#")]),e._v(" 3.1.4. "),a("code",[e._v("minWordSizeForTypos")])]),e._v(" "),a("ul",[a("li",[e._v("Type: Object")]),e._v(" "),a("li",[e._v("Required: False")])]),e._v(" "),a("h4",{attrs:{id:"_3-1-4-1-minwordsizefortypos-object-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-4-1-minwordsizefortypos-object-definition"}},[e._v("#")]),e._v(" 3.1.4.1. "),a("code",[e._v("minWordSizeForTypos")]),e._v(" Object Definition")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("Field")]),e._v(" "),a("th",[e._v("Type")]),e._v(" "),a("th",[e._v("Required")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[a("a",{attrs:{href:"#3142-onetypo"}},[e._v("oneTypo")])]),e._v(" "),a("td",[e._v("Integer")]),e._v(" "),a("td",[e._v("False")])]),e._v(" "),a("tr",[a("td",[a("a",{attrs:{href:"#3143-twotypos"}},[e._v("twoTypos")])]),e._v(" "),a("td",[e._v("Integer")]),e._v(" "),a("td",[e._v("False")])])])]),e._v(" "),a("h4",{attrs:{id:"_3-1-4-2-onetypo"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-4-2-onetypo"}},[e._v("#")]),e._v(" 3.1.4.2. "),a("code",[e._v("oneTypo")])]),e._v(" "),a("ul",[a("li",[e._v("Type: Integer")]),e._v(" "),a("li",[e._v("Required: False")]),e._v(" "),a("li",[e._v("Default: "),a("code",[e._v("5")])])]),e._v(" "),a("p",[a("code",[e._v("oneTypo")]),e._v(" customize the minimum size for a word to tolerate 1 typo.")]),e._v(" "),a("blockquote",[a("p",[e._v("Given the default value "),a("code",[e._v("5")]),e._v(", the search engine starts to apply typo tolerance on a query term if its length is at least equal to 5 characters.")])]),e._v(" "),a("blockquote",[a("p",[e._v("See "),a("a",{attrs:{href:"#21-typos-calculation"}},[e._v("2.1. Typos calculation section")])])]),e._v(" "),a("h5",{attrs:{id:"_3-1-4-2-1-example"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-4-2-1-example"}},[e._v("#")]),e._v(" 3.1.4.2.1 Example")]),e._v(" "),a("p",[e._v("Given "),a("code",[e._v("5")]),e._v(" as "),a("code",[e._v("oneTypo")]),e._v(" and the following document")]),e._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"id"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"title"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"Hey World"')]),e._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),a("ul",[a("li",[e._v("Typing "),a("code",[e._v("World")]),e._v(" with 1 typo, e.g. "),a("code",[e._v("Warld")]),e._v(" will match "),a("code",[e._v("World")]),e._v(". It accepts 1 typo since "),a("code",[e._v("World")]),e._v(" size is made of "),a("code",[e._v("5")]),e._v(" chars.")]),e._v(" "),a("li",[e._v("Typing "),a("code",[e._v("Hey")]),e._v(" with 1 typo, e.g. "),a("code",[e._v("Hoy")]),e._v(" won't match "),a("code",[e._v("Hey")]),e._v(". It accepts 0 typo since "),a("code",[e._v("Hey")]),e._v(" size is made of "),a("code",[e._v("3")]),e._v(" chars.")])]),e._v(" "),a("h4",{attrs:{id:"_3-1-4-3-twotypos"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-4-3-twotypos"}},[e._v("#")]),e._v(" 3.1.4.3. "),a("code",[e._v("twoTypos")])]),e._v(" "),a("ul",[a("li",[e._v("Type: Integer")]),e._v(" "),a("li",[e._v("Required: False")]),e._v(" "),a("li",[e._v("Default: "),a("code",[e._v("9")])])]),e._v(" "),a("p",[a("code",[e._v("twoTypos")]),e._v(" customize the minimum size for a word to tolerate 2 typos.")]),e._v(" "),a("blockquote",[a("p",[e._v("Given the default value "),a("code",[e._v("9")]),e._v(", the search engine handles up to 2 typos on a query term if its length is at least equal to 9 characters.")])]),e._v(" "),a("blockquote",[a("p",[e._v("See "),a("a",{attrs:{href:"#21-typos-calculation"}},[e._v("2.1. Typos calculation section")])])]),e._v(" "),a("h5",{attrs:{id:"_3-1-4-3-1-example"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-4-3-1-example"}},[e._v("#")]),e._v(" 3.1.4.3.1. Example")]),e._v(" "),a("p",[e._v("Given "),a("code",[e._v("3")]),e._v(" for "),a("code",[e._v("oneTypo")]),e._v(" and "),a("code",[e._v("5")]),e._v(" as "),a("code",[e._v("twoTypos")]),e._v(" and the following document")]),e._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"id"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"title"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"Hey World"')]),e._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),a("ul",[a("li",[e._v("Typing "),a("code",[e._v("World")]),e._v(" with 2 typos, e.g. "),a("code",[e._v("Warrld")]),e._v(" will match "),a("code",[e._v("World")]),e._v(". It accepts up to 2 typos since "),a("code",[e._v("World")]),e._v(" size is made of "),a("code",[e._v("5")]),e._v(" chars.")]),e._v(" "),a("li",[e._v("Typing "),a("code",[e._v("Hey")]),e._v(" with 1 typo, e.g. "),a("code",[e._v("Hoy")]),e._v(" will match "),a("code",[e._v("Hey")]),e._v(". It accepts only 1 typo since "),a("code",[e._v("Hey")]),e._v(" size is made of "),a("code",[e._v("3")]),e._v(" chars.")])]),e._v(" "),a("h2",{attrs:{id:"_3-2-api-endpoints-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-api-endpoints-definition"}},[e._v("#")]),e._v(" 3.2. API Endpoints Definition")]),e._v(" "),a("h3",{attrs:{id:"_3-2-1-global-settings-api-endpoints-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-1-global-settings-api-endpoints-definition"}},[e._v("#")]),e._v(" 3.2.1. Global Settings API Endpoints Definition")]),e._v(" "),a("p",[a("code",[e._v("typoTolerance")]),e._v(" is a sub-resource of "),a("code",[e._v("/indexes/:index_uid/settings")]),e._v(".")]),e._v(" "),a("p",[e._v("See "),a("RouterLink",{attrs:{to:"/specifications/text/0123-settings-api.html"}},[e._v("Settings API")]),e._v(".")],1),e._v(" "),a("h3",{attrs:{id:"_3-2-2-indexes-index-uid-settings-typo-tolerance"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-2-indexes-index-uid-settings-typo-tolerance"}},[e._v("#")]),e._v(" 3.2.2. "),a("code",[e._v("indexes/:index_uid/settings/typo-tolerance")])]),e._v(" "),a("p",[e._v("Manage the typo tolerance configuration for an index.")]),e._v(" "),a("h4",{attrs:{id:"_3-2-2-1-get-indexes-index-uid-settings-typo-tolerance"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-2-1-get-indexes-index-uid-settings-typo-tolerance"}},[e._v("#")]),e._v(" 3.2.2.1. "),a("code",[e._v("GET")]),e._v(" - "),a("code",[e._v("indexes/:index_uid/settings/typo-tolerance")])]),e._v(" "),a("p",[e._v("Allow fetching the current definition of the typo tolerance feature for an index.")]),e._v(" "),a("p",[a("code",[e._v("200")]),e._v(" - Response body")]),e._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"enabled"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[e._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"disableOnAttributes"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"disableOnWords"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"minWordSizeForTypos"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"oneTypo"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"twoTypos"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("9")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),a("p",[e._v("All properties must be returned when the resource is retrieved.")]),e._v(" "),a("h5",{attrs:{id:"_3-2-2-1-2-errors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-2-1-2-errors"}},[e._v("#")]),e._v(" 3.2.2.1.2. Errors")]),e._v(" "),a("ul",[a("li",[e._v("🔴 Sending an invalid index uid format for the "),a("code",[e._v(":index_uid")]),e._v(" path parameter returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_uid"}},[e._v("invalid_index_uid")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 If the index does not exist, the API returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_not_found"}},[e._v("index_not_found")]),e._v(" error.")],1)]),e._v(" "),a("h4",{attrs:{id:"_3-2-2-2-patch-indexes-index-uid-settings-typo-tolerance"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-2-2-patch-indexes-index-uid-settings-typo-tolerance"}},[e._v("#")]),e._v(" 3.2.2.2. "),a("code",[e._v("PATCH")]),e._v(" - "),a("code",[e._v("indexes/:index_uid/settings/typo-tolerance")])]),e._v(" "),a("p",[e._v("Allow customizing partially the settings of the typo tolerance feature for an index.")]),e._v(" "),a("p",[e._v("Request payload")]),e._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"disableOnAttributes"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"title"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"description"')]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"minWordSizeForTypos"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("4")]),e._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),a("p",[a("code",[e._v("202 Accepted")]),e._v(" - Example Response")]),e._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"uid"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("42")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"indexUid"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"books"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"enqueued"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"settingsUpdate"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"enqueuedAt"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"2022-03-01T18:39:29.228155Z"')]),e._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),a("h5",{attrs:{id:"_3-2-2-2-1-response-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-2-2-1-response-definition"}},[e._v("#")]),e._v(" 3.2.2.2.1. Response Definition")]),e._v(" "),a("p",[e._v("When the request is successful, Meilisearch returns the HTTP code "),a("code",[e._v("202 Accepted")]),e._v(". The response's content is the summarized representation of the received asynchronous task.")]),e._v(" "),a("p",[e._v("See "),a("RouterLink",{attrs:{to:"/specifications/text/0060-tasks-api.html#summarized-task-object-for-202-accepted"}},[e._v("Summarized "),a("code",[e._v("task")]),e._v(" Object for "),a("code",[e._v("202 Accepted")])]),e._v(".")],1),e._v(" "),a("h5",{attrs:{id:"_3-2-2-2-2-errors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-2-2-2-errors"}},[e._v("#")]),e._v(" 3.2.2.2.2. Errors")]),e._v(" "),a("ul",[a("li",[e._v("🔴 Omitting Content-Type header returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_content_type"}},[e._v("missing_content_type")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending an empty Content-Type returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_content_type"}},[e._v("invalid_content_type")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending a different Content-Type than "),a("code",[e._v("application/json")]),e._v(" returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_content_type"}},[e._v("invalid_content_type")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending an empty payload returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_payload"}},[e._v("missing_payload")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending an invalid JSON payload returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#malformed_payload"}},[e._v("malformed_payload")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending an invalid index uid format for the "),a("code",[e._v(":index_uid")]),e._v(" path parameter returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_uid"}},[e._v("invalid_index_uid")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending a value different from "),a("code",[e._v("null")]),e._v(" or with a different type than "),a("code",[e._v("Boolean")]),e._v(" for the "),a("code",[e._v("enabled")]),e._v(" field returns an\n"),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_settings_typo_tolerance"}},[e._v("invalid_settings_typo_tolerance")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending a value different from "),a("code",[e._v("null")]),e._v(" or with a different type than "),a("code",[e._v("Array of String")]),e._v(" for the "),a("code",[e._v("disableOnAttributes")]),e._v("\nfield returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_settings_typo_tolerance"}},[e._v("invalid_settings_typo_tolerance")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending a value different from "),a("code",[e._v("null")]),e._v(" or with a different type than "),a("code",[e._v("Array of String")]),e._v(" for the "),a("code",[e._v("disableOnWords")]),e._v(" field\nreturns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_settings_typo_tolerance"}},[e._v("invalid_settings_typo_tolerance")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending a value different from "),a("code",[e._v("null")]),e._v(" or with a different type than "),a("code",[e._v("Integer")]),e._v(" for "),a("code",[e._v("minWordSizeForTypos")]),e._v(" object fields\nreturns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_settings_typo_tolerance"}},[e._v("invalid_settings_typo_tolerance")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending invalid values for "),a("code",[e._v("oneTypo")]),e._v(" AND "),a("code",[e._v("twoTypos")]),e._v(" being specified for the "),a("code",[e._v("minWordSizeForTypos")]),e._v(" object fields returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_settings_typo_tolerance"}},[e._v("invalid_settings_typo_tolerance")]),e._v(" error.")],1)]),e._v(" "),a("h6",{attrs:{id:"_3-2-2-2-2-1-async-errors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-2-2-2-1-async-errors"}},[e._v("#")]),e._v(" 3.2.2.2.2.1. Async Errors")]),e._v(" "),a("ul",[a("li",[e._v("🔴 When Meilisearch is secured, if the API Key do not have the "),a("code",[e._v("indexes.create")]),e._v(" action defined, the API returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_not_found"}},[e._v("index_not_found")]),e._v(" error in the related asynchronous "),a("code",[e._v("task")]),e._v(" resource. See "),a("a",{attrs:{href:"#32221-response-definition"}},[e._v("3.2.2.2.1. Response Definition")]),e._v(".")],1)]),e._v(" "),a("blockquote",[a("p",[e._v("Otherwise, Meilisearch will create the index in a lazy way. See "),a("a",{attrs:{href:"#32223-lazy-index-creation"}},[e._v("3.2.2.2.3. Lazy Index Creation")]),e._v(".")])]),e._v(" "),a("ul",[a("li",[e._v("🔴 When sending invalid values with either "),a("code",[e._v("oneTypo")]),e._v(" OR "),a("code",[e._v("twoTypos")]),e._v(" being specified for the "),a("code",[e._v("minWordSizeForTypos")]),e._v(" object fields returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_settings_typo_tolerance"}},[e._v("invalid_settings_typo_tolerance")]),e._v(" error.")],1)]),e._v(" "),a("h5",{attrs:{id:"_3-2-2-2-3-lazy-index-creation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-2-2-3-lazy-index-creation"}},[e._v("#")]),e._v(" 3.2.2.2.3. Lazy Index Creation")]),e._v(" "),a("p",[e._v("If the requested "),a("code",[e._v("index_uid")]),e._v(" does not exist, and the authorization layer allows it (See "),a("a",{attrs:{href:"#322221-async-errors"}},[e._v("3.2.2.2.2.1. Async Errors")]),e._v("), Meilisearch will create the index when the related asynchronous task resource is executed. See "),a("a",{attrs:{href:"#32221-response-definition"}},[e._v("3.2.2.2.1. Response Definition")]),e._v(".")]),e._v(" "),a("h4",{attrs:{id:"_3-2-2-3-delete-indexes-index-uid-settings-typo-tolerance"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-2-3-delete-indexes-index-uid-settings-typo-tolerance"}},[e._v("#")]),e._v(" 3.2.2.3. "),a("code",[e._v("DELETE")]),e._v("- "),a("code",[e._v("indexes/:index_uid/settings/typo-tolerance")])]),e._v(" "),a("p",[e._v("Allow resetting the typo tolerance feature to the default for an index.")]),e._v(" "),a("h5",{attrs:{id:"_3-2-2-3-1-response-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-2-3-1-response-definition"}},[e._v("#")]),e._v(" 3.2.2.3.1. Response Definition")]),e._v(" "),a("p",[e._v("When the request is in a successful state, Meilisearch returns the HTTP code "),a("code",[e._v("202 Accepted")]),e._v(". The response's content is the summarized representation of the received asynchronous task.")]),e._v(" "),a("p",[e._v("See "),a("RouterLink",{attrs:{to:"/specifications/text/0060-tasks-api.html#summarized-task-object-for-202-accepted"}},[e._v("Summarized "),a("code",[e._v("task")]),e._v(" Object for "),a("code",[e._v("202 Accepted")])]),e._v(".")],1),e._v(" "),a("h5",{attrs:{id:"_3-2-2-3-2-errors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-2-3-2-errors"}},[e._v("#")]),e._v(" 3.2.2.3.2. Errors")]),e._v(" "),a("ul",[a("li",[e._v("🔴 Sending an invalid index uid format for the "),a("code",[e._v(":index_uid")]),e._v(" path parameter returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_uid"}},[e._v("invalid_index_uid")]),e._v(" error.")],1)]),e._v(" "),a("h6",{attrs:{id:"_3-2-2-3-2-1-asynchronous-index-not-found-error"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-2-3-2-1-asynchronous-index-not-found-error"}},[e._v("#")]),e._v(" 3.2.2.3.2.1. Asynchronous Index Not Found Error")]),e._v(" "),a("ul",[a("li",[e._v("🔴 If the requested "),a("code",[e._v("index_uid")]),e._v(" does not exist, the API returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_not_found"}},[e._v("index_not_found")]),e._v(" error in the related async "),a("code",[e._v("task")]),e._v(" resource. See "),a("a",{attrs:{href:"#32231-response-definition"}},[e._v("3.2.2.3.1. Response Definition")]),e._v(".")],1)]),e._v(" "),a("h3",{attrs:{id:"_3-2-3-general-errors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-3-general-errors"}},[e._v("#")]),e._v(" 3.2.3. General Errors")]),e._v(" "),a("p",[e._v("These errors apply to all endpoints described here.")]),e._v(" "),a("h4",{attrs:{id:"_3-2-3-1-auth-errors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-3-1-auth-errors"}},[e._v("#")]),e._v(" 3.2.3.1. Auth Errors")]),e._v(" "),a("p",[e._v("The auth layer can return the following errors if Meilisearch is secured (a master-key is defined).")]),e._v(" "),a("ul",[a("li",[e._v("🔴 Accessing this route without the "),a("code",[e._v("Authorization")]),e._v(" header returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_authorization_header"}},[e._v("missing_authorization_header")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Accessing this route with a key that does not have permissions (i.e. other than the master-key) returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key"}},[e._v("invalid_api_key")]),e._v(" error.")],1)]),e._v(" "),a("h2",{attrs:{id:"_2-technical-details"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-technical-details"}},[e._v("#")]),e._v(" 2. Technical Details")]),e._v(" "),a("h3",{attrs:{id:"_2-1-typos-calculation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-1-typos-calculation"}},[e._v("#")]),e._v(" 2.1. Typos Calculation")]),e._v(" "),a("p",[e._v("The size of a query term triggers the typo tolerance feature.")]),e._v(" "),a("p",[e._v("By default, a query term made of "),a("code",[e._v("5")]),e._v(" characters can tolerate "),a("code",[e._v("1")]),e._v(" typo, while a query term made of "),a("code",[e._v("9")]),e._v(" characters can tolerate "),a("code",[e._v("2")]),e._v(" typos.")]),e._v(" "),a("p",[e._v("If a query term can be derived from a distance of one or two typos to be found in a document, it will be selected as a candidate. The number of typos found has an impact on the relevancy.")]),e._v(" "),a("h4",{attrs:{id:"_2-1-1-typo-on-the-first-character"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-1-1-typo-on-the-first-character"}},[e._v("#")]),e._v(" 2.1.1 Typo On The First Character")]),e._v(" "),a("p",[e._v("A query term having the first character considered as a typo will not count as "),a("code",[e._v("1")]),e._v(" typo but as "),a("code",[e._v("2")]),e._v(" typos.")]),e._v(" "),a("p",[e._v("It permits to drastically reduce the search space in this case, thus speed-up the search response.")]),e._v(" "),a("h4",{attrs:{id:"_2-1-2-clamping-typo-on-concatened-query-terms"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-1-2-clamping-typo-on-concatened-query-terms"}},[e._v("#")]),e._v(" 2.1.2. Clamping Typo On Concatened Query Terms")]),e._v(" "),a("p",[e._v("The concatenation of two query terms is equal to 1 typo.")]),e._v(" "),a("p",[e._v("e.g. If "),a("code",[e._v("Le tableau")]),e._v(" is typed, the concatened string "),a("code",[e._v("Letableau")]),e._v(" made of "),a("code",[e._v("9")]),e._v(" letters can only have "),a("code",[e._v("1")]),e._v(" typo instead of "),a("code",[e._v("2")]),e._v(" since "),a("code",[e._v("1")]),e._v(" typo is already counted by the concatenation.")]),e._v(" "),a("h3",{attrs:{id:"_2-2-typo-ranking-rule"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-typo-ranking-rule"}},[e._v("#")]),e._v(" 2.2. Typo Ranking Rule")]),e._v(" "),a("p",[e._v("The "),a("code",[e._v("typo")]),e._v(" ranking rule favors candidates with the least typos. That is, if a document is found with two typos, it will be ranked as less important than a document found with 1 typo. 0 typo is the most favorable case.")]),e._v(" "),a("h2",{attrs:{id:"_3-future-possibilities"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-future-possibilities"}},[e._v("#")]),e._v(" 3. Future Possibilities")]),e._v(" "),a("ul",[a("li",[e._v("Expose "),a("code",[e._v("typoTolerance")]),e._v(" resource as a search parameter to override index settings.")]),e._v(" "),a("li",[e._v("Add the possibility to disable the typo tolerance feature on all numeric fields.")]),e._v(" "),a("li",[e._v("Add different modes of result matching for the typo feature. e.g. "),a("code",[e._v("default")]),e._v("/"),a("code",[e._v("min")]),e._v("/"),a("code",[e._v("strict")])]),e._v(" "),a("li",[e._v("Introduce synchronous "),a("code",[e._v("invalid_settings_typo_tolerance_{fieldName}")]),e._v(" error code granularity.")])])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[33],{456:function(e,t,a){"use strict";a.r(t);var s=a(62),r=Object(s.a)({},(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[a("h1",{attrs:{id:"typo-tolerance-settings-api"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#typo-tolerance-settings-api"}},[e._v("#")]),e._v(" Typo Tolerance Settings API")]),e._v(" "),a("h2",{attrs:{id:"_1-summary"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-summary"}},[e._v("#")]),e._v(" 1. Summary")]),e._v(" "),a("p",[e._v("This specification describes the customizable options for the typo tolerance settings.")]),e._v(" "),a("h2",{attrs:{id:"_2-motivation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-motivation"}},[e._v("#")]),e._v(" 2. Motivation")]),e._v(" "),a("p",[e._v("Tolerance to typos is critical when building an enjoyable search experience. Meilisearch ranks typo-free matched documents above others based on the default settings that we believe are best for most users.")]),e._v(" "),a("p",[e._v("Meilisearch can adapt to different use-cases by providing customization options for the typo tolerance feature.")]),e._v(" "),a("h2",{attrs:{id:"_3-functional-specification"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-functional-specification"}},[e._v("#")]),e._v(" 3. Functional Specification")]),e._v(" "),a("h3",{attrs:{id:"_3-1-typotolerance-api-resource-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-typotolerance-api-resource-definition"}},[e._v("#")]),e._v(" 3.1. "),a("code",[e._v("typoTolerance")]),e._v(" API resource definition")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("Field")]),e._v(" "),a("th",[e._v("Type")]),e._v(" "),a("th",[e._v("Required")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[a("a",{attrs:{href:"#311-enabled"}},[e._v("enabled")])]),e._v(" "),a("td",[e._v("Boolean")]),e._v(" "),a("td",[e._v("False")])]),e._v(" "),a("tr",[a("td",[a("a",{attrs:{href:"#312-disableOnattributes"}},[e._v("disableOnAttributes")])]),e._v(" "),a("td",[e._v("Array of String")]),e._v(" "),a("td",[e._v("False")])]),e._v(" "),a("tr",[a("td",[a("a",{attrs:{href:"#313-disableOnwords"}},[e._v("disableOnWords")])]),e._v(" "),a("td",[e._v("Array of String")]),e._v(" "),a("td",[e._v("False")])]),e._v(" "),a("tr",[a("td",[a("a",{attrs:{href:"#314-minwordsizefortypos"}},[e._v("minWordSizeForTypos")])]),e._v(" "),a("td",[e._v("Object")]),e._v(" "),a("td",[e._v("False")])])])]),e._v(" "),a("h4",{attrs:{id:"_3-1-1-enabled"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-1-enabled"}},[e._v("#")]),e._v(" 3.1.1. "),a("code",[e._v("enabled")])]),e._v(" "),a("ul",[a("li",[e._v("Type: Boolean")]),e._v(" "),a("li",[e._v("Required: False")]),e._v(" "),a("li",[e._v("Default: "),a("code",[e._v("true")])])]),e._v(" "),a("p",[e._v("Whether the typo tolerance feature is enabled.")]),e._v(" "),a("h5",{attrs:{id:"_3-1-1-1-impacts-on-the-typo-ranking-rule"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-1-1-impacts-on-the-typo-ranking-rule"}},[e._v("#")]),e._v(" 3.1.1.1. Impacts on the "),a("code",[e._v("typo")]),e._v(" ranking rule")]),e._v(" "),a("p",[e._v("The presence of "),a("code",[e._v("typo")]),e._v(" in the ranking rules setting does not influence the activation/deactivation of the typo tolerance feature.")]),e._v(" "),a("p",[e._v("If the "),a("code",[e._v("rankingRules")]),e._v(" parameter of the index settings does not contain the "),a("code",[e._v("typo")]),e._v(" rule, the results are not sorted according to the number of typos found.")]),e._v(" "),a("p",[e._v("The typo tolerance feature is still used to match documents.")]),e._v(" "),a("h3",{attrs:{id:"_3-1-2-disableonattributes"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-2-disableonattributes"}},[e._v("#")]),e._v(" 3.1.2. "),a("code",[e._v("disableOnAttributes")])]),e._v(" "),a("ul",[a("li",[e._v("Type: Array of String")]),e._v(" "),a("li",[e._v("Required: False")]),e._v(" "),a("li",[e._v("Default: "),a("code",[e._v("[]")])])]),e._v(" "),a("p",[a("code",[e._v("disableOnAttributes")]),e._v(" disable the typo tolerance feature on the specified attributes list.")]),e._v(" "),a("p",[e._v("Any attributes defined in "),a("code",[e._v("disableOnAttributes")]),e._v(" won't have their values matched by the typo tolerance.")]),e._v(" "),a("h4",{attrs:{id:"_3-1-2-1-example"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-2-1-example"}},[e._v("#")]),e._v(" 3.1.2.1. Example")]),e._v(" "),a("p",[e._v("Given "),a("code",[e._v('["title"]')]),e._v(" as "),a("code",[e._v("disableOnAttributes")]),e._v(" and the following document")]),e._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"id"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"title"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"Hey World"')]),e._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),a("p",[e._v("The engine won't try to match query term with typos with values of the "),a("code",[e._v("title")]),e._v(" attribute at search time to match documents.")]),e._v(" "),a("ul",[a("li",[e._v("Typing "),a("code",[e._v("Warld")]),e._v(" won't bring the document as a candidate for the search results.")])]),e._v(" "),a("h3",{attrs:{id:"_3-1-3-disableonwords"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-3-disableonwords"}},[e._v("#")]),e._v(" 3.1.3. "),a("code",[e._v("disableOnWords")])]),e._v(" "),a("ul",[a("li",[e._v("Type: Array of String")]),e._v(" "),a("li",[e._v("Required: False")]),e._v(" "),a("li",[e._v("Default: "),a("code",[e._v("[]")])])]),e._v(" "),a("p",[a("code",[e._v("disableOnWords")]),e._v(" disable the typo tolerance feature on a list of search query terms.")]),e._v(" "),a("blockquote",[a("p",[e._v("This field is case insensitive since the document attributes values are lowercased and de-unicoded internally.")])]),e._v(" "),a("h4",{attrs:{id:"_3-1-3-1-example"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-3-1-example"}},[e._v("#")]),e._v(" 3.1.3.1. Example")]),e._v(" "),a("p",[e._v("If "),a("code",[e._v("Javascript")]),e._v(" is specified in "),a("code",[e._v("disableOnWords")]),e._v(", the engine won't apply the typo tolerance on the query term "),a("code",[e._v("Javascript")]),e._v(" or "),a("code",[e._v("javascript")]),e._v(" if typed at search time to match documents.")]),e._v(" "),a("h3",{attrs:{id:"_3-1-4-minwordsizefortypos"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-4-minwordsizefortypos"}},[e._v("#")]),e._v(" 3.1.4. "),a("code",[e._v("minWordSizeForTypos")])]),e._v(" "),a("ul",[a("li",[e._v("Type: Object")]),e._v(" "),a("li",[e._v("Required: False")])]),e._v(" "),a("h4",{attrs:{id:"_3-1-4-1-minwordsizefortypos-object-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-4-1-minwordsizefortypos-object-definition"}},[e._v("#")]),e._v(" 3.1.4.1. "),a("code",[e._v("minWordSizeForTypos")]),e._v(" Object Definition")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("Field")]),e._v(" "),a("th",[e._v("Type")]),e._v(" "),a("th",[e._v("Required")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[a("a",{attrs:{href:"#3142-onetypo"}},[e._v("oneTypo")])]),e._v(" "),a("td",[e._v("Integer")]),e._v(" "),a("td",[e._v("False")])]),e._v(" "),a("tr",[a("td",[a("a",{attrs:{href:"#3143-twotypos"}},[e._v("twoTypos")])]),e._v(" "),a("td",[e._v("Integer")]),e._v(" "),a("td",[e._v("False")])])])]),e._v(" "),a("h4",{attrs:{id:"_3-1-4-2-onetypo"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-4-2-onetypo"}},[e._v("#")]),e._v(" 3.1.4.2. "),a("code",[e._v("oneTypo")])]),e._v(" "),a("ul",[a("li",[e._v("Type: Integer")]),e._v(" "),a("li",[e._v("Required: False")]),e._v(" "),a("li",[e._v("Default: "),a("code",[e._v("5")])])]),e._v(" "),a("p",[a("code",[e._v("oneTypo")]),e._v(" customize the minimum size for a word to tolerate 1 typo.")]),e._v(" "),a("blockquote",[a("p",[e._v("Given the default value "),a("code",[e._v("5")]),e._v(", the search engine starts to apply typo tolerance on a query term if its length is at least equal to 5 characters.")])]),e._v(" "),a("blockquote",[a("p",[e._v("See "),a("a",{attrs:{href:"#21-typos-calculation"}},[e._v("2.1. Typos calculation section")])])]),e._v(" "),a("h5",{attrs:{id:"_3-1-4-2-1-example"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-4-2-1-example"}},[e._v("#")]),e._v(" 3.1.4.2.1 Example")]),e._v(" "),a("p",[e._v("Given "),a("code",[e._v("5")]),e._v(" as "),a("code",[e._v("oneTypo")]),e._v(" and the following document")]),e._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"id"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"title"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"Hey World"')]),e._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),a("ul",[a("li",[e._v("Typing "),a("code",[e._v("World")]),e._v(" with 1 typo, e.g. "),a("code",[e._v("Warld")]),e._v(" will match "),a("code",[e._v("World")]),e._v(". It accepts 1 typo since "),a("code",[e._v("World")]),e._v(" size is made of "),a("code",[e._v("5")]),e._v(" chars.")]),e._v(" "),a("li",[e._v("Typing "),a("code",[e._v("Hey")]),e._v(" with 1 typo, e.g. "),a("code",[e._v("Hoy")]),e._v(" won't match "),a("code",[e._v("Hey")]),e._v(". It accepts 0 typo since "),a("code",[e._v("Hey")]),e._v(" size is made of "),a("code",[e._v("3")]),e._v(" chars.")])]),e._v(" "),a("h4",{attrs:{id:"_3-1-4-3-twotypos"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-4-3-twotypos"}},[e._v("#")]),e._v(" 3.1.4.3. "),a("code",[e._v("twoTypos")])]),e._v(" "),a("ul",[a("li",[e._v("Type: Integer")]),e._v(" "),a("li",[e._v("Required: False")]),e._v(" "),a("li",[e._v("Default: "),a("code",[e._v("9")])])]),e._v(" "),a("p",[a("code",[e._v("twoTypos")]),e._v(" customize the minimum size for a word to tolerate 2 typos.")]),e._v(" "),a("blockquote",[a("p",[e._v("Given the default value "),a("code",[e._v("9")]),e._v(", the search engine handles up to 2 typos on a query term if its length is at least equal to 9 characters.")])]),e._v(" "),a("blockquote",[a("p",[e._v("See "),a("a",{attrs:{href:"#21-typos-calculation"}},[e._v("2.1. Typos calculation section")])])]),e._v(" "),a("h5",{attrs:{id:"_3-1-4-3-1-example"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-4-3-1-example"}},[e._v("#")]),e._v(" 3.1.4.3.1. Example")]),e._v(" "),a("p",[e._v("Given "),a("code",[e._v("3")]),e._v(" for "),a("code",[e._v("oneTypo")]),e._v(" and "),a("code",[e._v("5")]),e._v(" as "),a("code",[e._v("twoTypos")]),e._v(" and the following document")]),e._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"id"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"title"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"Hey World"')]),e._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),a("ul",[a("li",[e._v("Typing "),a("code",[e._v("World")]),e._v(" with 2 typos, e.g. "),a("code",[e._v("Warrld")]),e._v(" will match "),a("code",[e._v("World")]),e._v(". It accepts up to 2 typos since "),a("code",[e._v("World")]),e._v(" size is made of "),a("code",[e._v("5")]),e._v(" chars.")]),e._v(" "),a("li",[e._v("Typing "),a("code",[e._v("Hey")]),e._v(" with 1 typo, e.g. "),a("code",[e._v("Hoy")]),e._v(" will match "),a("code",[e._v("Hey")]),e._v(". It accepts only 1 typo since "),a("code",[e._v("Hey")]),e._v(" size is made of "),a("code",[e._v("3")]),e._v(" chars.")])]),e._v(" "),a("h2",{attrs:{id:"_3-2-api-endpoints-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-api-endpoints-definition"}},[e._v("#")]),e._v(" 3.2. API Endpoints Definition")]),e._v(" "),a("h3",{attrs:{id:"_3-2-1-global-settings-api-endpoints-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-1-global-settings-api-endpoints-definition"}},[e._v("#")]),e._v(" 3.2.1. Global Settings API Endpoints Definition")]),e._v(" "),a("p",[a("code",[e._v("typoTolerance")]),e._v(" is a sub-resource of "),a("code",[e._v("/indexes/:index_uid/settings")]),e._v(".")]),e._v(" "),a("p",[e._v("See "),a("RouterLink",{attrs:{to:"/specifications/text/0123-settings-api.html"}},[e._v("Settings API")]),e._v(".")],1),e._v(" "),a("h3",{attrs:{id:"_3-2-2-indexes-index-uid-settings-typo-tolerance"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-2-indexes-index-uid-settings-typo-tolerance"}},[e._v("#")]),e._v(" 3.2.2. "),a("code",[e._v("indexes/:index_uid/settings/typo-tolerance")])]),e._v(" "),a("p",[e._v("Manage the typo tolerance configuration for an index.")]),e._v(" "),a("h4",{attrs:{id:"_3-2-2-1-get-indexes-index-uid-settings-typo-tolerance"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-2-1-get-indexes-index-uid-settings-typo-tolerance"}},[e._v("#")]),e._v(" 3.2.2.1. "),a("code",[e._v("GET")]),e._v(" - "),a("code",[e._v("indexes/:index_uid/settings/typo-tolerance")])]),e._v(" "),a("p",[e._v("Allow fetching the current definition of the typo tolerance feature for an index.")]),e._v(" "),a("p",[a("code",[e._v("200")]),e._v(" - Response body")]),e._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"enabled"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[e._v("true")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"disableOnAttributes"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"disableOnWords"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"minWordSizeForTypos"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"oneTypo"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"twoTypos"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("9")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),a("p",[e._v("All properties must be returned when the resource is retrieved.")]),e._v(" "),a("h5",{attrs:{id:"_3-2-2-1-2-errors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-2-1-2-errors"}},[e._v("#")]),e._v(" 3.2.2.1.2. Errors")]),e._v(" "),a("ul",[a("li",[e._v("🔴 Sending an invalid index uid format for the "),a("code",[e._v(":index_uid")]),e._v(" path parameter returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_uid"}},[e._v("invalid_index_uid")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 If the index does not exist, the API returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_not_found"}},[e._v("index_not_found")]),e._v(" error.")],1)]),e._v(" "),a("h4",{attrs:{id:"_3-2-2-2-patch-indexes-index-uid-settings-typo-tolerance"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-2-2-patch-indexes-index-uid-settings-typo-tolerance"}},[e._v("#")]),e._v(" 3.2.2.2. "),a("code",[e._v("PATCH")]),e._v(" - "),a("code",[e._v("indexes/:index_uid/settings/typo-tolerance")])]),e._v(" "),a("p",[e._v("Allow customizing partially the settings of the typo tolerance feature for an index.")]),e._v(" "),a("p",[e._v("Request payload")]),e._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"disableOnAttributes"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"title"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"description"')]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"minWordSizeForTypos"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("4")]),e._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),a("p",[a("code",[e._v("202 Accepted")]),e._v(" - Example Response")]),e._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"uid"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("42")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"indexUid"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"books"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"enqueued"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"settingsUpdate"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"enqueuedAt"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"2022-03-01T18:39:29.228155Z"')]),e._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),a("h5",{attrs:{id:"_3-2-2-2-1-response-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-2-2-1-response-definition"}},[e._v("#")]),e._v(" 3.2.2.2.1. Response Definition")]),e._v(" "),a("p",[e._v("When the request is successful, Meilisearch returns the HTTP code "),a("code",[e._v("202 Accepted")]),e._v(". The response's content is the summarized representation of the received asynchronous task.")]),e._v(" "),a("p",[e._v("See "),a("RouterLink",{attrs:{to:"/specifications/text/0060-tasks-api.html#summarized-task-object-for-202-accepted"}},[e._v("Summarized "),a("code",[e._v("task")]),e._v(" Object for "),a("code",[e._v("202 Accepted")])]),e._v(".")],1),e._v(" "),a("h5",{attrs:{id:"_3-2-2-2-2-errors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-2-2-2-errors"}},[e._v("#")]),e._v(" 3.2.2.2.2. Errors")]),e._v(" "),a("ul",[a("li",[e._v("🔴 Omitting Content-Type header returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_content_type"}},[e._v("missing_content_type")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending an empty Content-Type returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_content_type"}},[e._v("invalid_content_type")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending a different Content-Type than "),a("code",[e._v("application/json")]),e._v(" returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_content_type"}},[e._v("invalid_content_type")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending an empty payload returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_payload"}},[e._v("missing_payload")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending an invalid JSON payload returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#malformed_payload"}},[e._v("malformed_payload")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending an invalid index uid format for the "),a("code",[e._v(":index_uid")]),e._v(" path parameter returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_uid"}},[e._v("invalid_index_uid")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending a value different from "),a("code",[e._v("null")]),e._v(" or with a different type than "),a("code",[e._v("Boolean")]),e._v(" for the "),a("code",[e._v("enabled")]),e._v(" field returns an\n"),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_settings_typo_tolerance"}},[e._v("invalid_settings_typo_tolerance")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending a value different from "),a("code",[e._v("null")]),e._v(" or with a different type than "),a("code",[e._v("Array of String")]),e._v(" for the "),a("code",[e._v("disableOnAttributes")]),e._v("\nfield returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_settings_typo_tolerance"}},[e._v("invalid_settings_typo_tolerance")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending a value different from "),a("code",[e._v("null")]),e._v(" or with a different type than "),a("code",[e._v("Array of String")]),e._v(" for the "),a("code",[e._v("disableOnWords")]),e._v(" field\nreturns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_settings_typo_tolerance"}},[e._v("invalid_settings_typo_tolerance")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending a value different from "),a("code",[e._v("null")]),e._v(" or with a different type than "),a("code",[e._v("Integer")]),e._v(" for "),a("code",[e._v("minWordSizeForTypos")]),e._v(" object fields\nreturns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_settings_typo_tolerance"}},[e._v("invalid_settings_typo_tolerance")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending invalid values for "),a("code",[e._v("oneTypo")]),e._v(" AND "),a("code",[e._v("twoTypos")]),e._v(" being specified for the "),a("code",[e._v("minWordSizeForTypos")]),e._v(" object fields returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_settings_typo_tolerance"}},[e._v("invalid_settings_typo_tolerance")]),e._v(" error.")],1)]),e._v(" "),a("h6",{attrs:{id:"_3-2-2-2-2-1-async-errors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-2-2-2-1-async-errors"}},[e._v("#")]),e._v(" 3.2.2.2.2.1. Async Errors")]),e._v(" "),a("ul",[a("li",[e._v("🔴 When Meilisearch is secured, if the API Key do not have the "),a("code",[e._v("indexes.create")]),e._v(" action defined, the API returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_not_found"}},[e._v("index_not_found")]),e._v(" error in the related asynchronous "),a("code",[e._v("task")]),e._v(" resource. See "),a("a",{attrs:{href:"#32221-response-definition"}},[e._v("3.2.2.2.1. Response Definition")]),e._v(".")],1)]),e._v(" "),a("blockquote",[a("p",[e._v("Otherwise, Meilisearch will create the index in a lazy way. See "),a("a",{attrs:{href:"#32223-lazy-index-creation"}},[e._v("3.2.2.2.3. Lazy Index Creation")]),e._v(".")])]),e._v(" "),a("ul",[a("li",[e._v("🔴 When sending invalid values with either "),a("code",[e._v("oneTypo")]),e._v(" OR "),a("code",[e._v("twoTypos")]),e._v(" being specified for the "),a("code",[e._v("minWordSizeForTypos")]),e._v(" object fields returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_settings_typo_tolerance"}},[e._v("invalid_settings_typo_tolerance")]),e._v(" error.")],1)]),e._v(" "),a("h5",{attrs:{id:"_3-2-2-2-3-lazy-index-creation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-2-2-3-lazy-index-creation"}},[e._v("#")]),e._v(" 3.2.2.2.3. Lazy Index Creation")]),e._v(" "),a("p",[e._v("If the requested "),a("code",[e._v("index_uid")]),e._v(" does not exist, and the authorization layer allows it (See "),a("a",{attrs:{href:"#322221-async-errors"}},[e._v("3.2.2.2.2.1. Async Errors")]),e._v("), Meilisearch will create the index when the related asynchronous task resource is executed. See "),a("a",{attrs:{href:"#32221-response-definition"}},[e._v("3.2.2.2.1. Response Definition")]),e._v(".")]),e._v(" "),a("h4",{attrs:{id:"_3-2-2-3-delete-indexes-index-uid-settings-typo-tolerance"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-2-3-delete-indexes-index-uid-settings-typo-tolerance"}},[e._v("#")]),e._v(" 3.2.2.3. "),a("code",[e._v("DELETE")]),e._v("- "),a("code",[e._v("indexes/:index_uid/settings/typo-tolerance")])]),e._v(" "),a("p",[e._v("Allow resetting the typo tolerance feature to the default for an index.")]),e._v(" "),a("h5",{attrs:{id:"_3-2-2-3-1-response-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-2-3-1-response-definition"}},[e._v("#")]),e._v(" 3.2.2.3.1. Response Definition")]),e._v(" "),a("p",[e._v("When the request is in a successful state, Meilisearch returns the HTTP code "),a("code",[e._v("202 Accepted")]),e._v(". The response's content is the summarized representation of the received asynchronous task.")]),e._v(" "),a("p",[e._v("See "),a("RouterLink",{attrs:{to:"/specifications/text/0060-tasks-api.html#summarized-task-object-for-202-accepted"}},[e._v("Summarized "),a("code",[e._v("task")]),e._v(" Object for "),a("code",[e._v("202 Accepted")])]),e._v(".")],1),e._v(" "),a("h5",{attrs:{id:"_3-2-2-3-2-errors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-2-3-2-errors"}},[e._v("#")]),e._v(" 3.2.2.3.2. Errors")]),e._v(" "),a("ul",[a("li",[e._v("🔴 Sending an invalid index uid format for the "),a("code",[e._v(":index_uid")]),e._v(" path parameter returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_uid"}},[e._v("invalid_index_uid")]),e._v(" error.")],1)]),e._v(" "),a("h6",{attrs:{id:"_3-2-2-3-2-1-asynchronous-index-not-found-error"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-2-3-2-1-asynchronous-index-not-found-error"}},[e._v("#")]),e._v(" 3.2.2.3.2.1. Asynchronous Index Not Found Error")]),e._v(" "),a("ul",[a("li",[e._v("🔴 If the requested "),a("code",[e._v("index_uid")]),e._v(" does not exist, the API returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_not_found"}},[e._v("index_not_found")]),e._v(" error in the related async "),a("code",[e._v("task")]),e._v(" resource. See "),a("a",{attrs:{href:"#32231-response-definition"}},[e._v("3.2.2.3.1. Response Definition")]),e._v(".")],1)]),e._v(" "),a("h3",{attrs:{id:"_3-2-3-general-errors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-3-general-errors"}},[e._v("#")]),e._v(" 3.2.3. General Errors")]),e._v(" "),a("p",[e._v("These errors apply to all endpoints described here.")]),e._v(" "),a("h4",{attrs:{id:"_3-2-3-1-auth-errors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-3-1-auth-errors"}},[e._v("#")]),e._v(" 3.2.3.1. Auth Errors")]),e._v(" "),a("p",[e._v("The auth layer can return the following errors if Meilisearch is secured (a master-key is defined).")]),e._v(" "),a("ul",[a("li",[e._v("🔴 Accessing this route without the "),a("code",[e._v("Authorization")]),e._v(" header returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_authorization_header"}},[e._v("missing_authorization_header")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Accessing this route with a key that does not have permissions (i.e. other than the master-key) returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key"}},[e._v("invalid_api_key")]),e._v(" error.")],1)]),e._v(" "),a("h2",{attrs:{id:"_2-technical-details"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-technical-details"}},[e._v("#")]),e._v(" 2. Technical Details")]),e._v(" "),a("h3",{attrs:{id:"_2-1-typos-calculation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-1-typos-calculation"}},[e._v("#")]),e._v(" 2.1. Typos Calculation")]),e._v(" "),a("p",[e._v("The size of a query term triggers the typo tolerance feature.")]),e._v(" "),a("p",[e._v("By default, a query term made of "),a("code",[e._v("5")]),e._v(" characters can tolerate "),a("code",[e._v("1")]),e._v(" typo, while a query term made of "),a("code",[e._v("9")]),e._v(" characters can tolerate "),a("code",[e._v("2")]),e._v(" typos.")]),e._v(" "),a("p",[e._v("If a query term can be derived from a distance of one or two typos to be found in a document, it will be selected as a candidate. The number of typos found has an impact on the relevancy.")]),e._v(" "),a("h4",{attrs:{id:"_2-1-1-typo-on-the-first-character"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-1-1-typo-on-the-first-character"}},[e._v("#")]),e._v(" 2.1.1 Typo On The First Character")]),e._v(" "),a("p",[e._v("A query term having the first character considered as a typo will not count as "),a("code",[e._v("1")]),e._v(" typo but as "),a("code",[e._v("2")]),e._v(" typos.")]),e._v(" "),a("p",[e._v("It permits to drastically reduce the search space in this case, thus speed-up the search response.")]),e._v(" "),a("h4",{attrs:{id:"_2-1-2-clamping-typo-on-concatened-query-terms"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-1-2-clamping-typo-on-concatened-query-terms"}},[e._v("#")]),e._v(" 2.1.2. Clamping Typo On Concatened Query Terms")]),e._v(" "),a("p",[e._v("The concatenation of two query terms is equal to 1 typo.")]),e._v(" "),a("p",[e._v("e.g. If "),a("code",[e._v("Le tableau")]),e._v(" is typed, the concatened string "),a("code",[e._v("Letableau")]),e._v(" made of "),a("code",[e._v("9")]),e._v(" letters can only have "),a("code",[e._v("1")]),e._v(" typo instead of "),a("code",[e._v("2")]),e._v(" since "),a("code",[e._v("1")]),e._v(" typo is already counted by the concatenation.")]),e._v(" "),a("h3",{attrs:{id:"_2-2-typo-ranking-rule"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-2-typo-ranking-rule"}},[e._v("#")]),e._v(" 2.2. Typo Ranking Rule")]),e._v(" "),a("p",[e._v("The "),a("code",[e._v("typo")]),e._v(" ranking rule favors candidates with the least typos. That is, if a document is found with two typos, it will be ranked as less important than a document found with 1 typo. 0 typo is the most favorable case.")]),e._v(" "),a("h2",{attrs:{id:"_3-future-possibilities"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-future-possibilities"}},[e._v("#")]),e._v(" 3. Future Possibilities")]),e._v(" "),a("ul",[a("li",[e._v("Expose "),a("code",[e._v("typoTolerance")]),e._v(" resource as a search parameter to override index settings.")]),e._v(" "),a("li",[e._v("Add the possibility to disable the typo tolerance feature on all numeric fields.")]),e._v(" "),a("li",[e._v("Add different modes of result matching for the typo feature. e.g. "),a("code",[e._v("default")]),e._v("/"),a("code",[e._v("min")]),e._v("/"),a("code",[e._v("strict")])]),e._v(" "),a("li",[e._v("Introduce synchronous "),a("code",[e._v("invalid_settings_typo_tolerance_{fieldName}")]),e._v(" error code granularity.")])])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file diff --git a/docs/assets/js/38.de46d18d.js b/docs/assets/js/38.651ab4ec.js similarity index 99% rename from docs/assets/js/38.de46d18d.js rename to docs/assets/js/38.651ab4ec.js index 85bdc4f57..0e04cadfe 100644 --- a/docs/assets/js/38.de46d18d.js +++ b/docs/assets/js/38.651ab4ec.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[38],{463:function(t,e,s){"use strict";s.r(e);var a=s(62),n=Object(a.a)({},(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"distinct-attribute-setting-api"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#distinct-attribute-setting-api"}},[t._v("#")]),t._v(" Distinct Attribute Setting API")]),t._v(" "),s("h2",{attrs:{id:"_1-summary"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-summary"}},[t._v("#")]),t._v(" 1. Summary")]),t._v(" "),s("p",[t._v("This specification describes the "),s("code",[t._v("distinctAttribute")]),t._v(" index setting API endpoints.")]),t._v(" "),s("h2",{attrs:{id:"_2-motivation"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-motivation"}},[t._v("#")]),t._v(" 2. Motivation")]),t._v(" "),s("p",[t._v("N/A")]),t._v(" "),s("h2",{attrs:{id:"_3-functional-specification"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-functional-specification"}},[t._v("#")]),t._v(" 3. Functional Specification")]),t._v(" "),s("h3",{attrs:{id:"_3-1-explanations"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-explanations"}},[t._v("#")]),t._v(" 3.1. Explanations")]),t._v(" "),s("p",[t._v("The value of a field whose attribute is set as a distinct attribute will always be unique in the returned documents.")]),t._v(" "),s("h4",{attrs:{id:"_3-1-1-usage-example"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-1-usage-example"}},[t._v("#")]),t._v(" 3.1.1. Usage Example")]),t._v(" "),s("p",[t._v("Suppose an e-commerce dataset. For an index that contains information about jackets, a products index may have several identical items in different variations (color or size).")]),t._v(" "),s("p",[t._v("As shown below, 2 documents containing the same jacket are defined. One of the jackets is brown and the other one is black.")]),t._v(" "),s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"id"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"description"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Leather jacket"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"brand"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Lee jeans"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"color"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"brown"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"product_id"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"123456"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"id"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"description"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Leather jacket"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"brand"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Lee jeans"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"color"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"black"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"product_id"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"123456"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])]),s("p",[t._v("By default, a search for "),s("code",[t._v("Leather jacket")]),t._v(" would return all documents. This might not be desired, since displaying nearly identical variations of the same item can make results appear cluttered.")]),t._v(" "),s("p",[t._v("By setting "),s("code",[t._v("product_id")]),t._v(" as the "),s("code",[t._v("distinctAttribute")]),t._v(" setting, the different variations of an item will be ignored.")]),t._v(" "),s("p",[s("em",[s("strong",[t._v("Request payload "),s("code",[t._v("PUT")]),t._v("- "),s("code",[t._v("/indexes/products/settings/distinct-attribute")])])])]),t._v(" "),s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"product_id"')]),t._v("\n")])])]),s("p",[t._v("After setting the distinct attribute as shown above, querying for "),s("code",[t._v("Leather jacket")]),t._v(" would only return the "),s("strong",[t._v("first document")]),t._v(" found. The search response would look like this:")]),t._v(" "),s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hits"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"id"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"description"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Leather jacket"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"brand"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Lee jeans"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"color"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"brown"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"product_id"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"123456"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"offset"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"limit"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("20")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"nbHits"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"exhaustiveNbHits"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"processingTimeMs"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"query"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Leather jacket"')]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("Search requests will never return more than one document with the same "),s("code",[t._v("product_id")]),t._v(".")]),t._v(" "),s("h3",{attrs:{id:"_3-2-global-settings-api-endpoints-definition"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-global-settings-api-endpoints-definition"}},[t._v("#")]),t._v(" 3.2. Global Settings API Endpoints Definition")]),t._v(" "),s("p",[s("code",[t._v("distinctAttribute")]),t._v(" is a sub-resource of "),s("code",[t._v("/indexes/:index_uid/settings")]),t._v(".")]),t._v(" "),s("p",[t._v("See "),s("RouterLink",{attrs:{to:"/specifications/text/0123-settings-api.html"}},[t._v("Settings API")]),t._v(".")],1),t._v(" "),s("h3",{attrs:{id:"_3-3-api-endpoints-definition"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-api-endpoints-definition"}},[t._v("#")]),t._v(" 3.3. API Endpoints Definition")]),t._v(" "),s("p",[t._v("Manipulate the "),s("code",[t._v("distinctAttribute")]),t._v(" setting of a Meilisearch index.")]),t._v(" "),s("h4",{attrs:{id:"_3-3-1-get-indexes-index-uid-settings-distinct-attribute"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-1-get-indexes-index-uid-settings-distinct-attribute"}},[t._v("#")]),t._v(" 3.3.1. "),s("code",[t._v("GET")]),t._v(" - "),s("code",[t._v("indexes/:index_uid/settings/distinct-attribute")])]),t._v(" "),s("p",[t._v("Fetch the "),s("code",[t._v("distinctAttribute")]),t._v(" setting of a Meilisearch index.")]),t._v(" "),s("h5",{attrs:{id:"_3-3-1-1-response-definition"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-1-1-response-definition"}},[t._v("#")]),t._v(" 3.3.1.1. Response Definition")]),t._v(" "),s("ul",[s("li",[t._v("Type: String / "),s("code",[t._v("null")])]),t._v(" "),s("li",[t._v("Default: "),s("code",[t._v("null")])])]),t._v(" "),s("h5",{attrs:{id:"_3-3-1-2-errors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-1-2-errors"}},[t._v("#")]),t._v(" 3.3.1.2. Errors")]),t._v(" "),s("ul",[s("li",[t._v("🔴 Sending an invalid index uid format for the "),s("code",[t._v(":index_uid")]),t._v(" path parameter returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_uid"}},[t._v("invalid_index_uid")]),t._v(" error.")],1),t._v(" "),s("li",[t._v("🔴 If the requested "),s("code",[t._v("index_uid")]),t._v(" does not exist, the API returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_not_found"}},[t._v("index_not_found")]),t._v(" error.")],1)]),t._v(" "),s("h4",{attrs:{id:"_3-3-2-put-indexes-index-uid-settings-distinct-attribute"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-put-indexes-index-uid-settings-distinct-attribute"}},[t._v("#")]),t._v(" 3.3.2. "),s("code",[t._v("PUT")]),t._v(" - "),s("code",[t._v("indexes/:index_uid/settings/distinct-attribute")])]),t._v(" "),s("p",[t._v("Modify the "),s("code",[t._v("distinctAttribute")]),t._v(" setting of a Meilisearch index.")]),t._v(" "),s("h5",{attrs:{id:"_3-3-2-1-request-payload-definition"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-1-request-payload-definition"}},[t._v("#")]),t._v(" 3.3.2.1. Request Payload Definition")]),t._v(" "),s("ul",[s("li",[t._v("Type: String / "),s("code",[t._v("null")])])]),t._v(" "),s("p",[t._v("Setting "),s("code",[t._v("null")]),t._v(" is equivalent to using the "),s("a",{attrs:{href:"#333-delete---indexesindexuidsettingsdistinct-attribute"}},[t._v("3.3.3. "),s("code",[t._v("DELETE")]),t._v(" - "),s("code",[t._v("indexes/:index_uid/settings/distinct-attribute")])]),t._v(" API endpoint.")]),t._v(" "),s("p",[t._v("Specifying a document attribute that does not exist as a "),s("code",[t._v("distinctAttribute")]),t._v(" index setting returns no error.")]),t._v(" "),s("h5",{attrs:{id:"_3-3-2-2-response-definition"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-2-response-definition"}},[t._v("#")]),t._v(" 3.3.2.2. Response Definition")]),t._v(" "),s("p",[t._v("When the request is successful, Meilisearch returns the HTTP code "),s("code",[t._v("202 Accepted")]),t._v(". The response's content is the summarized representation of the received asynchronous task.")]),t._v(" "),s("p",[t._v("See "),s("RouterLink",{attrs:{to:"/specifications/text/0060-tasks-api.html#summarized-task-object-for-202-accepted"}},[t._v("Summarized "),s("code",[t._v("task")]),t._v(" Object for "),s("code",[t._v("202 Accepted")])]),t._v(".")],1),t._v(" "),s("h5",{attrs:{id:"_3-3-2-3-errors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-3-errors"}},[t._v("#")]),t._v(" 3.3.2.3. Errors")]),t._v(" "),s("ul",[s("li",[t._v("🔴 Omitting Content-Type header returns a "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_content_type"}},[t._v("missing_content_type")]),t._v(" error.")],1),t._v(" "),s("li",[t._v("🔴 Sending an empty Content-Type returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_content_type"}},[t._v("invalid_content_type")]),t._v(" error.")],1),t._v(" "),s("li",[t._v("🔴 Sending a different Content-Type than "),s("code",[t._v("application/json")]),t._v(" returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_content_type"}},[t._v("invalid_content_type")]),t._v(" error.")],1),t._v(" "),s("li",[t._v("🔴 Sending an empty payload returns a "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_payload"}},[t._v("missing_payload")]),t._v(" error.")],1),t._v(" "),s("li",[t._v("🔴 Sending an invalid JSON payload returns a "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#malformed_payload"}},[t._v("malformed_payload")]),t._v(" error.")],1),t._v(" "),s("li",[t._v("🔴 Sending an invalid index uid format for the "),s("code",[t._v(":index_uid")]),t._v(" path parameter returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_uid"}},[t._v("invalid_index_uid")]),t._v(" error.")],1),t._v(" "),s("li",[t._v("🔴 Sending a request payload value type different of "),s("code",[t._v("String")]),t._v(" or "),s("code",[t._v("null")]),t._v(" returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_settings_distinct_attribute"}},[t._v("invalid_settings_distinct_attribute")]),t._v(" error.")],1)]),t._v(" "),s("h6",{attrs:{id:"_3-3-2-3-1-async-errors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-3-1-async-errors"}},[t._v("#")]),t._v(" 3.3.2.3.1. Async Errors")]),t._v(" "),s("ul",[s("li",[t._v("🔴 When Meilisearch is secured, if the API Key do not have the "),s("code",[t._v("indexes.create")]),t._v(" action defined, the API returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_not_found"}},[t._v("index_not_found")]),t._v(" error in the related asynchronous "),s("code",[t._v("task")]),t._v(" resource. See "),s("a",{attrs:{href:"#3222-response-definition"}},[t._v("3.3.2.2. Response Definition")]),t._v(".")],1)]),t._v(" "),s("blockquote",[s("p",[t._v("Otherwise, Meilisearch will create the index in a lazy way. See "),s("a",{attrs:{href:"#3224-lazy-index-creation"}},[t._v("3.2.2.4. Lazy Index Creation")]),t._v(".")])]),t._v(" "),s("h5",{attrs:{id:"_3-3-2-4-lazy-index-creation"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-4-lazy-index-creation"}},[t._v("#")]),t._v(" 3.3.2.4. Lazy Index Creation")]),t._v(" "),s("p",[t._v("If the requested "),s("code",[t._v("index_uid")]),t._v(" does not exist, and the authorization layer allows it (See "),s("a",{attrs:{href:"#33231-async-errors"}},[t._v("3.3.2.3.1. Async Errors")]),t._v("), Meilisearch will create the index when the related asynchronous task resource is executed. See "),s("a",{attrs:{href:"#3322-response-definition"}},[t._v("3.3.2.2. Response Definition")]),t._v(".")]),t._v(" "),s("h4",{attrs:{id:"_3-3-3-delete-indexes-index-uid-settings-distinct-attribute"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-3-delete-indexes-index-uid-settings-distinct-attribute"}},[t._v("#")]),t._v(" 3.3.3. "),s("code",[t._v("DELETE")]),t._v(" - "),s("code",[t._v("indexes/:index_uid/settings/distinct-attribute")])]),t._v(" "),s("p",[t._v("Reset the "),s("code",[t._v("distinctAttribute")]),t._v(" setting of a Meilisearch index to the default value "),s("code",[t._v("null")]),t._v(".")]),t._v(" "),s("h5",{attrs:{id:"_3-3-3-1-response-definition"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-3-1-response-definition"}},[t._v("#")]),t._v(" 3.3.3.1. Response Definition")]),t._v(" "),s("p",[t._v("When the request is in a successful state, Meilisearch returns the HTTP code "),s("code",[t._v("202 Accepted")]),t._v(". The response's content is the summarized representation of the received asynchronous task.")]),t._v(" "),s("p",[t._v("See "),s("RouterLink",{attrs:{to:"/specifications/text/0060-tasks-api.html#summarized-task-object-for-202-accepted"}},[t._v("Summarized "),s("code",[t._v("task")]),t._v(" Object for "),s("code",[t._v("202 Accepted")])]),t._v(".")],1),t._v(" "),s("h5",{attrs:{id:"_3-3-3-3-errors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-3-3-errors"}},[t._v("#")]),t._v(" 3.3.3.3. Errors")]),t._v(" "),s("ul",[s("li",[t._v("🔴 Sending an invalid index uid format for the "),s("code",[t._v(":index_uid")]),t._v(" path parameter returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_uid"}},[t._v("invalid_index_uid")]),t._v(" error.")],1)]),t._v(" "),s("h6",{attrs:{id:"_3-3-3-3-1-asynchronous-index-not-found-error"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-3-3-1-asynchronous-index-not-found-error"}},[t._v("#")]),t._v(" 3.3.3.3.1. Asynchronous Index Not Found Error")]),t._v(" "),s("ul",[s("li",[t._v("🔴 If the requested "),s("code",[t._v("index_uid")]),t._v(" does not exist, the API returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_not_found"}},[t._v("index_not_found")]),t._v(" error in the related async "),s("code",[t._v("task")]),t._v(" resource. See "),s("a",{attrs:{href:"#3331-response-definition"}},[t._v("3.3.3.1. Response Definition")]),t._v(".")],1)]),t._v(" "),s("h4",{attrs:{id:"_3-3-4-general-errors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-4-general-errors"}},[t._v("#")]),t._v(" 3.3.4. General Errors")]),t._v(" "),s("p",[t._v("These errors apply to all endpoints described here.")]),t._v(" "),s("h5",{attrs:{id:"_3-3-4-1-auth-errors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-4-1-auth-errors"}},[t._v("#")]),t._v(" 3.3.4.1 Auth Errors")]),t._v(" "),s("p",[t._v("The auth layer can return the following errors if Meilisearch is secured (a master-key is defined).")]),t._v(" "),s("ul",[s("li",[t._v("🔴 Accessing this route without the "),s("code",[t._v("Authorization")]),t._v(" header returns a "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_authorization_header"}},[t._v("missing_authorization_header")]),t._v(" error.")],1),t._v(" "),s("li",[t._v("🔴 Accessing this route with a key that does not have permissions (i.e. other than the master-key) returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key"}},[t._v("invalid_api_key")]),t._v(" error.")],1)]),t._v(" "),s("h2",{attrs:{id:"_4-technical-details"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-technical-details"}},[t._v("#")]),t._v(" 4. Technical Details")]),t._v(" "),s("h3",{attrs:{id:"_4-1-triggering-documents-re-indexing"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-triggering-documents-re-indexing"}},[t._v("#")]),t._v(" 4.1. Triggering Documents Re-Indexing")]),t._v(" "),s("p",[t._v("Meilisearch favors search speed and makes a trade-off on indexing speed by computing internal data structures to get search results as fast as possible.")]),t._v(" "),s("p",[t._v("Modifying this index setting cause documents to be re-indexed.")]),t._v(" "),s("h2",{attrs:{id:"_5-future-possibilities"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_5-future-possibilities"}},[t._v("#")]),t._v(" 5. Future Possibilities")]),t._v(" "),s("ul",[s("li",[t._v("Return an error when "),s("code",[t._v("distinctAttribute")]),t._v(" is specified as an empty string")])])])}),[],!1,null,null,null);e.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[38],{462:function(t,e,s){"use strict";s.r(e);var a=s(62),n=Object(a.a)({},(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"distinct-attribute-setting-api"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#distinct-attribute-setting-api"}},[t._v("#")]),t._v(" Distinct Attribute Setting API")]),t._v(" "),s("h2",{attrs:{id:"_1-summary"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-summary"}},[t._v("#")]),t._v(" 1. Summary")]),t._v(" "),s("p",[t._v("This specification describes the "),s("code",[t._v("distinctAttribute")]),t._v(" index setting API endpoints.")]),t._v(" "),s("h2",{attrs:{id:"_2-motivation"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-motivation"}},[t._v("#")]),t._v(" 2. Motivation")]),t._v(" "),s("p",[t._v("N/A")]),t._v(" "),s("h2",{attrs:{id:"_3-functional-specification"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-functional-specification"}},[t._v("#")]),t._v(" 3. Functional Specification")]),t._v(" "),s("h3",{attrs:{id:"_3-1-explanations"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-explanations"}},[t._v("#")]),t._v(" 3.1. Explanations")]),t._v(" "),s("p",[t._v("The value of a field whose attribute is set as a distinct attribute will always be unique in the returned documents.")]),t._v(" "),s("h4",{attrs:{id:"_3-1-1-usage-example"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-1-usage-example"}},[t._v("#")]),t._v(" 3.1.1. Usage Example")]),t._v(" "),s("p",[t._v("Suppose an e-commerce dataset. For an index that contains information about jackets, a products index may have several identical items in different variations (color or size).")]),t._v(" "),s("p",[t._v("As shown below, 2 documents containing the same jacket are defined. One of the jackets is brown and the other one is black.")]),t._v(" "),s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"id"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"description"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Leather jacket"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"brand"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Lee jeans"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"color"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"brown"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"product_id"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"123456"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"id"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"description"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Leather jacket"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"brand"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Lee jeans"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"color"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"black"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"product_id"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"123456"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])]),s("p",[t._v("By default, a search for "),s("code",[t._v("Leather jacket")]),t._v(" would return all documents. This might not be desired, since displaying nearly identical variations of the same item can make results appear cluttered.")]),t._v(" "),s("p",[t._v("By setting "),s("code",[t._v("product_id")]),t._v(" as the "),s("code",[t._v("distinctAttribute")]),t._v(" setting, the different variations of an item will be ignored.")]),t._v(" "),s("p",[s("em",[s("strong",[t._v("Request payload "),s("code",[t._v("PUT")]),t._v("- "),s("code",[t._v("/indexes/products/settings/distinct-attribute")])])])]),t._v(" "),s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"product_id"')]),t._v("\n")])])]),s("p",[t._v("After setting the distinct attribute as shown above, querying for "),s("code",[t._v("Leather jacket")]),t._v(" would only return the "),s("strong",[t._v("first document")]),t._v(" found. The search response would look like this:")]),t._v(" "),s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"hits"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"id"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"description"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Leather jacket"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"brand"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Lee jeans"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"color"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"brown"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"product_id"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"123456"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"offset"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"limit"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("20")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"nbHits"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"exhaustiveNbHits"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"processingTimeMs"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"query"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Leather jacket"')]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("Search requests will never return more than one document with the same "),s("code",[t._v("product_id")]),t._v(".")]),t._v(" "),s("h3",{attrs:{id:"_3-2-global-settings-api-endpoints-definition"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-global-settings-api-endpoints-definition"}},[t._v("#")]),t._v(" 3.2. Global Settings API Endpoints Definition")]),t._v(" "),s("p",[s("code",[t._v("distinctAttribute")]),t._v(" is a sub-resource of "),s("code",[t._v("/indexes/:index_uid/settings")]),t._v(".")]),t._v(" "),s("p",[t._v("See "),s("RouterLink",{attrs:{to:"/specifications/text/0123-settings-api.html"}},[t._v("Settings API")]),t._v(".")],1),t._v(" "),s("h3",{attrs:{id:"_3-3-api-endpoints-definition"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-api-endpoints-definition"}},[t._v("#")]),t._v(" 3.3. API Endpoints Definition")]),t._v(" "),s("p",[t._v("Manipulate the "),s("code",[t._v("distinctAttribute")]),t._v(" setting of a Meilisearch index.")]),t._v(" "),s("h4",{attrs:{id:"_3-3-1-get-indexes-index-uid-settings-distinct-attribute"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-1-get-indexes-index-uid-settings-distinct-attribute"}},[t._v("#")]),t._v(" 3.3.1. "),s("code",[t._v("GET")]),t._v(" - "),s("code",[t._v("indexes/:index_uid/settings/distinct-attribute")])]),t._v(" "),s("p",[t._v("Fetch the "),s("code",[t._v("distinctAttribute")]),t._v(" setting of a Meilisearch index.")]),t._v(" "),s("h5",{attrs:{id:"_3-3-1-1-response-definition"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-1-1-response-definition"}},[t._v("#")]),t._v(" 3.3.1.1. Response Definition")]),t._v(" "),s("ul",[s("li",[t._v("Type: String / "),s("code",[t._v("null")])]),t._v(" "),s("li",[t._v("Default: "),s("code",[t._v("null")])])]),t._v(" "),s("h5",{attrs:{id:"_3-3-1-2-errors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-1-2-errors"}},[t._v("#")]),t._v(" 3.3.1.2. Errors")]),t._v(" "),s("ul",[s("li",[t._v("🔴 Sending an invalid index uid format for the "),s("code",[t._v(":index_uid")]),t._v(" path parameter returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_uid"}},[t._v("invalid_index_uid")]),t._v(" error.")],1),t._v(" "),s("li",[t._v("🔴 If the requested "),s("code",[t._v("index_uid")]),t._v(" does not exist, the API returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_not_found"}},[t._v("index_not_found")]),t._v(" error.")],1)]),t._v(" "),s("h4",{attrs:{id:"_3-3-2-put-indexes-index-uid-settings-distinct-attribute"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-put-indexes-index-uid-settings-distinct-attribute"}},[t._v("#")]),t._v(" 3.3.2. "),s("code",[t._v("PUT")]),t._v(" - "),s("code",[t._v("indexes/:index_uid/settings/distinct-attribute")])]),t._v(" "),s("p",[t._v("Modify the "),s("code",[t._v("distinctAttribute")]),t._v(" setting of a Meilisearch index.")]),t._v(" "),s("h5",{attrs:{id:"_3-3-2-1-request-payload-definition"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-1-request-payload-definition"}},[t._v("#")]),t._v(" 3.3.2.1. Request Payload Definition")]),t._v(" "),s("ul",[s("li",[t._v("Type: String / "),s("code",[t._v("null")])])]),t._v(" "),s("p",[t._v("Setting "),s("code",[t._v("null")]),t._v(" is equivalent to using the "),s("a",{attrs:{href:"#333-delete---indexesindexuidsettingsdistinct-attribute"}},[t._v("3.3.3. "),s("code",[t._v("DELETE")]),t._v(" - "),s("code",[t._v("indexes/:index_uid/settings/distinct-attribute")])]),t._v(" API endpoint.")]),t._v(" "),s("p",[t._v("Specifying a document attribute that does not exist as a "),s("code",[t._v("distinctAttribute")]),t._v(" index setting returns no error.")]),t._v(" "),s("h5",{attrs:{id:"_3-3-2-2-response-definition"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-2-response-definition"}},[t._v("#")]),t._v(" 3.3.2.2. Response Definition")]),t._v(" "),s("p",[t._v("When the request is successful, Meilisearch returns the HTTP code "),s("code",[t._v("202 Accepted")]),t._v(". The response's content is the summarized representation of the received asynchronous task.")]),t._v(" "),s("p",[t._v("See "),s("RouterLink",{attrs:{to:"/specifications/text/0060-tasks-api.html#summarized-task-object-for-202-accepted"}},[t._v("Summarized "),s("code",[t._v("task")]),t._v(" Object for "),s("code",[t._v("202 Accepted")])]),t._v(".")],1),t._v(" "),s("h5",{attrs:{id:"_3-3-2-3-errors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-3-errors"}},[t._v("#")]),t._v(" 3.3.2.3. Errors")]),t._v(" "),s("ul",[s("li",[t._v("🔴 Omitting Content-Type header returns a "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_content_type"}},[t._v("missing_content_type")]),t._v(" error.")],1),t._v(" "),s("li",[t._v("🔴 Sending an empty Content-Type returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_content_type"}},[t._v("invalid_content_type")]),t._v(" error.")],1),t._v(" "),s("li",[t._v("🔴 Sending a different Content-Type than "),s("code",[t._v("application/json")]),t._v(" returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_content_type"}},[t._v("invalid_content_type")]),t._v(" error.")],1),t._v(" "),s("li",[t._v("🔴 Sending an empty payload returns a "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_payload"}},[t._v("missing_payload")]),t._v(" error.")],1),t._v(" "),s("li",[t._v("🔴 Sending an invalid JSON payload returns a "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#malformed_payload"}},[t._v("malformed_payload")]),t._v(" error.")],1),t._v(" "),s("li",[t._v("🔴 Sending an invalid index uid format for the "),s("code",[t._v(":index_uid")]),t._v(" path parameter returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_uid"}},[t._v("invalid_index_uid")]),t._v(" error.")],1),t._v(" "),s("li",[t._v("🔴 Sending a request payload value type different of "),s("code",[t._v("String")]),t._v(" or "),s("code",[t._v("null")]),t._v(" returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_settings_distinct_attribute"}},[t._v("invalid_settings_distinct_attribute")]),t._v(" error.")],1)]),t._v(" "),s("h6",{attrs:{id:"_3-3-2-3-1-async-errors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-3-1-async-errors"}},[t._v("#")]),t._v(" 3.3.2.3.1. Async Errors")]),t._v(" "),s("ul",[s("li",[t._v("🔴 When Meilisearch is secured, if the API Key do not have the "),s("code",[t._v("indexes.create")]),t._v(" action defined, the API returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_not_found"}},[t._v("index_not_found")]),t._v(" error in the related asynchronous "),s("code",[t._v("task")]),t._v(" resource. See "),s("a",{attrs:{href:"#3222-response-definition"}},[t._v("3.3.2.2. Response Definition")]),t._v(".")],1)]),t._v(" "),s("blockquote",[s("p",[t._v("Otherwise, Meilisearch will create the index in a lazy way. See "),s("a",{attrs:{href:"#3224-lazy-index-creation"}},[t._v("3.2.2.4. Lazy Index Creation")]),t._v(".")])]),t._v(" "),s("h5",{attrs:{id:"_3-3-2-4-lazy-index-creation"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-4-lazy-index-creation"}},[t._v("#")]),t._v(" 3.3.2.4. Lazy Index Creation")]),t._v(" "),s("p",[t._v("If the requested "),s("code",[t._v("index_uid")]),t._v(" does not exist, and the authorization layer allows it (See "),s("a",{attrs:{href:"#33231-async-errors"}},[t._v("3.3.2.3.1. Async Errors")]),t._v("), Meilisearch will create the index when the related asynchronous task resource is executed. See "),s("a",{attrs:{href:"#3322-response-definition"}},[t._v("3.3.2.2. Response Definition")]),t._v(".")]),t._v(" "),s("h4",{attrs:{id:"_3-3-3-delete-indexes-index-uid-settings-distinct-attribute"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-3-delete-indexes-index-uid-settings-distinct-attribute"}},[t._v("#")]),t._v(" 3.3.3. "),s("code",[t._v("DELETE")]),t._v(" - "),s("code",[t._v("indexes/:index_uid/settings/distinct-attribute")])]),t._v(" "),s("p",[t._v("Reset the "),s("code",[t._v("distinctAttribute")]),t._v(" setting of a Meilisearch index to the default value "),s("code",[t._v("null")]),t._v(".")]),t._v(" "),s("h5",{attrs:{id:"_3-3-3-1-response-definition"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-3-1-response-definition"}},[t._v("#")]),t._v(" 3.3.3.1. Response Definition")]),t._v(" "),s("p",[t._v("When the request is in a successful state, Meilisearch returns the HTTP code "),s("code",[t._v("202 Accepted")]),t._v(". The response's content is the summarized representation of the received asynchronous task.")]),t._v(" "),s("p",[t._v("See "),s("RouterLink",{attrs:{to:"/specifications/text/0060-tasks-api.html#summarized-task-object-for-202-accepted"}},[t._v("Summarized "),s("code",[t._v("task")]),t._v(" Object for "),s("code",[t._v("202 Accepted")])]),t._v(".")],1),t._v(" "),s("h5",{attrs:{id:"_3-3-3-3-errors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-3-3-errors"}},[t._v("#")]),t._v(" 3.3.3.3. Errors")]),t._v(" "),s("ul",[s("li",[t._v("🔴 Sending an invalid index uid format for the "),s("code",[t._v(":index_uid")]),t._v(" path parameter returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_uid"}},[t._v("invalid_index_uid")]),t._v(" error.")],1)]),t._v(" "),s("h6",{attrs:{id:"_3-3-3-3-1-asynchronous-index-not-found-error"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-3-3-1-asynchronous-index-not-found-error"}},[t._v("#")]),t._v(" 3.3.3.3.1. Asynchronous Index Not Found Error")]),t._v(" "),s("ul",[s("li",[t._v("🔴 If the requested "),s("code",[t._v("index_uid")]),t._v(" does not exist, the API returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_not_found"}},[t._v("index_not_found")]),t._v(" error in the related async "),s("code",[t._v("task")]),t._v(" resource. See "),s("a",{attrs:{href:"#3331-response-definition"}},[t._v("3.3.3.1. Response Definition")]),t._v(".")],1)]),t._v(" "),s("h4",{attrs:{id:"_3-3-4-general-errors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-4-general-errors"}},[t._v("#")]),t._v(" 3.3.4. General Errors")]),t._v(" "),s("p",[t._v("These errors apply to all endpoints described here.")]),t._v(" "),s("h5",{attrs:{id:"_3-3-4-1-auth-errors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-4-1-auth-errors"}},[t._v("#")]),t._v(" 3.3.4.1 Auth Errors")]),t._v(" "),s("p",[t._v("The auth layer can return the following errors if Meilisearch is secured (a master-key is defined).")]),t._v(" "),s("ul",[s("li",[t._v("🔴 Accessing this route without the "),s("code",[t._v("Authorization")]),t._v(" header returns a "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_authorization_header"}},[t._v("missing_authorization_header")]),t._v(" error.")],1),t._v(" "),s("li",[t._v("🔴 Accessing this route with a key that does not have permissions (i.e. other than the master-key) returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key"}},[t._v("invalid_api_key")]),t._v(" error.")],1)]),t._v(" "),s("h2",{attrs:{id:"_4-technical-details"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-technical-details"}},[t._v("#")]),t._v(" 4. Technical Details")]),t._v(" "),s("h3",{attrs:{id:"_4-1-triggering-documents-re-indexing"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-triggering-documents-re-indexing"}},[t._v("#")]),t._v(" 4.1. Triggering Documents Re-Indexing")]),t._v(" "),s("p",[t._v("Meilisearch favors search speed and makes a trade-off on indexing speed by computing internal data structures to get search results as fast as possible.")]),t._v(" "),s("p",[t._v("Modifying this index setting cause documents to be re-indexed.")]),t._v(" "),s("h2",{attrs:{id:"_5-future-possibilities"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_5-future-possibilities"}},[t._v("#")]),t._v(" 5. Future Possibilities")]),t._v(" "),s("ul",[s("li",[t._v("Return an error when "),s("code",[t._v("distinctAttribute")]),t._v(" is specified as an empty string")])])])}),[],!1,null,null,null);e.default=n.exports}}]); \ No newline at end of file diff --git a/docs/assets/js/39.c0e59772.js b/docs/assets/js/39.3ffdfa45.js similarity index 99% rename from docs/assets/js/39.c0e59772.js rename to docs/assets/js/39.3ffdfa45.js index 3dc024d12..d67205e32 100644 --- a/docs/assets/js/39.c0e59772.js +++ b/docs/assets/js/39.3ffdfa45.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[39],{462:function(e,t,i){"use strict";i.r(t);var r=i(62),a=Object(r.a)({},(function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[i("h1",{attrs:{id:"filterable-attributes-setting-api"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#filterable-attributes-setting-api"}},[e._v("#")]),e._v(" Filterable Attributes Setting API")]),e._v(" "),i("h2",{attrs:{id:"_1-summary"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_1-summary"}},[e._v("#")]),e._v(" 1. Summary")]),e._v(" "),i("p",[e._v("This specification describes the "),i("code",[e._v("filterableAttributes")]),e._v(" index setting API endpoints.")]),e._v(" "),i("h2",{attrs:{id:"_2-motivation"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_2-motivation"}},[e._v("#")]),e._v(" 2. Motivation")]),e._v(" "),i("p",[e._v("N/A")]),e._v(" "),i("h2",{attrs:{id:"_3-functional-specification"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-functional-specification"}},[e._v("#")]),e._v(" 3. Functional Specification")]),e._v(" "),i("h3",{attrs:{id:"_3-1-explanations"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-explanations"}},[e._v("#")]),e._v(" 3.1. Explanations")]),e._v(" "),i("p",[i("code",[e._v("filterableAttributes")]),e._v(" setting allows to configure the document fields usable as filter criteria and as facets.")]),e._v(" "),i("p",[e._v("Filters have several use-cases, such as restricting the results a specific user has access to or creating faceted search interfaces. Faceted search interfaces are particularly efficient in helping users navigate a great number of results across many broad categories.")]),e._v(" "),i("p",[i("code",[e._v("filterableAttributes")]),e._v(" need to be properly processed and prepared by Meilisearch before they can be used at search time. Fields defined as "),i("code",[e._v("filterableAttributes")]),e._v(" are usable in the "),i("RouterLink",{attrs:{to:"/specifications/text/0118-search-api.html#312-filter"}},[i("code",[e._v("filter")])]),e._v(" and "),i("RouterLink",{attrs:{to:"/specifications/text/0118-search-api.html#314-facets"}},[e._v("facets")]),e._v(" search API parameters.")],1),e._v(" "),i("p",[e._v("By default, Meilisearch has no filterable attributes defined.")]),e._v(" "),i("h3",{attrs:{id:"_3-2-global-settings-api-endpoints-definition"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-global-settings-api-endpoints-definition"}},[e._v("#")]),e._v(" 3.2. Global Settings API Endpoints Definition")]),e._v(" "),i("p",[i("code",[e._v("filterableAttributes")]),e._v(" is a sub-resource of "),i("code",[e._v("/indexes/:index_uid/settings")]),e._v(".")]),e._v(" "),i("p",[e._v("See "),i("RouterLink",{attrs:{to:"/specifications/text/0000-settings-api.html"}},[e._v("Settings API")]),e._v(".")],1),e._v(" "),i("h3",{attrs:{id:"_3-3-api-endpoints-definition"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-api-endpoints-definition"}},[e._v("#")]),e._v(" 3.3. API Endpoints Definition")]),e._v(" "),i("p",[e._v("Manipulate the "),i("code",[e._v("filterableAttributes")]),e._v(" setting of a Meilisearch index.")]),e._v(" "),i("h4",{attrs:{id:"_3-3-1-get-indexes-index-uid-settings-filterable-attributes"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-1-get-indexes-index-uid-settings-filterable-attributes"}},[e._v("#")]),e._v(" 3.3.1. "),i("code",[e._v("GET")]),e._v(" - "),i("code",[e._v("indexes/:index_uid/settings/filterable-attributes")])]),e._v(" "),i("p",[e._v("Fetch the "),i("code",[e._v("filterableAttributes")]),e._v(" setting of a Meilisearch index.")]),e._v(" "),i("h5",{attrs:{id:"_3-3-1-1-response-definition"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-1-1-response-definition"}},[e._v("#")]),e._v(" 3.3.1.1. Response Definition")]),e._v(" "),i("ul",[i("li",[e._v("Type: Array of String")]),e._v(" "),i("li",[e._v("Default: "),i("code",[e._v("[]")])])]),e._v(" "),i("h5",{attrs:{id:"_3-3-1-2-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-1-2-errors"}},[e._v("#")]),e._v(" 3.3.1.2. Errors")]),e._v(" "),i("ul",[i("li",[e._v("🔴 Sending an invalid index uid format for the "),i("code",[e._v(":index_uid")]),e._v(" path parameter returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_uid"}},[e._v("invalid_index_uid")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 If the requested "),i("code",[e._v("index_uid")]),e._v(" does not exist, the API returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_not_found"}},[e._v("index_not_found")]),e._v(" error.")],1)]),e._v(" "),i("h4",{attrs:{id:"_3-3-2-put-indexes-index-uid-settings-filterable-attributes"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-put-indexes-index-uid-settings-filterable-attributes"}},[e._v("#")]),e._v(" 3.3.2. "),i("code",[e._v("PUT")]),e._v(" - "),i("code",[e._v("indexes/:index_uid/settings/filterable-attributes")])]),e._v(" "),i("p",[e._v("Modify the "),i("code",[e._v("filterableAttributes")]),e._v(" setting of a Meilisearch index.")]),e._v(" "),i("h5",{attrs:{id:"_3-3-2-1-request-payload-definition"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-1-request-payload-definition"}},[e._v("#")]),e._v(" 3.3.2.1. Request Payload Definition")]),e._v(" "),i("ul",[i("li",[e._v("Type: Array of String / "),i("code",[e._v("null")])])]),e._v(" "),i("p",[e._v("Setting "),i("code",[e._v("null")]),e._v(" is equivalent to using the "),i("a",{attrs:{href:"#333-delete---indexesindexuidsettingsfilterable-attributes"}},[e._v("3.3.3. "),i("code",[e._v("DELETE")]),e._v(" - "),i("code",[e._v("indexes/:index_uid/settings/filterable-attributes")])]),e._v(" API endpoint.")]),e._v(" "),i("p",[e._v("Specifying a document attribute that does not exist as a "),i("code",[e._v("filterableAttributes")]),e._v(" index setting returns no error.")]),e._v(" "),i("h5",{attrs:{id:"_3-3-2-2-response-definition"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-2-response-definition"}},[e._v("#")]),e._v(" 3.3.2.2. Response Definition")]),e._v(" "),i("p",[e._v("When the request is successful, Meilisearch returns the HTTP code "),i("code",[e._v("202 Accepted")]),e._v(". The response's content is the summarized representation of the received asynchronous task.")]),e._v(" "),i("p",[e._v("See "),i("RouterLink",{attrs:{to:"/specifications/text/0060-tasks-api.html#summarized-task-object-for-202-accepted"}},[e._v("Summarized "),i("code",[e._v("task")]),e._v(" Object for "),i("code",[e._v("202 Accepted")])]),e._v(".")],1),e._v(" "),i("h5",{attrs:{id:"_3-3-2-3-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-3-errors"}},[e._v("#")]),e._v(" 3.3.2.3. Errors")]),e._v(" "),i("ul",[i("li",[e._v("🔴 Omitting Content-Type header returns a "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_content_type"}},[e._v("missing_content_type")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending an empty Content-Type returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_content_type"}},[e._v("invalid_content_type")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending a different Content-Type than "),i("code",[e._v("application/json")]),e._v(" returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_content_type"}},[e._v("invalid_content_type")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending an empty payload returns a "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_payload"}},[e._v("missing_payload")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending an invalid JSON payload returns a "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#malformed_payload"}},[e._v("malformed_payload")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending an invalid index uid format for the "),i("code",[e._v(":index_uid")]),e._v(" path parameter returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_uid"}},[e._v("invalid_index_uid")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending a request payload value type different of "),i("code",[e._v("Array of String")]),e._v(", "),i("code",[e._v("[]")]),e._v(", or "),i("code",[e._v("null")]),e._v(" returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_settings_filterable_attributes"}},[e._v("invalid_settings_filterable_attributes")]),e._v(" error.")],1)]),e._v(" "),i("h6",{attrs:{id:"_3-3-2-3-1-async-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-3-1-async-errors"}},[e._v("#")]),e._v(" 3.3.2.3.1. Async Errors")]),e._v(" "),i("ul",[i("li",[e._v("🔴 When Meilisearch is secured, if the API Key do not have the "),i("code",[e._v("indexes.create")]),e._v(" action defined, the API returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_not_found"}},[e._v("index_not_found")]),e._v(" error in the related asynchronous "),i("code",[e._v("task")]),e._v(" resource. See "),i("a",{attrs:{href:"#3222-response-definition"}},[e._v("3.3.2.2. Response Definition")]),e._v(".")],1)]),e._v(" "),i("blockquote",[i("p",[e._v("Otherwise, Meilisearch will create the index in a lazy way. See "),i("a",{attrs:{href:"#3224-lazy-index-creation"}},[e._v("3.2.2.4. Lazy Index Creation")]),e._v(".")])]),e._v(" "),i("h5",{attrs:{id:"_3-3-2-4-lazy-index-creation"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-4-lazy-index-creation"}},[e._v("#")]),e._v(" 3.3.2.4. Lazy Index Creation")]),e._v(" "),i("p",[e._v("If the requested "),i("code",[e._v("index_uid")]),e._v(" does not exist, and the authorization layer allows it (See "),i("a",{attrs:{href:"#33231-async-errors"}},[e._v("3.3.2.3.1. Async Errors")]),e._v("), Meilisearch will create the index when the related asynchronous task resource is executed. See "),i("a",{attrs:{href:"#3322-response-definition"}},[e._v("3.3.2.2. Response Definition")]),e._v(".")]),e._v(" "),i("h4",{attrs:{id:"_3-3-3-delete-indexes-index-uid-settings-filterable-attributes"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-3-delete-indexes-index-uid-settings-filterable-attributes"}},[e._v("#")]),e._v(" 3.3.3. "),i("code",[e._v("DELETE")]),e._v(" - "),i("code",[e._v("indexes/:index_uid/settings/filterable-attributes")])]),e._v(" "),i("p",[e._v("Reset the "),i("code",[e._v("filterableAttributes")]),e._v(" setting of a Meilisearch index to the default value "),i("code",[e._v("[]")]),e._v(".")]),e._v(" "),i("h5",{attrs:{id:"_3-3-3-1-response-definition"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-3-1-response-definition"}},[e._v("#")]),e._v(" 3.3.3.1. Response Definition")]),e._v(" "),i("p",[e._v("When the request is in a successful state, Meilisearch returns the HTTP code "),i("code",[e._v("202 Accepted")]),e._v(". The response's content is the summarized representation of the received asynchronous task.")]),e._v(" "),i("p",[e._v("See "),i("RouterLink",{attrs:{to:"/specifications/text/0060-tasks-api.html#summarized-task-object-for-202-accepted"}},[e._v("Summarized "),i("code",[e._v("task")]),e._v(" Object for "),i("code",[e._v("202 Accepted")])]),e._v(".")],1),e._v(" "),i("h5",{attrs:{id:"_3-3-3-3-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-3-3-errors"}},[e._v("#")]),e._v(" 3.3.3.3. Errors")]),e._v(" "),i("ul",[i("li",[e._v("🔴 Sending an invalid index uid format for the "),i("code",[e._v(":index_uid")]),e._v(" path parameter returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_uid"}},[e._v("invalid_index_uid")]),e._v(" error.")],1)]),e._v(" "),i("h6",{attrs:{id:"_3-3-3-3-1-asynchronous-index-not-found-error"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-3-3-1-asynchronous-index-not-found-error"}},[e._v("#")]),e._v(" 3.3.3.3.1. Asynchronous Index Not Found Error")]),e._v(" "),i("ul",[i("li",[e._v("🔴 If the requested "),i("code",[e._v("index_uid")]),e._v(" does not exist, the API returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_not_found"}},[e._v("index_not_found")]),e._v(" error in the related async "),i("code",[e._v("task")]),e._v(" resource. See "),i("a",{attrs:{href:"#3331-response-definition"}},[e._v("3.3.3.1. Response Definition")]),e._v(".")],1)]),e._v(" "),i("h4",{attrs:{id:"_3-3-4-general-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-4-general-errors"}},[e._v("#")]),e._v(" 3.3.4. General Errors")]),e._v(" "),i("p",[e._v("These errors apply to all endpoints described here.")]),e._v(" "),i("h5",{attrs:{id:"_3-3-4-1-auth-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-4-1-auth-errors"}},[e._v("#")]),e._v(" 3.3.4.1 Auth Errors")]),e._v(" "),i("p",[e._v("The auth layer can return the following errors if Meilisearch is secured (a master-key is defined).")]),e._v(" "),i("ul",[i("li",[e._v("🔴 Accessing this route without the "),i("code",[e._v("Authorization")]),e._v(" header returns a "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_authorization_header"}},[e._v("missing_authorization_header")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Accessing this route with a key that does not have permissions (i.e. other than the master-key) returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key"}},[e._v("invalid_api_key")]),e._v(" error.")],1)]),e._v(" "),i("h2",{attrs:{id:"_4-technical-details"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_4-technical-details"}},[e._v("#")]),e._v(" 4. Technical Details")]),e._v(" "),i("h3",{attrs:{id:"_4-1-triggering-documents-re-indexing"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-triggering-documents-re-indexing"}},[e._v("#")]),e._v(" 4.1. Triggering Documents Re-Indexing")]),e._v(" "),i("p",[e._v("Meilisearch favors search speed and makes a trade-off on indexing speed by computing internal data structures to get search results as fast as possible.")]),e._v(" "),i("p",[e._v("Modifying this index setting cause documents to be re-indexed.")]),e._v(" "),i("h2",{attrs:{id:"_5-future-possibilities"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_5-future-possibilities"}},[e._v("#")]),e._v(" 5. Future Possibilities")]),e._v(" "),i("p",[e._v("n/a")])])}),[],!1,null,null,null);t.default=a.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[39],{463:function(e,t,i){"use strict";i.r(t);var r=i(62),a=Object(r.a)({},(function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[i("h1",{attrs:{id:"filterable-attributes-setting-api"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#filterable-attributes-setting-api"}},[e._v("#")]),e._v(" Filterable Attributes Setting API")]),e._v(" "),i("h2",{attrs:{id:"_1-summary"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_1-summary"}},[e._v("#")]),e._v(" 1. Summary")]),e._v(" "),i("p",[e._v("This specification describes the "),i("code",[e._v("filterableAttributes")]),e._v(" index setting API endpoints.")]),e._v(" "),i("h2",{attrs:{id:"_2-motivation"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_2-motivation"}},[e._v("#")]),e._v(" 2. Motivation")]),e._v(" "),i("p",[e._v("N/A")]),e._v(" "),i("h2",{attrs:{id:"_3-functional-specification"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-functional-specification"}},[e._v("#")]),e._v(" 3. Functional Specification")]),e._v(" "),i("h3",{attrs:{id:"_3-1-explanations"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-explanations"}},[e._v("#")]),e._v(" 3.1. Explanations")]),e._v(" "),i("p",[i("code",[e._v("filterableAttributes")]),e._v(" setting allows to configure the document fields usable as filter criteria and as facets.")]),e._v(" "),i("p",[e._v("Filters have several use-cases, such as restricting the results a specific user has access to or creating faceted search interfaces. Faceted search interfaces are particularly efficient in helping users navigate a great number of results across many broad categories.")]),e._v(" "),i("p",[i("code",[e._v("filterableAttributes")]),e._v(" need to be properly processed and prepared by Meilisearch before they can be used at search time. Fields defined as "),i("code",[e._v("filterableAttributes")]),e._v(" are usable in the "),i("RouterLink",{attrs:{to:"/specifications/text/0118-search-api.html#312-filter"}},[i("code",[e._v("filter")])]),e._v(" and "),i("RouterLink",{attrs:{to:"/specifications/text/0118-search-api.html#314-facets"}},[e._v("facets")]),e._v(" search API parameters.")],1),e._v(" "),i("p",[e._v("By default, Meilisearch has no filterable attributes defined.")]),e._v(" "),i("h3",{attrs:{id:"_3-2-global-settings-api-endpoints-definition"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-global-settings-api-endpoints-definition"}},[e._v("#")]),e._v(" 3.2. Global Settings API Endpoints Definition")]),e._v(" "),i("p",[i("code",[e._v("filterableAttributes")]),e._v(" is a sub-resource of "),i("code",[e._v("/indexes/:index_uid/settings")]),e._v(".")]),e._v(" "),i("p",[e._v("See "),i("RouterLink",{attrs:{to:"/specifications/text/0000-settings-api.html"}},[e._v("Settings API")]),e._v(".")],1),e._v(" "),i("h3",{attrs:{id:"_3-3-api-endpoints-definition"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-api-endpoints-definition"}},[e._v("#")]),e._v(" 3.3. API Endpoints Definition")]),e._v(" "),i("p",[e._v("Manipulate the "),i("code",[e._v("filterableAttributes")]),e._v(" setting of a Meilisearch index.")]),e._v(" "),i("h4",{attrs:{id:"_3-3-1-get-indexes-index-uid-settings-filterable-attributes"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-1-get-indexes-index-uid-settings-filterable-attributes"}},[e._v("#")]),e._v(" 3.3.1. "),i("code",[e._v("GET")]),e._v(" - "),i("code",[e._v("indexes/:index_uid/settings/filterable-attributes")])]),e._v(" "),i("p",[e._v("Fetch the "),i("code",[e._v("filterableAttributes")]),e._v(" setting of a Meilisearch index.")]),e._v(" "),i("h5",{attrs:{id:"_3-3-1-1-response-definition"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-1-1-response-definition"}},[e._v("#")]),e._v(" 3.3.1.1. Response Definition")]),e._v(" "),i("ul",[i("li",[e._v("Type: Array of String")]),e._v(" "),i("li",[e._v("Default: "),i("code",[e._v("[]")])])]),e._v(" "),i("h5",{attrs:{id:"_3-3-1-2-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-1-2-errors"}},[e._v("#")]),e._v(" 3.3.1.2. Errors")]),e._v(" "),i("ul",[i("li",[e._v("🔴 Sending an invalid index uid format for the "),i("code",[e._v(":index_uid")]),e._v(" path parameter returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_uid"}},[e._v("invalid_index_uid")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 If the requested "),i("code",[e._v("index_uid")]),e._v(" does not exist, the API returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_not_found"}},[e._v("index_not_found")]),e._v(" error.")],1)]),e._v(" "),i("h4",{attrs:{id:"_3-3-2-put-indexes-index-uid-settings-filterable-attributes"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-put-indexes-index-uid-settings-filterable-attributes"}},[e._v("#")]),e._v(" 3.3.2. "),i("code",[e._v("PUT")]),e._v(" - "),i("code",[e._v("indexes/:index_uid/settings/filterable-attributes")])]),e._v(" "),i("p",[e._v("Modify the "),i("code",[e._v("filterableAttributes")]),e._v(" setting of a Meilisearch index.")]),e._v(" "),i("h5",{attrs:{id:"_3-3-2-1-request-payload-definition"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-1-request-payload-definition"}},[e._v("#")]),e._v(" 3.3.2.1. Request Payload Definition")]),e._v(" "),i("ul",[i("li",[e._v("Type: Array of String / "),i("code",[e._v("null")])])]),e._v(" "),i("p",[e._v("Setting "),i("code",[e._v("null")]),e._v(" is equivalent to using the "),i("a",{attrs:{href:"#333-delete---indexesindexuidsettingsfilterable-attributes"}},[e._v("3.3.3. "),i("code",[e._v("DELETE")]),e._v(" - "),i("code",[e._v("indexes/:index_uid/settings/filterable-attributes")])]),e._v(" API endpoint.")]),e._v(" "),i("p",[e._v("Specifying a document attribute that does not exist as a "),i("code",[e._v("filterableAttributes")]),e._v(" index setting returns no error.")]),e._v(" "),i("h5",{attrs:{id:"_3-3-2-2-response-definition"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-2-response-definition"}},[e._v("#")]),e._v(" 3.3.2.2. Response Definition")]),e._v(" "),i("p",[e._v("When the request is successful, Meilisearch returns the HTTP code "),i("code",[e._v("202 Accepted")]),e._v(". The response's content is the summarized representation of the received asynchronous task.")]),e._v(" "),i("p",[e._v("See "),i("RouterLink",{attrs:{to:"/specifications/text/0060-tasks-api.html#summarized-task-object-for-202-accepted"}},[e._v("Summarized "),i("code",[e._v("task")]),e._v(" Object for "),i("code",[e._v("202 Accepted")])]),e._v(".")],1),e._v(" "),i("h5",{attrs:{id:"_3-3-2-3-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-3-errors"}},[e._v("#")]),e._v(" 3.3.2.3. Errors")]),e._v(" "),i("ul",[i("li",[e._v("🔴 Omitting Content-Type header returns a "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_content_type"}},[e._v("missing_content_type")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending an empty Content-Type returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_content_type"}},[e._v("invalid_content_type")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending a different Content-Type than "),i("code",[e._v("application/json")]),e._v(" returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_content_type"}},[e._v("invalid_content_type")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending an empty payload returns a "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_payload"}},[e._v("missing_payload")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending an invalid JSON payload returns a "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#malformed_payload"}},[e._v("malformed_payload")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending an invalid index uid format for the "),i("code",[e._v(":index_uid")]),e._v(" path parameter returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_uid"}},[e._v("invalid_index_uid")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending a request payload value type different of "),i("code",[e._v("Array of String")]),e._v(", "),i("code",[e._v("[]")]),e._v(", or "),i("code",[e._v("null")]),e._v(" returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_settings_filterable_attributes"}},[e._v("invalid_settings_filterable_attributes")]),e._v(" error.")],1)]),e._v(" "),i("h6",{attrs:{id:"_3-3-2-3-1-async-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-3-1-async-errors"}},[e._v("#")]),e._v(" 3.3.2.3.1. Async Errors")]),e._v(" "),i("ul",[i("li",[e._v("🔴 When Meilisearch is secured, if the API Key do not have the "),i("code",[e._v("indexes.create")]),e._v(" action defined, the API returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_not_found"}},[e._v("index_not_found")]),e._v(" error in the related asynchronous "),i("code",[e._v("task")]),e._v(" resource. See "),i("a",{attrs:{href:"#3222-response-definition"}},[e._v("3.3.2.2. Response Definition")]),e._v(".")],1)]),e._v(" "),i("blockquote",[i("p",[e._v("Otherwise, Meilisearch will create the index in a lazy way. See "),i("a",{attrs:{href:"#3224-lazy-index-creation"}},[e._v("3.2.2.4. Lazy Index Creation")]),e._v(".")])]),e._v(" "),i("h5",{attrs:{id:"_3-3-2-4-lazy-index-creation"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-4-lazy-index-creation"}},[e._v("#")]),e._v(" 3.3.2.4. Lazy Index Creation")]),e._v(" "),i("p",[e._v("If the requested "),i("code",[e._v("index_uid")]),e._v(" does not exist, and the authorization layer allows it (See "),i("a",{attrs:{href:"#33231-async-errors"}},[e._v("3.3.2.3.1. Async Errors")]),e._v("), Meilisearch will create the index when the related asynchronous task resource is executed. See "),i("a",{attrs:{href:"#3322-response-definition"}},[e._v("3.3.2.2. Response Definition")]),e._v(".")]),e._v(" "),i("h4",{attrs:{id:"_3-3-3-delete-indexes-index-uid-settings-filterable-attributes"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-3-delete-indexes-index-uid-settings-filterable-attributes"}},[e._v("#")]),e._v(" 3.3.3. "),i("code",[e._v("DELETE")]),e._v(" - "),i("code",[e._v("indexes/:index_uid/settings/filterable-attributes")])]),e._v(" "),i("p",[e._v("Reset the "),i("code",[e._v("filterableAttributes")]),e._v(" setting of a Meilisearch index to the default value "),i("code",[e._v("[]")]),e._v(".")]),e._v(" "),i("h5",{attrs:{id:"_3-3-3-1-response-definition"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-3-1-response-definition"}},[e._v("#")]),e._v(" 3.3.3.1. Response Definition")]),e._v(" "),i("p",[e._v("When the request is in a successful state, Meilisearch returns the HTTP code "),i("code",[e._v("202 Accepted")]),e._v(". The response's content is the summarized representation of the received asynchronous task.")]),e._v(" "),i("p",[e._v("See "),i("RouterLink",{attrs:{to:"/specifications/text/0060-tasks-api.html#summarized-task-object-for-202-accepted"}},[e._v("Summarized "),i("code",[e._v("task")]),e._v(" Object for "),i("code",[e._v("202 Accepted")])]),e._v(".")],1),e._v(" "),i("h5",{attrs:{id:"_3-3-3-3-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-3-3-errors"}},[e._v("#")]),e._v(" 3.3.3.3. Errors")]),e._v(" "),i("ul",[i("li",[e._v("🔴 Sending an invalid index uid format for the "),i("code",[e._v(":index_uid")]),e._v(" path parameter returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_uid"}},[e._v("invalid_index_uid")]),e._v(" error.")],1)]),e._v(" "),i("h6",{attrs:{id:"_3-3-3-3-1-asynchronous-index-not-found-error"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-3-3-1-asynchronous-index-not-found-error"}},[e._v("#")]),e._v(" 3.3.3.3.1. Asynchronous Index Not Found Error")]),e._v(" "),i("ul",[i("li",[e._v("🔴 If the requested "),i("code",[e._v("index_uid")]),e._v(" does not exist, the API returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_not_found"}},[e._v("index_not_found")]),e._v(" error in the related async "),i("code",[e._v("task")]),e._v(" resource. See "),i("a",{attrs:{href:"#3331-response-definition"}},[e._v("3.3.3.1. Response Definition")]),e._v(".")],1)]),e._v(" "),i("h4",{attrs:{id:"_3-3-4-general-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-4-general-errors"}},[e._v("#")]),e._v(" 3.3.4. General Errors")]),e._v(" "),i("p",[e._v("These errors apply to all endpoints described here.")]),e._v(" "),i("h5",{attrs:{id:"_3-3-4-1-auth-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-4-1-auth-errors"}},[e._v("#")]),e._v(" 3.3.4.1 Auth Errors")]),e._v(" "),i("p",[e._v("The auth layer can return the following errors if Meilisearch is secured (a master-key is defined).")]),e._v(" "),i("ul",[i("li",[e._v("🔴 Accessing this route without the "),i("code",[e._v("Authorization")]),e._v(" header returns a "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_authorization_header"}},[e._v("missing_authorization_header")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Accessing this route with a key that does not have permissions (i.e. other than the master-key) returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key"}},[e._v("invalid_api_key")]),e._v(" error.")],1)]),e._v(" "),i("h2",{attrs:{id:"_4-technical-details"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_4-technical-details"}},[e._v("#")]),e._v(" 4. Technical Details")]),e._v(" "),i("h3",{attrs:{id:"_4-1-triggering-documents-re-indexing"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-triggering-documents-re-indexing"}},[e._v("#")]),e._v(" 4.1. Triggering Documents Re-Indexing")]),e._v(" "),i("p",[e._v("Meilisearch favors search speed and makes a trade-off on indexing speed by computing internal data structures to get search results as fast as possible.")]),e._v(" "),i("p",[e._v("Modifying this index setting cause documents to be re-indexed.")]),e._v(" "),i("h2",{attrs:{id:"_5-future-possibilities"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_5-future-possibilities"}},[e._v("#")]),e._v(" 5. Future Possibilities")]),e._v(" "),i("p",[e._v("n/a")])])}),[],!1,null,null,null);t.default=a.exports}}]); \ No newline at end of file diff --git a/docs/assets/js/4.f57bbccf.js b/docs/assets/js/4.aaee11b0.js similarity index 50% rename from docs/assets/js/4.f57bbccf.js rename to docs/assets/js/4.aaee11b0.js index 5c104e225..c95d4efdc 100644 --- a/docs/assets/js/4.f57bbccf.js +++ b/docs/assets/js/4.aaee11b0.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{386:function(t,e,n){},424:function(t,e,n){"use strict";n(386)},493:function(t,e,n){"use strict";n.r(e);var i={functional:!0,props:{type:{type:String,default:"tip"},text:String,vertical:{type:String,default:"top"}},render:function(t,e){var n=e.props,i=e.slots;return t("span",{class:["badge",n.type],style:{verticalAlign:n.vertical}},n.text||i().default)}},r=(n(424),n(62)),p=Object(r.a)(i,void 0,void 0,!1,null,"15b7b770",null);e.default=p.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{385:function(t,e,n){},423:function(t,e,n){"use strict";n(385)},493:function(t,e,n){"use strict";n.r(e);var i={functional:!0,props:{type:{type:String,default:"tip"},text:String,vertical:{type:String,default:"top"}},render:function(t,e){var n=e.props,i=e.slots;return t("span",{class:["badge",n.type],style:{verticalAlign:n.vertical}},n.text||i().default)}},r=(n(423),n(62)),p=Object(r.a)(i,void 0,void 0,!1,null,"15b7b770",null);e.default=p.exports}}]); \ No newline at end of file diff --git a/docs/assets/js/43.af7cbf45.js b/docs/assets/js/43.1901f806.js similarity index 99% rename from docs/assets/js/43.af7cbf45.js rename to docs/assets/js/43.1901f806.js index 62d8c92ef..7218b5d6b 100644 --- a/docs/assets/js/43.af7cbf45.js +++ b/docs/assets/js/43.1901f806.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[43],{467:function(e,t,s){"use strict";s.r(t);var a=s(62),i=Object(a.a)({},(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[s("h1",{attrs:{id:"separators-setting-api"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#separators-setting-api"}},[e._v("#")]),e._v(" Separators Setting API")]),e._v(" "),s("h2",{attrs:{id:"_1-summary"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-summary"}},[e._v("#")]),e._v(" 1. Summary")]),e._v(" "),s("p",[e._v("This specification describes the "),s("code",[e._v("separatorTokens")]),e._v(" and "),s("code",[e._v("nonSeparatorTokens")]),e._v(" index setting API endpoints.")]),e._v(" "),s("h2",{attrs:{id:"_2-motivation"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-motivation"}},[e._v("#")]),e._v(" 2. Motivation")]),e._v(" "),s("p",[e._v("N/A")]),e._v(" "),s("h2",{attrs:{id:"_3-functional-specification"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-functional-specification"}},[e._v("#")]),e._v(" 3. Functional Specification")]),e._v(" "),s("h3",{attrs:{id:"_3-1-explanations"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-explanations"}},[e._v("#")]),e._v(" 3.1. Explanations")]),e._v(" "),s("h4",{attrs:{id:"_3-1-1-usage-examples"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-1-usage-examples"}},[e._v("#")]),e._v(" 3.1.1. Usage Examples")]),e._v(" "),s("p",[s("em",[s("strong",[e._v("Request payload "),s("code",[e._v("PUT")]),e._v("- "),s("code",[e._v("/indexes/articles/settings/separator-tokens")])])])]),e._v(" "),s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),s("span",{pre:!0,attrs:{class:"token string"}},[e._v('"|"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[e._v('"/"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[e._v('"&sep"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n")])])]),s("p",[s("em",[s("strong",[e._v("Request payload "),s("code",[e._v("PUT")]),e._v("- "),s("code",[e._v("/indexes/articles/settings/non-separator-tokens")])])])]),e._v(" "),s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),s("span",{pre:!0,attrs:{class:"token string"}},[e._v('"@"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[e._v('"#"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n")])])]),s("h3",{attrs:{id:"_3-2-global-settings-api-endpoints-definition"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-global-settings-api-endpoints-definition"}},[e._v("#")]),e._v(" 3.2. Global Settings API Endpoints Definition")]),e._v(" "),s("p",[s("code",[e._v("separatorTokens")]),e._v(" and "),s("code",[e._v("nonSeparatorTokens")]),e._v(" are sub-resources of "),s("code",[e._v("/indexes/:index_uid/settings")]),e._v(".")]),e._v(" "),s("p",[e._v("See "),s("RouterLink",{attrs:{to:"/specifications/text/0123-settings-api.html"}},[e._v("Settings API")]),e._v(".")],1),e._v(" "),s("h3",{attrs:{id:"_3-3-api-endpoints-definition"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-api-endpoints-definition"}},[e._v("#")]),e._v(" 3.3. API Endpoints Definition")]),e._v(" "),s("p",[e._v("Manipulate the "),s("code",[e._v("separatorTokens")]),e._v(" and "),s("code",[e._v("nonSeparatorTokens")]),e._v(" settings of a Meilisearch index.")]),e._v(" "),s("h4",{attrs:{id:"_3-3-1-get"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-1-get"}},[e._v("#")]),e._v(" 3.3.1. "),s("code",[e._v("GET")])]),e._v(" "),s("h5",{attrs:{id:"_3-3-1-1-get-indexes-index-uid-settings-separator-tokens"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-1-1-get-indexes-index-uid-settings-separator-tokens"}},[e._v("#")]),e._v(" 3.3.1.1. "),s("code",[e._v("GET")]),e._v(" - "),s("code",[e._v("indexes/:index_uid/settings/separator-tokens")])]),e._v(" "),s("p",[e._v("Fetch the "),s("code",[e._v("separatorTokens")]),e._v(" setting of a Meilisearch index.")]),e._v(" "),s("p",[s("em",[s("strong",[e._v("Response Definition:")])])]),e._v(" "),s("ul",[s("li",[e._v("Type: Array of String")]),e._v(" "),s("li",[e._v("Default: "),s("code",[e._v("[]")])])]),e._v(" "),s("h5",{attrs:{id:"_3-3-1-2-get-indexes-index-uid-settings-non-separator-tokens"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-1-2-get-indexes-index-uid-settings-non-separator-tokens"}},[e._v("#")]),e._v(" 3.3.1.2. "),s("code",[e._v("GET")]),e._v(" - "),s("code",[e._v("indexes/:index_uid/settings/non-separator-tokens")])]),e._v(" "),s("p",[e._v("Fetch the "),s("code",[e._v("nonSeparatorTokens")]),e._v(" setting of a Meilisearch index.")]),e._v(" "),s("p",[s("em",[s("strong",[e._v("Response Definition:")])])]),e._v(" "),s("ul",[s("li",[e._v("Type: Array of String")]),e._v(" "),s("li",[e._v("Default: "),s("code",[e._v("[]")])])]),e._v(" "),s("h5",{attrs:{id:"_3-3-1-3-errors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-1-3-errors"}},[e._v("#")]),e._v(" 3.3.1.3. Errors")]),e._v(" "),s("ul",[s("li",[e._v("🔴 Sending an invalid index uid format for the "),s("code",[e._v(":index_uid")]),e._v(" path parameter returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_uid"}},[e._v("invalid_index_uid")]),e._v(" error.")],1),e._v(" "),s("li",[e._v("🔴 If the requested "),s("code",[e._v("index_uid")]),e._v(" does not exist, the API returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_not_found"}},[e._v("index_not_found")]),e._v(" error.")],1)]),e._v(" "),s("h4",{attrs:{id:"_3-3-2-put"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-put"}},[e._v("#")]),e._v(" 3.3.2. "),s("code",[e._v("PUT")])]),e._v(" "),s("h5",{attrs:{id:"_3-3-2-1-put-indexes-index-uid-settings-separator-tokens"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-1-put-indexes-index-uid-settings-separator-tokens"}},[e._v("#")]),e._v(" 3.3.2.1. "),s("code",[e._v("PUT")]),e._v(" - "),s("code",[e._v("indexes/:index_uid/settings/separator-tokens")])]),e._v(" "),s("p",[e._v("Modify the "),s("code",[e._v("separatorTokens")]),e._v(" setting of a Meilisearch index.")]),e._v(" "),s("h6",{attrs:{id:"_3-3-2-1-1-request-payload-definition"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-1-1-request-payload-definition"}},[e._v("#")]),e._v(" 3.3.2.1.1. Request Payload Definition")]),e._v(" "),s("ul",[s("li",[e._v("Type: Array of String / "),s("code",[e._v("null")])])]),e._v(" "),s("p",[e._v("Setting "),s("code",[e._v("null")]),e._v(" is equivalent to using the "),s("a",{attrs:{href:"#3331-delete---indexesindexuidsettingsseparator-tokens"}},[e._v("3.3.3.1. "),s("code",[e._v("DELETE")]),e._v(" - "),s("code",[e._v("indexes/:index_uid/settings/separator-tokens")])]),e._v(" API endpoint.")]),e._v(" "),s("h6",{attrs:{id:"_3-3-2-1-2-response-definition"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-1-2-response-definition"}},[e._v("#")]),e._v(" 3.3.2.1.2. Response Definition")]),e._v(" "),s("p",[e._v("When the request is successful, Meilisearch returns the HTTP code "),s("code",[e._v("202 Accepted")]),e._v(". The response's content is the summarized representation of the received asynchronous task.")]),e._v(" "),s("p",[e._v("See "),s("RouterLink",{attrs:{to:"/specifications/text/0060-tasks-api.html#summarized-task-object-for-202-accepted"}},[e._v("Summarized "),s("code",[e._v("task")]),e._v(" Object for "),s("code",[e._v("202 Accepted")])]),e._v(".")],1),e._v(" "),s("h5",{attrs:{id:"_3-3-2-2-put-indexes-index-uid-settings-non-separator-tokens"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-2-put-indexes-index-uid-settings-non-separator-tokens"}},[e._v("#")]),e._v(" 3.3.2.2. "),s("code",[e._v("PUT")]),e._v(" - "),s("code",[e._v("indexes/:index_uid/settings/non-separator-tokens")])]),e._v(" "),s("p",[e._v("Modify the "),s("code",[e._v("nonSeparatorTokens")]),e._v(" setting of a Meilisearch index.")]),e._v(" "),s("h6",{attrs:{id:"_3-3-2-2-1-request-payload-definition"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-2-1-request-payload-definition"}},[e._v("#")]),e._v(" 3.3.2.2.1. Request Payload Definition")]),e._v(" "),s("ul",[s("li",[e._v("Type: Array of String / "),s("code",[e._v("null")])])]),e._v(" "),s("p",[e._v("Setting "),s("code",[e._v("null")]),e._v(" is equivalent to using the "),s("a",{attrs:{href:"#3332-delete---indexesindexuidsettingsnon-separator-tokens"}},[e._v("3.3.3.2. "),s("code",[e._v("DELETE")]),e._v(" - "),s("code",[e._v("indexes/:index_uid/settings/non-separator-tokens")])]),e._v(" API endpoint.")]),e._v(" "),s("h6",{attrs:{id:"_3-3-2-2-2-response-definition"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-2-2-response-definition"}},[e._v("#")]),e._v(" 3.3.2.2.2. Response Definition")]),e._v(" "),s("p",[e._v("When the request is successful, Meilisearch returns the HTTP code "),s("code",[e._v("202 Accepted")]),e._v(". The response's content is the summarized representation of the received asynchronous task.")]),e._v(" "),s("p",[e._v("See "),s("RouterLink",{attrs:{to:"/specifications/text/0060-tasks-api.html#summarized-task-object-for-202-accepted"}},[e._v("Summarized "),s("code",[e._v("task")]),e._v(" Object for "),s("code",[e._v("202 Accepted")])]),e._v(".")],1),e._v(" "),s("h5",{attrs:{id:"_3-3-2-3-errors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-3-errors"}},[e._v("#")]),e._v(" 3.3.2.3. Errors")]),e._v(" "),s("ul",[s("li",[e._v("🔴 Omitting Content-Type header returns a "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_content_type"}},[e._v("missing_content_type")]),e._v(" error.")],1),e._v(" "),s("li",[e._v("🔴 Sending an empty Content-Type returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_content_type"}},[e._v("invalid_content_type")]),e._v(" error.")],1),e._v(" "),s("li",[e._v("🔴 Sending a different Content-Type than "),s("code",[e._v("application/json")]),e._v(" returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_content_type"}},[e._v("invalid_content_type")]),e._v(" error.")],1),e._v(" "),s("li",[e._v("🔴 Sending an empty payload returns a "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_payload"}},[e._v("missing_payload")]),e._v(" error.")],1),e._v(" "),s("li",[e._v("🔴 Sending an invalid JSON payload returns a "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#malformed_payload"}},[e._v("malformed_payload")]),e._v(" error.")],1),e._v(" "),s("li",[e._v("🔴 Sending an invalid index uid format for the "),s("code",[e._v(":index_uid")]),e._v(" path parameter returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_uid"}},[e._v("invalid_index_uid")]),e._v(" error.")],1),e._v(" "),s("li",[e._v("🔴 Sending a request payload value type different of "),s("code",[e._v("Array of String")]),e._v(", "),s("code",[e._v("[]")]),e._v(", or "),s("code",[e._v("null")]),e._v(" returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_settings_stop_words"}},[e._v("invalid_settings_stop_words")]),e._v(" error.")],1)]),e._v(" "),s("h6",{attrs:{id:"_3-3-2-3-1-async-errors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-3-1-async-errors"}},[e._v("#")]),e._v(" 3.3.2.3.1. Async Errors")]),e._v(" "),s("ul",[s("li",[e._v("🔴 When Meilisearch is secured, if the API Key do not have the "),s("code",[e._v("indexes.create")]),e._v(" action defined, the API returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_not_found"}},[e._v("index_not_found")]),e._v(" error in the related asynchronous "),s("code",[e._v("task")]),e._v(" resource. See "),s("a",{attrs:{href:"#3222-response-definition"}},[e._v("3.3.2.2. Response Definition")]),e._v(".")],1)]),e._v(" "),s("blockquote",[s("p",[e._v("Otherwise, Meilisearch will create the index in a lazy way. See "),s("a",{attrs:{href:"#3224-lazy-index-creation"}},[e._v("3.2.2.4. Lazy Index Creation")]),e._v(".")])]),e._v(" "),s("h5",{attrs:{id:"_3-3-2-4-lazy-index-creation"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-4-lazy-index-creation"}},[e._v("#")]),e._v(" 3.3.2.4. Lazy Index Creation")]),e._v(" "),s("p",[e._v("If the requested "),s("code",[e._v("index_uid")]),e._v(" does not exist, and the authorization layer allows it (See "),s("a",{attrs:{href:"#33231-async-errors"}},[e._v("3.3.2.3.1. Async Errors")]),e._v("), Meilisearch will create the index when the related asynchronous task resource is executed. See "),s("a",{attrs:{href:"#3322-response-definition"}},[e._v("3.3.2.2. Response Definition")]),e._v(".")]),e._v(" "),s("h4",{attrs:{id:"_3-3-3-delete"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-3-delete"}},[e._v("#")]),e._v(" 3.3.3. "),s("code",[e._v("DELETE")])]),e._v(" "),s("h5",{attrs:{id:"_3-3-3-1-delete-indexes-index-uid-settings-separator-tokens"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-3-1-delete-indexes-index-uid-settings-separator-tokens"}},[e._v("#")]),e._v(" 3.3.3.1 "),s("code",[e._v("DELETE")]),e._v(" - "),s("code",[e._v("indexes/:index_uid/settings/separator-tokens")])]),e._v(" "),s("p",[e._v("Reset the "),s("code",[e._v("separatorTokens")]),e._v(" setting of a Meilisearch index to the default value "),s("code",[e._v("[]")]),e._v(".")]),e._v(" "),s("h6",{attrs:{id:"_3-3-3-1-1-response-definition"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-3-1-1-response-definition"}},[e._v("#")]),e._v(" 3.3.3.1.1. Response Definition")]),e._v(" "),s("p",[e._v("When the request is in a successful state, Meilisearch returns the HTTP code "),s("code",[e._v("202 Accepted")]),e._v(". The response's content is the summarized representation of the received asynchronous task.")]),e._v(" "),s("p",[e._v("See "),s("RouterLink",{attrs:{to:"/specifications/text/0060-tasks-api.html#summarized-task-object-for-202-accepted"}},[e._v("Summarized "),s("code",[e._v("task")]),e._v(" Object for "),s("code",[e._v("202 Accepted")])]),e._v(".")],1),e._v(" "),s("h5",{attrs:{id:"_3-3-3-2-delete-indexes-index-uid-settings-non-separator-tokens"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-3-2-delete-indexes-index-uid-settings-non-separator-tokens"}},[e._v("#")]),e._v(" 3.3.3.2 "),s("code",[e._v("DELETE")]),e._v(" - "),s("code",[e._v("indexes/:index_uid/settings/non-separator-tokens")])]),e._v(" "),s("p",[e._v("Reset the "),s("code",[e._v("nonSeparatorTokens")]),e._v(" setting of a Meilisearch index to the default value "),s("code",[e._v("[]")]),e._v(".")]),e._v(" "),s("h6",{attrs:{id:"_3-3-3-2-1-response-definition"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-3-2-1-response-definition"}},[e._v("#")]),e._v(" 3.3.3.2.1. Response Definition")]),e._v(" "),s("p",[e._v("When the request is in a successful state, Meilisearch returns the HTTP code "),s("code",[e._v("202 Accepted")]),e._v(". The response's content is the summarized representation of the received asynchronous task.")]),e._v(" "),s("p",[e._v("See "),s("RouterLink",{attrs:{to:"/specifications/text/0060-tasks-api.html#summarized-task-object-for-202-accepted"}},[e._v("Summarized "),s("code",[e._v("task")]),e._v(" Object for "),s("code",[e._v("202 Accepted")])]),e._v(".")],1),e._v(" "),s("h5",{attrs:{id:"_3-3-3-3-errors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-3-3-errors"}},[e._v("#")]),e._v(" 3.3.3.3. Errors")]),e._v(" "),s("ul",[s("li",[e._v("🔴 Sending an invalid index uid format for the "),s("code",[e._v(":index_uid")]),e._v(" path parameter returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_uid"}},[e._v("invalid_index_uid")]),e._v(" error.")],1)]),e._v(" "),s("h6",{attrs:{id:"_3-3-3-3-1-asynchronous-index-not-found-error"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-3-3-1-asynchronous-index-not-found-error"}},[e._v("#")]),e._v(" 3.3.3.3.1. Asynchronous Index Not Found Error")]),e._v(" "),s("ul",[s("li",[e._v("🔴 If the requested "),s("code",[e._v("index_uid")]),e._v(" does not exist, the API returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_not_found"}},[e._v("index_not_found")]),e._v(" error in the related async "),s("code",[e._v("task")]),e._v(" resource. See "),s("a",{attrs:{href:"#3331-response-definition"}},[e._v("3.3.3.1. Response Definition")]),e._v(".")],1)]),e._v(" "),s("h4",{attrs:{id:"_3-3-4-general-errors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-4-general-errors"}},[e._v("#")]),e._v(" 3.3.4. General Errors")]),e._v(" "),s("p",[e._v("These errors apply to all endpoints described here.")]),e._v(" "),s("h5",{attrs:{id:"_3-3-4-1-auth-errors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-4-1-auth-errors"}},[e._v("#")]),e._v(" 3.3.4.1 Auth Errors")]),e._v(" "),s("p",[e._v("The auth layer can return the following errors if Meilisearch is secured (a master-key is defined).")]),e._v(" "),s("ul",[s("li",[e._v("🔴 Accessing this route without the "),s("code",[e._v("Authorization")]),e._v(" header returns a "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_authorization_header"}},[e._v("missing_authorization_header")]),e._v(" error.")],1),e._v(" "),s("li",[e._v("🔴 Accessing this route with a key that does not have permissions (i.e. other than the master-key) returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key"}},[e._v("invalid_api_key")]),e._v(" error.")],1)]),e._v(" "),s("h2",{attrs:{id:"_4-technical-details"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-technical-details"}},[e._v("#")]),e._v(" 4. Technical Details")]),e._v(" "),s("h3",{attrs:{id:"_4-1-triggering-documents-re-indexing"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-triggering-documents-re-indexing"}},[e._v("#")]),e._v(" 4.1. Triggering Documents Re-Indexing")]),e._v(" "),s("p",[e._v("Meilisearch favors search speed and makes a trade-off on indexing speed by computing internal data structures to get search results as fast as possible.")]),e._v(" "),s("p",[e._v("Modifying this index setting cause documents to be re-indexed.")]),e._v(" "),s("h2",{attrs:{id:"_5-future-possibilities"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_5-future-possibilities"}},[e._v("#")]),e._v(" 5. Future Possibilities")]),e._v(" "),s("p",[e._v("n/a")])])}),[],!1,null,null,null);t.default=i.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[43],{468:function(e,t,s){"use strict";s.r(t);var a=s(62),i=Object(a.a)({},(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[s("h1",{attrs:{id:"separators-setting-api"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#separators-setting-api"}},[e._v("#")]),e._v(" Separators Setting API")]),e._v(" "),s("h2",{attrs:{id:"_1-summary"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-summary"}},[e._v("#")]),e._v(" 1. Summary")]),e._v(" "),s("p",[e._v("This specification describes the "),s("code",[e._v("separatorTokens")]),e._v(" and "),s("code",[e._v("nonSeparatorTokens")]),e._v(" index setting API endpoints.")]),e._v(" "),s("h2",{attrs:{id:"_2-motivation"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-motivation"}},[e._v("#")]),e._v(" 2. Motivation")]),e._v(" "),s("p",[e._v("N/A")]),e._v(" "),s("h2",{attrs:{id:"_3-functional-specification"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-functional-specification"}},[e._v("#")]),e._v(" 3. Functional Specification")]),e._v(" "),s("h3",{attrs:{id:"_3-1-explanations"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-explanations"}},[e._v("#")]),e._v(" 3.1. Explanations")]),e._v(" "),s("h4",{attrs:{id:"_3-1-1-usage-examples"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-1-usage-examples"}},[e._v("#")]),e._v(" 3.1.1. Usage Examples")]),e._v(" "),s("p",[s("em",[s("strong",[e._v("Request payload "),s("code",[e._v("PUT")]),e._v("- "),s("code",[e._v("/indexes/articles/settings/separator-tokens")])])])]),e._v(" "),s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),s("span",{pre:!0,attrs:{class:"token string"}},[e._v('"|"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[e._v('"/"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[e._v('"&sep"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n")])])]),s("p",[s("em",[s("strong",[e._v("Request payload "),s("code",[e._v("PUT")]),e._v("- "),s("code",[e._v("/indexes/articles/settings/non-separator-tokens")])])])]),e._v(" "),s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),s("span",{pre:!0,attrs:{class:"token string"}},[e._v('"@"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[e._v('"#"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n")])])]),s("h3",{attrs:{id:"_3-2-global-settings-api-endpoints-definition"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-global-settings-api-endpoints-definition"}},[e._v("#")]),e._v(" 3.2. Global Settings API Endpoints Definition")]),e._v(" "),s("p",[s("code",[e._v("separatorTokens")]),e._v(" and "),s("code",[e._v("nonSeparatorTokens")]),e._v(" are sub-resources of "),s("code",[e._v("/indexes/:index_uid/settings")]),e._v(".")]),e._v(" "),s("p",[e._v("See "),s("RouterLink",{attrs:{to:"/specifications/text/0123-settings-api.html"}},[e._v("Settings API")]),e._v(".")],1),e._v(" "),s("h3",{attrs:{id:"_3-3-api-endpoints-definition"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-api-endpoints-definition"}},[e._v("#")]),e._v(" 3.3. API Endpoints Definition")]),e._v(" "),s("p",[e._v("Manipulate the "),s("code",[e._v("separatorTokens")]),e._v(" and "),s("code",[e._v("nonSeparatorTokens")]),e._v(" settings of a Meilisearch index.")]),e._v(" "),s("h4",{attrs:{id:"_3-3-1-get"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-1-get"}},[e._v("#")]),e._v(" 3.3.1. "),s("code",[e._v("GET")])]),e._v(" "),s("h5",{attrs:{id:"_3-3-1-1-get-indexes-index-uid-settings-separator-tokens"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-1-1-get-indexes-index-uid-settings-separator-tokens"}},[e._v("#")]),e._v(" 3.3.1.1. "),s("code",[e._v("GET")]),e._v(" - "),s("code",[e._v("indexes/:index_uid/settings/separator-tokens")])]),e._v(" "),s("p",[e._v("Fetch the "),s("code",[e._v("separatorTokens")]),e._v(" setting of a Meilisearch index.")]),e._v(" "),s("p",[s("em",[s("strong",[e._v("Response Definition:")])])]),e._v(" "),s("ul",[s("li",[e._v("Type: Array of String")]),e._v(" "),s("li",[e._v("Default: "),s("code",[e._v("[]")])])]),e._v(" "),s("h5",{attrs:{id:"_3-3-1-2-get-indexes-index-uid-settings-non-separator-tokens"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-1-2-get-indexes-index-uid-settings-non-separator-tokens"}},[e._v("#")]),e._v(" 3.3.1.2. "),s("code",[e._v("GET")]),e._v(" - "),s("code",[e._v("indexes/:index_uid/settings/non-separator-tokens")])]),e._v(" "),s("p",[e._v("Fetch the "),s("code",[e._v("nonSeparatorTokens")]),e._v(" setting of a Meilisearch index.")]),e._v(" "),s("p",[s("em",[s("strong",[e._v("Response Definition:")])])]),e._v(" "),s("ul",[s("li",[e._v("Type: Array of String")]),e._v(" "),s("li",[e._v("Default: "),s("code",[e._v("[]")])])]),e._v(" "),s("h5",{attrs:{id:"_3-3-1-3-errors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-1-3-errors"}},[e._v("#")]),e._v(" 3.3.1.3. Errors")]),e._v(" "),s("ul",[s("li",[e._v("🔴 Sending an invalid index uid format for the "),s("code",[e._v(":index_uid")]),e._v(" path parameter returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_uid"}},[e._v("invalid_index_uid")]),e._v(" error.")],1),e._v(" "),s("li",[e._v("🔴 If the requested "),s("code",[e._v("index_uid")]),e._v(" does not exist, the API returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_not_found"}},[e._v("index_not_found")]),e._v(" error.")],1)]),e._v(" "),s("h4",{attrs:{id:"_3-3-2-put"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-put"}},[e._v("#")]),e._v(" 3.3.2. "),s("code",[e._v("PUT")])]),e._v(" "),s("h5",{attrs:{id:"_3-3-2-1-put-indexes-index-uid-settings-separator-tokens"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-1-put-indexes-index-uid-settings-separator-tokens"}},[e._v("#")]),e._v(" 3.3.2.1. "),s("code",[e._v("PUT")]),e._v(" - "),s("code",[e._v("indexes/:index_uid/settings/separator-tokens")])]),e._v(" "),s("p",[e._v("Modify the "),s("code",[e._v("separatorTokens")]),e._v(" setting of a Meilisearch index.")]),e._v(" "),s("h6",{attrs:{id:"_3-3-2-1-1-request-payload-definition"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-1-1-request-payload-definition"}},[e._v("#")]),e._v(" 3.3.2.1.1. Request Payload Definition")]),e._v(" "),s("ul",[s("li",[e._v("Type: Array of String / "),s("code",[e._v("null")])])]),e._v(" "),s("p",[e._v("Setting "),s("code",[e._v("null")]),e._v(" is equivalent to using the "),s("a",{attrs:{href:"#3331-delete---indexesindexuidsettingsseparator-tokens"}},[e._v("3.3.3.1. "),s("code",[e._v("DELETE")]),e._v(" - "),s("code",[e._v("indexes/:index_uid/settings/separator-tokens")])]),e._v(" API endpoint.")]),e._v(" "),s("h6",{attrs:{id:"_3-3-2-1-2-response-definition"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-1-2-response-definition"}},[e._v("#")]),e._v(" 3.3.2.1.2. Response Definition")]),e._v(" "),s("p",[e._v("When the request is successful, Meilisearch returns the HTTP code "),s("code",[e._v("202 Accepted")]),e._v(". The response's content is the summarized representation of the received asynchronous task.")]),e._v(" "),s("p",[e._v("See "),s("RouterLink",{attrs:{to:"/specifications/text/0060-tasks-api.html#summarized-task-object-for-202-accepted"}},[e._v("Summarized "),s("code",[e._v("task")]),e._v(" Object for "),s("code",[e._v("202 Accepted")])]),e._v(".")],1),e._v(" "),s("h5",{attrs:{id:"_3-3-2-2-put-indexes-index-uid-settings-non-separator-tokens"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-2-put-indexes-index-uid-settings-non-separator-tokens"}},[e._v("#")]),e._v(" 3.3.2.2. "),s("code",[e._v("PUT")]),e._v(" - "),s("code",[e._v("indexes/:index_uid/settings/non-separator-tokens")])]),e._v(" "),s("p",[e._v("Modify the "),s("code",[e._v("nonSeparatorTokens")]),e._v(" setting of a Meilisearch index.")]),e._v(" "),s("h6",{attrs:{id:"_3-3-2-2-1-request-payload-definition"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-2-1-request-payload-definition"}},[e._v("#")]),e._v(" 3.3.2.2.1. Request Payload Definition")]),e._v(" "),s("ul",[s("li",[e._v("Type: Array of String / "),s("code",[e._v("null")])])]),e._v(" "),s("p",[e._v("Setting "),s("code",[e._v("null")]),e._v(" is equivalent to using the "),s("a",{attrs:{href:"#3332-delete---indexesindexuidsettingsnon-separator-tokens"}},[e._v("3.3.3.2. "),s("code",[e._v("DELETE")]),e._v(" - "),s("code",[e._v("indexes/:index_uid/settings/non-separator-tokens")])]),e._v(" API endpoint.")]),e._v(" "),s("h6",{attrs:{id:"_3-3-2-2-2-response-definition"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-2-2-response-definition"}},[e._v("#")]),e._v(" 3.3.2.2.2. Response Definition")]),e._v(" "),s("p",[e._v("When the request is successful, Meilisearch returns the HTTP code "),s("code",[e._v("202 Accepted")]),e._v(". The response's content is the summarized representation of the received asynchronous task.")]),e._v(" "),s("p",[e._v("See "),s("RouterLink",{attrs:{to:"/specifications/text/0060-tasks-api.html#summarized-task-object-for-202-accepted"}},[e._v("Summarized "),s("code",[e._v("task")]),e._v(" Object for "),s("code",[e._v("202 Accepted")])]),e._v(".")],1),e._v(" "),s("h5",{attrs:{id:"_3-3-2-3-errors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-3-errors"}},[e._v("#")]),e._v(" 3.3.2.3. Errors")]),e._v(" "),s("ul",[s("li",[e._v("🔴 Omitting Content-Type header returns a "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_content_type"}},[e._v("missing_content_type")]),e._v(" error.")],1),e._v(" "),s("li",[e._v("🔴 Sending an empty Content-Type returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_content_type"}},[e._v("invalid_content_type")]),e._v(" error.")],1),e._v(" "),s("li",[e._v("🔴 Sending a different Content-Type than "),s("code",[e._v("application/json")]),e._v(" returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_content_type"}},[e._v("invalid_content_type")]),e._v(" error.")],1),e._v(" "),s("li",[e._v("🔴 Sending an empty payload returns a "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_payload"}},[e._v("missing_payload")]),e._v(" error.")],1),e._v(" "),s("li",[e._v("🔴 Sending an invalid JSON payload returns a "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#malformed_payload"}},[e._v("malformed_payload")]),e._v(" error.")],1),e._v(" "),s("li",[e._v("🔴 Sending an invalid index uid format for the "),s("code",[e._v(":index_uid")]),e._v(" path parameter returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_uid"}},[e._v("invalid_index_uid")]),e._v(" error.")],1),e._v(" "),s("li",[e._v("🔴 Sending a request payload value type different of "),s("code",[e._v("Array of String")]),e._v(", "),s("code",[e._v("[]")]),e._v(", or "),s("code",[e._v("null")]),e._v(" returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_settings_stop_words"}},[e._v("invalid_settings_stop_words")]),e._v(" error.")],1)]),e._v(" "),s("h6",{attrs:{id:"_3-3-2-3-1-async-errors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-3-1-async-errors"}},[e._v("#")]),e._v(" 3.3.2.3.1. Async Errors")]),e._v(" "),s("ul",[s("li",[e._v("🔴 When Meilisearch is secured, if the API Key do not have the "),s("code",[e._v("indexes.create")]),e._v(" action defined, the API returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_not_found"}},[e._v("index_not_found")]),e._v(" error in the related asynchronous "),s("code",[e._v("task")]),e._v(" resource. See "),s("a",{attrs:{href:"#3222-response-definition"}},[e._v("3.3.2.2. Response Definition")]),e._v(".")],1)]),e._v(" "),s("blockquote",[s("p",[e._v("Otherwise, Meilisearch will create the index in a lazy way. See "),s("a",{attrs:{href:"#3224-lazy-index-creation"}},[e._v("3.2.2.4. Lazy Index Creation")]),e._v(".")])]),e._v(" "),s("h5",{attrs:{id:"_3-3-2-4-lazy-index-creation"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-4-lazy-index-creation"}},[e._v("#")]),e._v(" 3.3.2.4. Lazy Index Creation")]),e._v(" "),s("p",[e._v("If the requested "),s("code",[e._v("index_uid")]),e._v(" does not exist, and the authorization layer allows it (See "),s("a",{attrs:{href:"#33231-async-errors"}},[e._v("3.3.2.3.1. Async Errors")]),e._v("), Meilisearch will create the index when the related asynchronous task resource is executed. See "),s("a",{attrs:{href:"#3322-response-definition"}},[e._v("3.3.2.2. Response Definition")]),e._v(".")]),e._v(" "),s("h4",{attrs:{id:"_3-3-3-delete"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-3-delete"}},[e._v("#")]),e._v(" 3.3.3. "),s("code",[e._v("DELETE")])]),e._v(" "),s("h5",{attrs:{id:"_3-3-3-1-delete-indexes-index-uid-settings-separator-tokens"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-3-1-delete-indexes-index-uid-settings-separator-tokens"}},[e._v("#")]),e._v(" 3.3.3.1 "),s("code",[e._v("DELETE")]),e._v(" - "),s("code",[e._v("indexes/:index_uid/settings/separator-tokens")])]),e._v(" "),s("p",[e._v("Reset the "),s("code",[e._v("separatorTokens")]),e._v(" setting of a Meilisearch index to the default value "),s("code",[e._v("[]")]),e._v(".")]),e._v(" "),s("h6",{attrs:{id:"_3-3-3-1-1-response-definition"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-3-1-1-response-definition"}},[e._v("#")]),e._v(" 3.3.3.1.1. Response Definition")]),e._v(" "),s("p",[e._v("When the request is in a successful state, Meilisearch returns the HTTP code "),s("code",[e._v("202 Accepted")]),e._v(". The response's content is the summarized representation of the received asynchronous task.")]),e._v(" "),s("p",[e._v("See "),s("RouterLink",{attrs:{to:"/specifications/text/0060-tasks-api.html#summarized-task-object-for-202-accepted"}},[e._v("Summarized "),s("code",[e._v("task")]),e._v(" Object for "),s("code",[e._v("202 Accepted")])]),e._v(".")],1),e._v(" "),s("h5",{attrs:{id:"_3-3-3-2-delete-indexes-index-uid-settings-non-separator-tokens"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-3-2-delete-indexes-index-uid-settings-non-separator-tokens"}},[e._v("#")]),e._v(" 3.3.3.2 "),s("code",[e._v("DELETE")]),e._v(" - "),s("code",[e._v("indexes/:index_uid/settings/non-separator-tokens")])]),e._v(" "),s("p",[e._v("Reset the "),s("code",[e._v("nonSeparatorTokens")]),e._v(" setting of a Meilisearch index to the default value "),s("code",[e._v("[]")]),e._v(".")]),e._v(" "),s("h6",{attrs:{id:"_3-3-3-2-1-response-definition"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-3-2-1-response-definition"}},[e._v("#")]),e._v(" 3.3.3.2.1. Response Definition")]),e._v(" "),s("p",[e._v("When the request is in a successful state, Meilisearch returns the HTTP code "),s("code",[e._v("202 Accepted")]),e._v(". The response's content is the summarized representation of the received asynchronous task.")]),e._v(" "),s("p",[e._v("See "),s("RouterLink",{attrs:{to:"/specifications/text/0060-tasks-api.html#summarized-task-object-for-202-accepted"}},[e._v("Summarized "),s("code",[e._v("task")]),e._v(" Object for "),s("code",[e._v("202 Accepted")])]),e._v(".")],1),e._v(" "),s("h5",{attrs:{id:"_3-3-3-3-errors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-3-3-errors"}},[e._v("#")]),e._v(" 3.3.3.3. Errors")]),e._v(" "),s("ul",[s("li",[e._v("🔴 Sending an invalid index uid format for the "),s("code",[e._v(":index_uid")]),e._v(" path parameter returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_uid"}},[e._v("invalid_index_uid")]),e._v(" error.")],1)]),e._v(" "),s("h6",{attrs:{id:"_3-3-3-3-1-asynchronous-index-not-found-error"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-3-3-1-asynchronous-index-not-found-error"}},[e._v("#")]),e._v(" 3.3.3.3.1. Asynchronous Index Not Found Error")]),e._v(" "),s("ul",[s("li",[e._v("🔴 If the requested "),s("code",[e._v("index_uid")]),e._v(" does not exist, the API returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_not_found"}},[e._v("index_not_found")]),e._v(" error in the related async "),s("code",[e._v("task")]),e._v(" resource. See "),s("a",{attrs:{href:"#3331-response-definition"}},[e._v("3.3.3.1. Response Definition")]),e._v(".")],1)]),e._v(" "),s("h4",{attrs:{id:"_3-3-4-general-errors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-4-general-errors"}},[e._v("#")]),e._v(" 3.3.4. General Errors")]),e._v(" "),s("p",[e._v("These errors apply to all endpoints described here.")]),e._v(" "),s("h5",{attrs:{id:"_3-3-4-1-auth-errors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-4-1-auth-errors"}},[e._v("#")]),e._v(" 3.3.4.1 Auth Errors")]),e._v(" "),s("p",[e._v("The auth layer can return the following errors if Meilisearch is secured (a master-key is defined).")]),e._v(" "),s("ul",[s("li",[e._v("🔴 Accessing this route without the "),s("code",[e._v("Authorization")]),e._v(" header returns a "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_authorization_header"}},[e._v("missing_authorization_header")]),e._v(" error.")],1),e._v(" "),s("li",[e._v("🔴 Accessing this route with a key that does not have permissions (i.e. other than the master-key) returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key"}},[e._v("invalid_api_key")]),e._v(" error.")],1)]),e._v(" "),s("h2",{attrs:{id:"_4-technical-details"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-technical-details"}},[e._v("#")]),e._v(" 4. Technical Details")]),e._v(" "),s("h3",{attrs:{id:"_4-1-triggering-documents-re-indexing"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-triggering-documents-re-indexing"}},[e._v("#")]),e._v(" 4.1. Triggering Documents Re-Indexing")]),e._v(" "),s("p",[e._v("Meilisearch favors search speed and makes a trade-off on indexing speed by computing internal data structures to get search results as fast as possible.")]),e._v(" "),s("p",[e._v("Modifying this index setting cause documents to be re-indexed.")]),e._v(" "),s("h2",{attrs:{id:"_5-future-possibilities"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_5-future-possibilities"}},[e._v("#")]),e._v(" 5. Future Possibilities")]),e._v(" "),s("p",[e._v("n/a")])])}),[],!1,null,null,null);t.default=i.exports}}]); \ No newline at end of file diff --git a/docs/assets/js/44.97d19d44.js b/docs/assets/js/44.437489b6.js similarity index 99% rename from docs/assets/js/44.97d19d44.js rename to docs/assets/js/44.437489b6.js index 2f0db5a54..d3b557a98 100644 --- a/docs/assets/js/44.97d19d44.js +++ b/docs/assets/js/44.437489b6.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[44],{468:function(t,e,i){"use strict";i.r(e);var r=i(62),s=Object(r.a)({},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[i("h1",{attrs:{id:"settings-api"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#settings-api"}},[t._v("#")]),t._v(" Settings API")]),t._v(" "),i("h2",{attrs:{id:"_1-summary"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_1-summary"}},[t._v("#")]),t._v(" 1. Summary")]),t._v(" "),i("p",[t._v("This specification describes the global settings API endpoints and cross-reference related sub-resources APIs.")]),t._v(" "),i("h2",{attrs:{id:"_2-motivation"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_2-motivation"}},[t._v("#")]),t._v(" 2. Motivation")]),t._v(" "),i("p",[t._v("N/A")]),t._v(" "),i("h2",{attrs:{id:"_3-functional-specification"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-functional-specification"}},[t._v("#")]),t._v(" 3. Functional Specification")]),t._v(" "),i("h3",{attrs:{id:"_3-1-sub-resource-settings-api-list"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-sub-resource-settings-api-list"}},[t._v("#")]),t._v(" 3.1. Sub Resource Settings API List")]),t._v(" "),i("table",[i("thead",[i("tr",[i("th",[t._v("API Resource")]),t._v(" "),i("th",[t._v("Description")])])]),t._v(" "),i("tbody",[i("tr",[i("td",[i("RouterLink",{attrs:{to:"/specifications/text/0123-displayed-attributes-setting-api.html"}},[t._v("displayed-attributes")])],1),t._v(" "),i("td",[i("code",[t._v("displayedAttributes")]),t._v(" sub-resource API endpoints definition")])]),t._v(" "),i("tr",[i("td",[i("RouterLink",{attrs:{to:"/specifications/text/0123-searchable-attributes-setting-api.html"}},[t._v("searchable-attributes")])],1),t._v(" "),i("td",[i("code",[t._v("searchableAttributes")]),t._v(" sub-resource API endpoints definition")])]),t._v(" "),i("tr",[i("td",[i("RouterLink",{attrs:{to:"/specifications/text/0123-filterable-attributes-setting-api.html"}},[t._v("filterable-attributes")])],1),t._v(" "),i("td",[i("code",[t._v("filterableAttributes")]),t._v(" sub-resource API endpoints definition")])]),t._v(" "),i("tr",[i("td",[i("RouterLink",{attrs:{to:"/specifications/text/0123-sortable-attributes-setting-api.html"}},[t._v("sortable-attributes")])],1),t._v(" "),i("td",[i("code",[t._v("sortableAttributes")]),t._v(" sub-resource API endpoints definition")])]),t._v(" "),i("tr",[i("td",[i("RouterLink",{attrs:{to:"/specifications/text/0123-ranking-rules-setting-api.html"}},[t._v("ranking-rules")])],1),t._v(" "),i("td",[i("code",[t._v("rankingRules")]),t._v(" sub-resource API endpoints definition")])]),t._v(" "),i("tr",[i("td",[i("RouterLink",{attrs:{to:"/specifications/text/0123-stop-words-setting-api.html"}},[t._v("stop-words")])],1),t._v(" "),i("td",[i("code",[t._v("stopWords")]),t._v(" sub-resource API endpoints definition")])]),t._v(" "),i("tr",[i("td",[i("RouterLink",{attrs:{to:"/specifications/text/0123-separators-settings-api.html"}},[t._v("separator-tokens")])],1),t._v(" "),i("td",[i("code",[t._v("separatorTokens")]),t._v(" sub-resource API endpoints definition")])]),t._v(" "),i("tr",[i("td",[i("RouterLink",{attrs:{to:"/specifications/text/0123-separators-settings-api.html"}},[t._v("non-separator-tokens")])],1),t._v(" "),i("td",[i("code",[t._v("nonSeparatorTokens")]),t._v(" sub-resource API endpoints definition")])]),t._v(" "),i("tr",[i("td",[i("RouterLink",{attrs:{to:"/specifications/text/0123-user-dictionary-settings-api.html"}},[t._v("dictionary")])],1),t._v(" "),i("td",[i("code",[t._v("dictionary")]),t._v(" sub-resource API endpoints definition")])]),t._v(" "),i("tr",[i("td",[i("RouterLink",{attrs:{to:"/specifications/text/0123-synonyms-setting-api.html"}},[t._v("synonyms")])],1),t._v(" "),i("td",[i("code",[t._v("synonyms")]),t._v(" sub-resource API endpoints definition")])]),t._v(" "),i("tr",[i("td",[i("RouterLink",{attrs:{to:"/specifications/text/0123-distinct-attribute-setting-api.html"}},[t._v("distinct-attribute")])],1),t._v(" "),i("td",[i("code",[t._v("distinctAttribute")]),t._v(" sub-resource API endpoints definition")])]),t._v(" "),i("tr",[i("td",[i("RouterLink",{attrs:{to:"/specifications/text/0117-typo-tolerance-setting-api.html"}},[t._v("typo-tolerance")])],1),t._v(" "),i("td",[i("code",[t._v("typoTolerance")]),t._v(" sub-resource API endpoints definition")])]),t._v(" "),i("tr",[i("td",[i("RouterLink",{attrs:{to:"/specifications/text/157-pagination-setting-api.html"}},[t._v("pagination")])],1),t._v(" "),i("td",[i("code",[t._v("pagination")]),t._v(" sub-resource API endpoints definition")])]),t._v(" "),i("tr",[i("td",[i("RouterLink",{attrs:{to:"/specifications/text/157-faceting-setting-api.html"}},[t._v("faceting")])],1),t._v(" "),i("td",[i("code",[t._v("faceting")]),t._v(" sub-resource API endpoints definition")])]),t._v(" "),i("tr",[i("td",[i("RouterLink",{attrs:{to:"/specifications/text/0123-proximity-precision.html"}},[t._v("faceting")])],1),t._v(" "),i("td",[i("code",[t._v("proximityPrecision")]),t._v(" sub-resource API endpoints definition")])])])]),t._v(" "),i("p",[t._v("Each setting is exposed as a sub-resource of the "),i("code",[t._v("indexes/:index_uid/settings")]),t._v(" endpoints. e.g. The ranking rules setting of a Meilisearch index is exposed at "),i("code",[t._v("indexes/:index_uid/settings/ranking-rules")]),t._v(".")]),t._v(" "),i("p",[t._v("Some setting changes cause a complete re-indexing of the documents. See "),i("a",{attrs:{href:"#41-triggering-documents-re-indexing"}},[t._v("4.1. Triggering Documents Re-indexing")]),t._v(".")]),t._v(" "),i("h3",{attrs:{id:"_3-2-api-endpoints-definition"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-api-endpoints-definition"}},[t._v("#")]),t._v(" 3.2. API Endpoints Definition")]),t._v(" "),i("p",[t._v("Manipulate all settings of a Meilisearch index.")]),t._v(" "),i("h4",{attrs:{id:"_3-2-1-get-indexes-index-uid-settings"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-1-get-indexes-index-uid-settings"}},[t._v("#")]),t._v(" 3.2.1. "),i("code",[t._v("GET")]),t._v(" - "),i("code",[t._v("indexes/:index_uid/settings")])]),t._v(" "),i("p",[t._v("Fetch the settings of a Meilisearch index.")]),t._v(" "),i("h5",{attrs:{id:"_3-2-1-1-response-definition"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-1-1-response-definition"}},[t._v("#")]),t._v(" 3.2.1.1. Response Definition")]),t._v(" "),i("table",[i("thead",[i("tr",[i("th",[t._v("Field")]),t._v(" "),i("th",[t._v("Type")]),t._v(" "),i("th",[t._v("Required")])])]),t._v(" "),i("tbody",[i("tr",[i("td",[i("code",[t._v("displayedAttributes")])]),t._v(" "),i("td",[t._v("Array of String")]),t._v(" "),i("td",[t._v("true")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("searchableAttributes")])]),t._v(" "),i("td",[t._v("Array of String")]),t._v(" "),i("td",[t._v("true")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("filterableAttributes")])]),t._v(" "),i("td",[t._v("Array of String")]),t._v(" "),i("td",[t._v("true")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("sortableAttributes")])]),t._v(" "),i("td",[t._v("Array of String")]),t._v(" "),i("td",[t._v("true")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("rankingRules")])]),t._v(" "),i("td",[t._v("Array of String")]),t._v(" "),i("td",[t._v("true")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("stopWords")])]),t._v(" "),i("td",[t._v("Array of String")]),t._v(" "),i("td",[t._v("true")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("separatorTokens")])]),t._v(" "),i("td",[t._v("Array of String")]),t._v(" "),i("td",[t._v("true")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("nonSeparatorTokens")])]),t._v(" "),i("td",[t._v("Array of String")]),t._v(" "),i("td",[t._v("true")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("dictionary")])]),t._v(" "),i("td",[t._v("Array of String")]),t._v(" "),i("td",[t._v("true")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("synonyms")])]),t._v(" "),i("td",[t._v("Object")]),t._v(" "),i("td",[t._v("true")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("distinctAttribute")])]),t._v(" "),i("td",[t._v("String / "),i("code",[t._v("null")])]),t._v(" "),i("td",[t._v("true")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("typoTolerance")])]),t._v(" "),i("td",[t._v("Object")]),t._v(" "),i("td",[t._v("true")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("pagination")])]),t._v(" "),i("td",[t._v("Object")]),t._v(" "),i("td",[t._v("true")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("faceting")])]),t._v(" "),i("td",[t._v("Object")]),t._v(" "),i("td",[t._v("true")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("proximityPrecision")])]),t._v(" "),i("td",[t._v("String")]),t._v(" "),i("td",[t._v("true")])])])]),t._v(" "),i("p",[t._v("The attributes ordering in the response payload is equivalent to the order described in the table above.")]),t._v(" "),i("h5",{attrs:{id:"_3-2-1-2-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-1-2-errors"}},[t._v("#")]),t._v(" 3.2.1.2. Errors")]),t._v(" "),i("ul",[i("li",[t._v("🔴 If the requested "),i("code",[t._v("index_uid")]),t._v(" does not exist, the API returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_not_found"}},[t._v("index_not_found")]),t._v(" error.")],1)]),t._v(" "),i("h4",{attrs:{id:"_3-2-2-patch-indexes-index-uid-settings"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-2-patch-indexes-index-uid-settings"}},[t._v("#")]),t._v(" 3.2.2. "),i("code",[t._v("PATCH")]),t._v(" - "),i("code",[t._v("indexes/:index_uid/settings")])]),t._v(" "),i("p",[t._v("Modify the settings of a Meilisearch index.")]),t._v(" "),i("h5",{attrs:{id:"_3-2-2-1-request-payload-definition"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-2-1-request-payload-definition"}},[t._v("#")]),t._v(" 3.2.2.1. Request Payload Definition")]),t._v(" "),i("table",[i("thead",[i("tr",[i("th",[t._v("Field")]),t._v(" "),i("th",[t._v("Type")]),t._v(" "),i("th",[t._v("Required")])])]),t._v(" "),i("tbody",[i("tr",[i("td",[i("code",[t._v("displayedAttributes")])]),t._v(" "),i("td",[t._v("Array of String / "),i("code",[t._v("null")])]),t._v(" "),i("td",[t._v("false")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("searchableAttributes")])]),t._v(" "),i("td",[t._v("Array of String / "),i("code",[t._v("null")])]),t._v(" "),i("td",[t._v("false")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("filterableAttributes")])]),t._v(" "),i("td",[t._v("Array of String / "),i("code",[t._v("null")])]),t._v(" "),i("td",[t._v("false")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("sortableAttributes")])]),t._v(" "),i("td",[t._v("Array of String / "),i("code",[t._v("null")])]),t._v(" "),i("td",[t._v("false")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("rankingRules")])]),t._v(" "),i("td",[t._v("Array of String / "),i("code",[t._v("null")])]),t._v(" "),i("td",[t._v("false")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("stopWords")])]),t._v(" "),i("td",[t._v("Array of String / "),i("code",[t._v("null")])]),t._v(" "),i("td",[t._v("false")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("separatorTokens")])]),t._v(" "),i("td",[t._v("Array of String / "),i("code",[t._v("null")])]),t._v(" "),i("td",[t._v("false")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("nonSeparatorTokens")])]),t._v(" "),i("td",[t._v("Array of String / "),i("code",[t._v("null")])]),t._v(" "),i("td",[t._v("false")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("dictionary")])]),t._v(" "),i("td",[t._v("Array of String / "),i("code",[t._v("null")])]),t._v(" "),i("td",[t._v("false")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("synonyms")])]),t._v(" "),i("td",[t._v("Object / "),i("code",[t._v("null")])]),t._v(" "),i("td",[t._v("false")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("distinctAttribute")])]),t._v(" "),i("td",[t._v("String / "),i("code",[t._v("null")])]),t._v(" "),i("td",[t._v("false")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("typoTolerance")])]),t._v(" "),i("td",[t._v("Object / "),i("code",[t._v("null")])]),t._v(" "),i("td",[t._v("false")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("pagination")])]),t._v(" "),i("td",[t._v("Object / "),i("code",[t._v("null")])]),t._v(" "),i("td",[t._v("false")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("faceting")])]),t._v(" "),i("td",[t._v("Object / "),i("code",[t._v("null")])]),t._v(" "),i("td",[t._v("false")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("proximityPrecision")])]),t._v(" "),i("td",[t._v("String / "),i("code",[t._v("null")])]),t._v(" "),i("td",[t._v("false")])])])]),t._v(" "),i("ul",[i("li",[t._v("The request payload accepts partial definitions, the value of missing fields will remain unchanged.")]),t._v(" "),i("li",[t._v("The request payload accepts the "),i("code",[t._v("null")]),t._v(" value for any setting, which will reset the setting to its default value.")])]),t._v(" "),i("h5",{attrs:{id:"_3-2-2-2-response-definition"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-2-2-response-definition"}},[t._v("#")]),t._v(" 3.2.2.2. Response Definition")]),t._v(" "),i("p",[t._v("When the request is successful, Meilisearch returns the HTTP code "),i("code",[t._v("202 Accepted")]),t._v(". The response's content is the summarized representation of the received asynchronous task.")]),t._v(" "),i("p",[t._v("See "),i("RouterLink",{attrs:{to:"/specifications/text/0060-tasks-api.html#summarized-task-object-for-202-accepted"}},[t._v("Summarized "),i("code",[t._v("task")]),t._v(" Object for "),i("code",[t._v("202 Accepted")])]),t._v(".")],1),t._v(" "),i("h5",{attrs:{id:"_3-2-2-3-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-2-3-errors"}},[t._v("#")]),t._v(" 3.2.2.3. Errors")]),t._v(" "),i("ul",[i("li",[t._v("🔴 Omitting Content-Type header returns a "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_content_type"}},[t._v("missing_content_type")]),t._v(" error.")],1),t._v(" "),i("li",[t._v("🔴 Sending an empty Content-Type returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_content_type"}},[t._v("invalid_content_type")]),t._v(" error.")],1),t._v(" "),i("li",[t._v("🔴 Sending a different Content-Type than "),i("code",[t._v("application/json")]),t._v(" returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_content_type"}},[t._v("invalid_content_type")]),t._v(" error.")],1),t._v(" "),i("li",[t._v("🔴 Sending an empty payload returns a "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_payload"}},[t._v("missing_payload")]),t._v(" error.")],1),t._v(" "),i("li",[t._v("🔴 Sending an invalid JSON payload returns a "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#malformed_payload"}},[t._v("malformed_payload")]),t._v(" error.")],1),t._v(" "),i("li",[t._v("🔴 Sending an invalid index uid format for the "),i("code",[t._v(":index_uid")]),t._v(" path parameter returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_uid"}},[t._v("invalid_index_uid")]),t._v(" error.")],1)]),t._v(" "),i("p",[t._v("Errors related to a sub-resource are described in its respective specification. See "),i("a",{attrs:{href:"#31-sub-resource-settings-api-list"}},[t._v("3.1. Sub Resource Settings API List")]),t._v(".")]),t._v(" "),i("h6",{attrs:{id:"_3-2-2-3-1-async-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-2-3-1-async-errors"}},[t._v("#")]),t._v(" 3.2.2.3.1. Async Errors")]),t._v(" "),i("ul",[i("li",[t._v("🔴 When Meilisearch is secured, if the API Key do not have the "),i("code",[t._v("indexes.create")]),t._v(" action defined, the API returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_not_found"}},[t._v("index_not_found")]),t._v(" error in the related asynchronous "),i("code",[t._v("task")]),t._v(" resource. See "),i("a",{attrs:{href:"#3222-response-definition"}},[t._v("3.2.2.2. Response Definition")]),t._v(".")],1)]),t._v(" "),i("blockquote",[i("p",[t._v("Otherwise, Meilisearch will create the index in a lazy way. See "),i("a",{attrs:{href:"#3224-lazy-index-creation"}},[t._v("3.2.2.4. Lazy Index Creation")]),t._v(".")])]),t._v(" "),i("h5",{attrs:{id:"_3-2-2-4-lazy-index-creation"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-2-4-lazy-index-creation"}},[t._v("#")]),t._v(" 3.2.2.4. Lazy Index Creation")]),t._v(" "),i("p",[t._v("If the requested "),i("code",[t._v("index_uid")]),t._v(" does not exist, and the authorization layer allows it (See "),i("a",{attrs:{href:"#32231-async-errors"}},[t._v("3.2.2.3.1. Async Errors")]),t._v("), Meilisearch will create the index when the related asynchronous task resource is executed. See "),i("a",{attrs:{href:"#3222-response-definition"}},[t._v("3.2.2.2. Response Definition")]),t._v(".")]),t._v(" "),i("h4",{attrs:{id:"_3-2-3-delete-indexes-index-uid-settings"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-3-delete-indexes-index-uid-settings"}},[t._v("#")]),t._v(" 3.2.3. "),i("code",[t._v("DELETE")]),t._v(" - "),i("code",[t._v("indexes/:index_uid/settings")])]),t._v(" "),i("p",[t._v("Reset the settings of a Meilisearch index to the default values.")]),t._v(" "),i("h5",{attrs:{id:"_3-2-3-1-response-definition"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-3-1-response-definition"}},[t._v("#")]),t._v(" 3.2.3.1. Response Definition")]),t._v(" "),i("p",[t._v("When the request is in a successful state, Meilisearch returns the HTTP code "),i("code",[t._v("202 Accepted")]),t._v(". The response's content is the summarized representation of the received asynchronous task.")]),t._v(" "),i("p",[t._v("See "),i("RouterLink",{attrs:{to:"/specifications/text/0060-tasks-api.html#summarized-task-object-for-202-accepted"}},[t._v("Summarized "),i("code",[t._v("task")]),t._v(" Object for "),i("code",[t._v("202 Accepted")])]),t._v(".")],1),t._v(" "),i("h5",{attrs:{id:"_3-2-3-2-default-values"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-3-2-default-values"}},[t._v("#")]),t._v(" 3.2.3.2. Default Values")]),t._v(" "),i("p",[t._v("See "),i("a",{attrs:{href:"#31-sub-settings-api-resource-list"}},[t._v("3.1. Sub Settings API Resource List")]),t._v(" to get the default values of each setting.")]),t._v(" "),i("h5",{attrs:{id:"_3-2-3-3-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-3-3-errors"}},[t._v("#")]),t._v(" 3.2.3.3. Errors")]),t._v(" "),i("ul",[i("li",[t._v("🔴 Sending an invalid index uid format for the "),i("code",[t._v(":index_uid")]),t._v(" path parameter returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_uid"}},[t._v("invalid_index_uid")]),t._v(" error.")],1)]),t._v(" "),i("p",[t._v("Errors related to a sub-resource are described in its respective specification. See "),i("a",{attrs:{href:"#31-sub-resource-settings-api-list"}},[t._v("3.1. Sub Resource Settings API List")]),t._v(".")]),t._v(" "),i("h6",{attrs:{id:"_3-2-3-3-1-asynchronous-index-not-found-error"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-3-3-1-asynchronous-index-not-found-error"}},[t._v("#")]),t._v(" 3.2.3.3.1. Asynchronous Index Not Found Error")]),t._v(" "),i("ul",[i("li",[t._v("🔴 If the requested "),i("code",[t._v("index_uid")]),t._v(" does not exist, the API returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_not_found"}},[t._v("index_not_found")]),t._v(" error in the related async "),i("code",[t._v("task")]),t._v(" resource. See "),i("a",{attrs:{href:"#3231-response-definition"}},[t._v("3.2.3.1. Response Definition")]),t._v(".")],1)]),t._v(" "),i("h4",{attrs:{id:"_3-2-4-general-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-general-errors"}},[t._v("#")]),t._v(" 3.2.4. General Errors")]),t._v(" "),i("p",[t._v("These errors apply to all endpoints described here.")]),t._v(" "),i("h5",{attrs:{id:"_3-2-4-1-auth-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-1-auth-errors"}},[t._v("#")]),t._v(" 3.2.4.1 Auth Errors")]),t._v(" "),i("p",[t._v("The auth layer can return the following errors if Meilisearch is secured (a master-key is defined).")]),t._v(" "),i("ul",[i("li",[t._v("🔴 Accessing this route without the "),i("code",[t._v("Authorization")]),t._v(" header returns a "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_authorization_header"}},[t._v("missing_authorization_header")]),t._v(" error.")],1),t._v(" "),i("li",[t._v("🔴 Accessing this route with a key that does not have permissions (i.e. other than the master-key) returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key"}},[t._v("invalid_api_key")]),t._v(" error.")],1)]),t._v(" "),i("h2",{attrs:{id:"_4-technical-details"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_4-technical-details"}},[t._v("#")]),t._v(" 4. Technical Details")]),t._v(" "),i("h3",{attrs:{id:"_4-1-triggering-documents-re-indexing"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-triggering-documents-re-indexing"}},[t._v("#")]),t._v(" 4.1. Triggering Documents Re-indexing")]),t._v(" "),i("p",[t._v("Meilisearch favors search speed and makes a trade-off on indexing speed by computing internal data structures to get search results as fast as possible.")]),t._v(" "),i("p",[t._v("Changing any of the following index settings will cause documents to be re-indexed:")]),t._v(" "),i("ul",[i("li",[i("code",[t._v("searchableAttributes")])]),t._v(" "),i("li",[i("code",[t._v("filterableAttributes")])]),t._v(" "),i("li",[i("code",[t._v("sortableAttributes")])]),t._v(" "),i("li",[i("code",[t._v("distinctAttribute")])]),t._v(" "),i("li",[i("code",[t._v("stopWords")])]),t._v(" "),i("li",[i("code",[t._v("separatorTokens")])]),t._v(" "),i("li",[i("code",[t._v("nonSeparatorTokens")])]),t._v(" "),i("li",[i("code",[t._v("dictionary")])]),t._v(" "),i("li",[i("code",[t._v("proximityPrecision")])])]),t._v(" "),i("h2",{attrs:{id:"_5-future-possibilities"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_5-future-possibilities"}},[t._v("#")]),t._v(" 5. Future Possibilities")]),t._v(" "),i("p",[t._v("n/a")])])}),[],!1,null,null,null);e.default=s.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[44],{467:function(t,e,i){"use strict";i.r(e);var r=i(62),s=Object(r.a)({},(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[i("h1",{attrs:{id:"settings-api"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#settings-api"}},[t._v("#")]),t._v(" Settings API")]),t._v(" "),i("h2",{attrs:{id:"_1-summary"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_1-summary"}},[t._v("#")]),t._v(" 1. Summary")]),t._v(" "),i("p",[t._v("This specification describes the global settings API endpoints and cross-reference related sub-resources APIs.")]),t._v(" "),i("h2",{attrs:{id:"_2-motivation"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_2-motivation"}},[t._v("#")]),t._v(" 2. Motivation")]),t._v(" "),i("p",[t._v("N/A")]),t._v(" "),i("h2",{attrs:{id:"_3-functional-specification"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-functional-specification"}},[t._v("#")]),t._v(" 3. Functional Specification")]),t._v(" "),i("h3",{attrs:{id:"_3-1-sub-resource-settings-api-list"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-sub-resource-settings-api-list"}},[t._v("#")]),t._v(" 3.1. Sub Resource Settings API List")]),t._v(" "),i("table",[i("thead",[i("tr",[i("th",[t._v("API Resource")]),t._v(" "),i("th",[t._v("Description")])])]),t._v(" "),i("tbody",[i("tr",[i("td",[i("RouterLink",{attrs:{to:"/specifications/text/0123-displayed-attributes-setting-api.html"}},[t._v("displayed-attributes")])],1),t._v(" "),i("td",[i("code",[t._v("displayedAttributes")]),t._v(" sub-resource API endpoints definition")])]),t._v(" "),i("tr",[i("td",[i("RouterLink",{attrs:{to:"/specifications/text/0123-searchable-attributes-setting-api.html"}},[t._v("searchable-attributes")])],1),t._v(" "),i("td",[i("code",[t._v("searchableAttributes")]),t._v(" sub-resource API endpoints definition")])]),t._v(" "),i("tr",[i("td",[i("RouterLink",{attrs:{to:"/specifications/text/0123-filterable-attributes-setting-api.html"}},[t._v("filterable-attributes")])],1),t._v(" "),i("td",[i("code",[t._v("filterableAttributes")]),t._v(" sub-resource API endpoints definition")])]),t._v(" "),i("tr",[i("td",[i("RouterLink",{attrs:{to:"/specifications/text/0123-sortable-attributes-setting-api.html"}},[t._v("sortable-attributes")])],1),t._v(" "),i("td",[i("code",[t._v("sortableAttributes")]),t._v(" sub-resource API endpoints definition")])]),t._v(" "),i("tr",[i("td",[i("RouterLink",{attrs:{to:"/specifications/text/0123-ranking-rules-setting-api.html"}},[t._v("ranking-rules")])],1),t._v(" "),i("td",[i("code",[t._v("rankingRules")]),t._v(" sub-resource API endpoints definition")])]),t._v(" "),i("tr",[i("td",[i("RouterLink",{attrs:{to:"/specifications/text/0123-stop-words-setting-api.html"}},[t._v("stop-words")])],1),t._v(" "),i("td",[i("code",[t._v("stopWords")]),t._v(" sub-resource API endpoints definition")])]),t._v(" "),i("tr",[i("td",[i("RouterLink",{attrs:{to:"/specifications/text/0123-separators-settings-api.html"}},[t._v("separator-tokens")])],1),t._v(" "),i("td",[i("code",[t._v("separatorTokens")]),t._v(" sub-resource API endpoints definition")])]),t._v(" "),i("tr",[i("td",[i("RouterLink",{attrs:{to:"/specifications/text/0123-separators-settings-api.html"}},[t._v("non-separator-tokens")])],1),t._v(" "),i("td",[i("code",[t._v("nonSeparatorTokens")]),t._v(" sub-resource API endpoints definition")])]),t._v(" "),i("tr",[i("td",[i("RouterLink",{attrs:{to:"/specifications/text/0123-user-dictionary-settings-api.html"}},[t._v("dictionary")])],1),t._v(" "),i("td",[i("code",[t._v("dictionary")]),t._v(" sub-resource API endpoints definition")])]),t._v(" "),i("tr",[i("td",[i("RouterLink",{attrs:{to:"/specifications/text/0123-synonyms-setting-api.html"}},[t._v("synonyms")])],1),t._v(" "),i("td",[i("code",[t._v("synonyms")]),t._v(" sub-resource API endpoints definition")])]),t._v(" "),i("tr",[i("td",[i("RouterLink",{attrs:{to:"/specifications/text/0123-distinct-attribute-setting-api.html"}},[t._v("distinct-attribute")])],1),t._v(" "),i("td",[i("code",[t._v("distinctAttribute")]),t._v(" sub-resource API endpoints definition")])]),t._v(" "),i("tr",[i("td",[i("RouterLink",{attrs:{to:"/specifications/text/0117-typo-tolerance-setting-api.html"}},[t._v("typo-tolerance")])],1),t._v(" "),i("td",[i("code",[t._v("typoTolerance")]),t._v(" sub-resource API endpoints definition")])]),t._v(" "),i("tr",[i("td",[i("RouterLink",{attrs:{to:"/specifications/text/157-pagination-setting-api.html"}},[t._v("pagination")])],1),t._v(" "),i("td",[i("code",[t._v("pagination")]),t._v(" sub-resource API endpoints definition")])]),t._v(" "),i("tr",[i("td",[i("RouterLink",{attrs:{to:"/specifications/text/157-faceting-setting-api.html"}},[t._v("faceting")])],1),t._v(" "),i("td",[i("code",[t._v("faceting")]),t._v(" sub-resource API endpoints definition")])]),t._v(" "),i("tr",[i("td",[i("RouterLink",{attrs:{to:"/specifications/text/0123-proximity-precision.html"}},[t._v("faceting")])],1),t._v(" "),i("td",[i("code",[t._v("proximityPrecision")]),t._v(" sub-resource API endpoints definition")])])])]),t._v(" "),i("p",[t._v("Each setting is exposed as a sub-resource of the "),i("code",[t._v("indexes/:index_uid/settings")]),t._v(" endpoints. e.g. The ranking rules setting of a Meilisearch index is exposed at "),i("code",[t._v("indexes/:index_uid/settings/ranking-rules")]),t._v(".")]),t._v(" "),i("p",[t._v("Some setting changes cause a complete re-indexing of the documents. See "),i("a",{attrs:{href:"#41-triggering-documents-re-indexing"}},[t._v("4.1. Triggering Documents Re-indexing")]),t._v(".")]),t._v(" "),i("h3",{attrs:{id:"_3-2-api-endpoints-definition"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-api-endpoints-definition"}},[t._v("#")]),t._v(" 3.2. API Endpoints Definition")]),t._v(" "),i("p",[t._v("Manipulate all settings of a Meilisearch index.")]),t._v(" "),i("h4",{attrs:{id:"_3-2-1-get-indexes-index-uid-settings"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-1-get-indexes-index-uid-settings"}},[t._v("#")]),t._v(" 3.2.1. "),i("code",[t._v("GET")]),t._v(" - "),i("code",[t._v("indexes/:index_uid/settings")])]),t._v(" "),i("p",[t._v("Fetch the settings of a Meilisearch index.")]),t._v(" "),i("h5",{attrs:{id:"_3-2-1-1-response-definition"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-1-1-response-definition"}},[t._v("#")]),t._v(" 3.2.1.1. Response Definition")]),t._v(" "),i("table",[i("thead",[i("tr",[i("th",[t._v("Field")]),t._v(" "),i("th",[t._v("Type")]),t._v(" "),i("th",[t._v("Required")])])]),t._v(" "),i("tbody",[i("tr",[i("td",[i("code",[t._v("displayedAttributes")])]),t._v(" "),i("td",[t._v("Array of String")]),t._v(" "),i("td",[t._v("true")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("searchableAttributes")])]),t._v(" "),i("td",[t._v("Array of String")]),t._v(" "),i("td",[t._v("true")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("filterableAttributes")])]),t._v(" "),i("td",[t._v("Array of String")]),t._v(" "),i("td",[t._v("true")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("sortableAttributes")])]),t._v(" "),i("td",[t._v("Array of String")]),t._v(" "),i("td",[t._v("true")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("rankingRules")])]),t._v(" "),i("td",[t._v("Array of String")]),t._v(" "),i("td",[t._v("true")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("stopWords")])]),t._v(" "),i("td",[t._v("Array of String")]),t._v(" "),i("td",[t._v("true")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("separatorTokens")])]),t._v(" "),i("td",[t._v("Array of String")]),t._v(" "),i("td",[t._v("true")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("nonSeparatorTokens")])]),t._v(" "),i("td",[t._v("Array of String")]),t._v(" "),i("td",[t._v("true")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("dictionary")])]),t._v(" "),i("td",[t._v("Array of String")]),t._v(" "),i("td",[t._v("true")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("synonyms")])]),t._v(" "),i("td",[t._v("Object")]),t._v(" "),i("td",[t._v("true")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("distinctAttribute")])]),t._v(" "),i("td",[t._v("String / "),i("code",[t._v("null")])]),t._v(" "),i("td",[t._v("true")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("typoTolerance")])]),t._v(" "),i("td",[t._v("Object")]),t._v(" "),i("td",[t._v("true")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("pagination")])]),t._v(" "),i("td",[t._v("Object")]),t._v(" "),i("td",[t._v("true")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("faceting")])]),t._v(" "),i("td",[t._v("Object")]),t._v(" "),i("td",[t._v("true")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("proximityPrecision")])]),t._v(" "),i("td",[t._v("String")]),t._v(" "),i("td",[t._v("true")])])])]),t._v(" "),i("p",[t._v("The attributes ordering in the response payload is equivalent to the order described in the table above.")]),t._v(" "),i("h5",{attrs:{id:"_3-2-1-2-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-1-2-errors"}},[t._v("#")]),t._v(" 3.2.1.2. Errors")]),t._v(" "),i("ul",[i("li",[t._v("🔴 If the requested "),i("code",[t._v("index_uid")]),t._v(" does not exist, the API returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_not_found"}},[t._v("index_not_found")]),t._v(" error.")],1)]),t._v(" "),i("h4",{attrs:{id:"_3-2-2-patch-indexes-index-uid-settings"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-2-patch-indexes-index-uid-settings"}},[t._v("#")]),t._v(" 3.2.2. "),i("code",[t._v("PATCH")]),t._v(" - "),i("code",[t._v("indexes/:index_uid/settings")])]),t._v(" "),i("p",[t._v("Modify the settings of a Meilisearch index.")]),t._v(" "),i("h5",{attrs:{id:"_3-2-2-1-request-payload-definition"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-2-1-request-payload-definition"}},[t._v("#")]),t._v(" 3.2.2.1. Request Payload Definition")]),t._v(" "),i("table",[i("thead",[i("tr",[i("th",[t._v("Field")]),t._v(" "),i("th",[t._v("Type")]),t._v(" "),i("th",[t._v("Required")])])]),t._v(" "),i("tbody",[i("tr",[i("td",[i("code",[t._v("displayedAttributes")])]),t._v(" "),i("td",[t._v("Array of String / "),i("code",[t._v("null")])]),t._v(" "),i("td",[t._v("false")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("searchableAttributes")])]),t._v(" "),i("td",[t._v("Array of String / "),i("code",[t._v("null")])]),t._v(" "),i("td",[t._v("false")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("filterableAttributes")])]),t._v(" "),i("td",[t._v("Array of String / "),i("code",[t._v("null")])]),t._v(" "),i("td",[t._v("false")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("sortableAttributes")])]),t._v(" "),i("td",[t._v("Array of String / "),i("code",[t._v("null")])]),t._v(" "),i("td",[t._v("false")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("rankingRules")])]),t._v(" "),i("td",[t._v("Array of String / "),i("code",[t._v("null")])]),t._v(" "),i("td",[t._v("false")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("stopWords")])]),t._v(" "),i("td",[t._v("Array of String / "),i("code",[t._v("null")])]),t._v(" "),i("td",[t._v("false")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("separatorTokens")])]),t._v(" "),i("td",[t._v("Array of String / "),i("code",[t._v("null")])]),t._v(" "),i("td",[t._v("false")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("nonSeparatorTokens")])]),t._v(" "),i("td",[t._v("Array of String / "),i("code",[t._v("null")])]),t._v(" "),i("td",[t._v("false")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("dictionary")])]),t._v(" "),i("td",[t._v("Array of String / "),i("code",[t._v("null")])]),t._v(" "),i("td",[t._v("false")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("synonyms")])]),t._v(" "),i("td",[t._v("Object / "),i("code",[t._v("null")])]),t._v(" "),i("td",[t._v("false")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("distinctAttribute")])]),t._v(" "),i("td",[t._v("String / "),i("code",[t._v("null")])]),t._v(" "),i("td",[t._v("false")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("typoTolerance")])]),t._v(" "),i("td",[t._v("Object / "),i("code",[t._v("null")])]),t._v(" "),i("td",[t._v("false")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("pagination")])]),t._v(" "),i("td",[t._v("Object / "),i("code",[t._v("null")])]),t._v(" "),i("td",[t._v("false")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("faceting")])]),t._v(" "),i("td",[t._v("Object / "),i("code",[t._v("null")])]),t._v(" "),i("td",[t._v("false")])]),t._v(" "),i("tr",[i("td",[i("code",[t._v("proximityPrecision")])]),t._v(" "),i("td",[t._v("String / "),i("code",[t._v("null")])]),t._v(" "),i("td",[t._v("false")])])])]),t._v(" "),i("ul",[i("li",[t._v("The request payload accepts partial definitions, the value of missing fields will remain unchanged.")]),t._v(" "),i("li",[t._v("The request payload accepts the "),i("code",[t._v("null")]),t._v(" value for any setting, which will reset the setting to its default value.")])]),t._v(" "),i("h5",{attrs:{id:"_3-2-2-2-response-definition"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-2-2-response-definition"}},[t._v("#")]),t._v(" 3.2.2.2. Response Definition")]),t._v(" "),i("p",[t._v("When the request is successful, Meilisearch returns the HTTP code "),i("code",[t._v("202 Accepted")]),t._v(". The response's content is the summarized representation of the received asynchronous task.")]),t._v(" "),i("p",[t._v("See "),i("RouterLink",{attrs:{to:"/specifications/text/0060-tasks-api.html#summarized-task-object-for-202-accepted"}},[t._v("Summarized "),i("code",[t._v("task")]),t._v(" Object for "),i("code",[t._v("202 Accepted")])]),t._v(".")],1),t._v(" "),i("h5",{attrs:{id:"_3-2-2-3-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-2-3-errors"}},[t._v("#")]),t._v(" 3.2.2.3. Errors")]),t._v(" "),i("ul",[i("li",[t._v("🔴 Omitting Content-Type header returns a "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_content_type"}},[t._v("missing_content_type")]),t._v(" error.")],1),t._v(" "),i("li",[t._v("🔴 Sending an empty Content-Type returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_content_type"}},[t._v("invalid_content_type")]),t._v(" error.")],1),t._v(" "),i("li",[t._v("🔴 Sending a different Content-Type than "),i("code",[t._v("application/json")]),t._v(" returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_content_type"}},[t._v("invalid_content_type")]),t._v(" error.")],1),t._v(" "),i("li",[t._v("🔴 Sending an empty payload returns a "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_payload"}},[t._v("missing_payload")]),t._v(" error.")],1),t._v(" "),i("li",[t._v("🔴 Sending an invalid JSON payload returns a "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#malformed_payload"}},[t._v("malformed_payload")]),t._v(" error.")],1),t._v(" "),i("li",[t._v("🔴 Sending an invalid index uid format for the "),i("code",[t._v(":index_uid")]),t._v(" path parameter returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_uid"}},[t._v("invalid_index_uid")]),t._v(" error.")],1)]),t._v(" "),i("p",[t._v("Errors related to a sub-resource are described in its respective specification. See "),i("a",{attrs:{href:"#31-sub-resource-settings-api-list"}},[t._v("3.1. Sub Resource Settings API List")]),t._v(".")]),t._v(" "),i("h6",{attrs:{id:"_3-2-2-3-1-async-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-2-3-1-async-errors"}},[t._v("#")]),t._v(" 3.2.2.3.1. Async Errors")]),t._v(" "),i("ul",[i("li",[t._v("🔴 When Meilisearch is secured, if the API Key do not have the "),i("code",[t._v("indexes.create")]),t._v(" action defined, the API returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_not_found"}},[t._v("index_not_found")]),t._v(" error in the related asynchronous "),i("code",[t._v("task")]),t._v(" resource. See "),i("a",{attrs:{href:"#3222-response-definition"}},[t._v("3.2.2.2. Response Definition")]),t._v(".")],1)]),t._v(" "),i("blockquote",[i("p",[t._v("Otherwise, Meilisearch will create the index in a lazy way. See "),i("a",{attrs:{href:"#3224-lazy-index-creation"}},[t._v("3.2.2.4. Lazy Index Creation")]),t._v(".")])]),t._v(" "),i("h5",{attrs:{id:"_3-2-2-4-lazy-index-creation"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-2-4-lazy-index-creation"}},[t._v("#")]),t._v(" 3.2.2.4. Lazy Index Creation")]),t._v(" "),i("p",[t._v("If the requested "),i("code",[t._v("index_uid")]),t._v(" does not exist, and the authorization layer allows it (See "),i("a",{attrs:{href:"#32231-async-errors"}},[t._v("3.2.2.3.1. Async Errors")]),t._v("), Meilisearch will create the index when the related asynchronous task resource is executed. See "),i("a",{attrs:{href:"#3222-response-definition"}},[t._v("3.2.2.2. Response Definition")]),t._v(".")]),t._v(" "),i("h4",{attrs:{id:"_3-2-3-delete-indexes-index-uid-settings"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-3-delete-indexes-index-uid-settings"}},[t._v("#")]),t._v(" 3.2.3. "),i("code",[t._v("DELETE")]),t._v(" - "),i("code",[t._v("indexes/:index_uid/settings")])]),t._v(" "),i("p",[t._v("Reset the settings of a Meilisearch index to the default values.")]),t._v(" "),i("h5",{attrs:{id:"_3-2-3-1-response-definition"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-3-1-response-definition"}},[t._v("#")]),t._v(" 3.2.3.1. Response Definition")]),t._v(" "),i("p",[t._v("When the request is in a successful state, Meilisearch returns the HTTP code "),i("code",[t._v("202 Accepted")]),t._v(". The response's content is the summarized representation of the received asynchronous task.")]),t._v(" "),i("p",[t._v("See "),i("RouterLink",{attrs:{to:"/specifications/text/0060-tasks-api.html#summarized-task-object-for-202-accepted"}},[t._v("Summarized "),i("code",[t._v("task")]),t._v(" Object for "),i("code",[t._v("202 Accepted")])]),t._v(".")],1),t._v(" "),i("h5",{attrs:{id:"_3-2-3-2-default-values"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-3-2-default-values"}},[t._v("#")]),t._v(" 3.2.3.2. Default Values")]),t._v(" "),i("p",[t._v("See "),i("a",{attrs:{href:"#31-sub-settings-api-resource-list"}},[t._v("3.1. Sub Settings API Resource List")]),t._v(" to get the default values of each setting.")]),t._v(" "),i("h5",{attrs:{id:"_3-2-3-3-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-3-3-errors"}},[t._v("#")]),t._v(" 3.2.3.3. Errors")]),t._v(" "),i("ul",[i("li",[t._v("🔴 Sending an invalid index uid format for the "),i("code",[t._v(":index_uid")]),t._v(" path parameter returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_uid"}},[t._v("invalid_index_uid")]),t._v(" error.")],1)]),t._v(" "),i("p",[t._v("Errors related to a sub-resource are described in its respective specification. See "),i("a",{attrs:{href:"#31-sub-resource-settings-api-list"}},[t._v("3.1. Sub Resource Settings API List")]),t._v(".")]),t._v(" "),i("h6",{attrs:{id:"_3-2-3-3-1-asynchronous-index-not-found-error"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-3-3-1-asynchronous-index-not-found-error"}},[t._v("#")]),t._v(" 3.2.3.3.1. Asynchronous Index Not Found Error")]),t._v(" "),i("ul",[i("li",[t._v("🔴 If the requested "),i("code",[t._v("index_uid")]),t._v(" does not exist, the API returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_not_found"}},[t._v("index_not_found")]),t._v(" error in the related async "),i("code",[t._v("task")]),t._v(" resource. See "),i("a",{attrs:{href:"#3231-response-definition"}},[t._v("3.2.3.1. Response Definition")]),t._v(".")],1)]),t._v(" "),i("h4",{attrs:{id:"_3-2-4-general-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-general-errors"}},[t._v("#")]),t._v(" 3.2.4. General Errors")]),t._v(" "),i("p",[t._v("These errors apply to all endpoints described here.")]),t._v(" "),i("h5",{attrs:{id:"_3-2-4-1-auth-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-1-auth-errors"}},[t._v("#")]),t._v(" 3.2.4.1 Auth Errors")]),t._v(" "),i("p",[t._v("The auth layer can return the following errors if Meilisearch is secured (a master-key is defined).")]),t._v(" "),i("ul",[i("li",[t._v("🔴 Accessing this route without the "),i("code",[t._v("Authorization")]),t._v(" header returns a "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_authorization_header"}},[t._v("missing_authorization_header")]),t._v(" error.")],1),t._v(" "),i("li",[t._v("🔴 Accessing this route with a key that does not have permissions (i.e. other than the master-key) returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key"}},[t._v("invalid_api_key")]),t._v(" error.")],1)]),t._v(" "),i("h2",{attrs:{id:"_4-technical-details"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_4-technical-details"}},[t._v("#")]),t._v(" 4. Technical Details")]),t._v(" "),i("h3",{attrs:{id:"_4-1-triggering-documents-re-indexing"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-triggering-documents-re-indexing"}},[t._v("#")]),t._v(" 4.1. Triggering Documents Re-indexing")]),t._v(" "),i("p",[t._v("Meilisearch favors search speed and makes a trade-off on indexing speed by computing internal data structures to get search results as fast as possible.")]),t._v(" "),i("p",[t._v("Changing any of the following index settings will cause documents to be re-indexed:")]),t._v(" "),i("ul",[i("li",[i("code",[t._v("searchableAttributes")])]),t._v(" "),i("li",[i("code",[t._v("filterableAttributes")])]),t._v(" "),i("li",[i("code",[t._v("sortableAttributes")])]),t._v(" "),i("li",[i("code",[t._v("distinctAttribute")])]),t._v(" "),i("li",[i("code",[t._v("stopWords")])]),t._v(" "),i("li",[i("code",[t._v("separatorTokens")])]),t._v(" "),i("li",[i("code",[t._v("nonSeparatorTokens")])]),t._v(" "),i("li",[i("code",[t._v("dictionary")])]),t._v(" "),i("li",[i("code",[t._v("proximityPrecision")])])]),t._v(" "),i("h2",{attrs:{id:"_5-future-possibilities"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_5-future-possibilities"}},[t._v("#")]),t._v(" 5. Future Possibilities")]),t._v(" "),i("p",[t._v("n/a")])])}),[],!1,null,null,null);e.default=s.exports}}]); \ No newline at end of file diff --git a/docs/assets/js/46.9f9d4a1b.js b/docs/assets/js/46.7f495a96.js similarity index 99% rename from docs/assets/js/46.9f9d4a1b.js rename to docs/assets/js/46.7f495a96.js index fcfa9f422..a250012a1 100644 --- a/docs/assets/js/46.9f9d4a1b.js +++ b/docs/assets/js/46.7f495a96.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[46],{471:function(e,t,i){"use strict";i.r(t);var s=i(62),r=Object(s.a)({},(function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[i("h1",{attrs:{id:"stop-words-setting-api"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#stop-words-setting-api"}},[e._v("#")]),e._v(" Stop Words Setting API")]),e._v(" "),i("h2",{attrs:{id:"_1-summary"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_1-summary"}},[e._v("#")]),e._v(" 1. Summary")]),e._v(" "),i("p",[e._v("This specification describes the "),i("code",[e._v("stopWords")]),e._v(" index setting API endpoints.")]),e._v(" "),i("h2",{attrs:{id:"_2-motivation"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_2-motivation"}},[e._v("#")]),e._v(" 2. Motivation")]),e._v(" "),i("p",[e._v("N/A")]),e._v(" "),i("h2",{attrs:{id:"_3-functional-specification"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-functional-specification"}},[e._v("#")]),e._v(" 3. Functional Specification")]),e._v(" "),i("h3",{attrs:{id:"_3-1-explanations"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-explanations"}},[e._v("#")]),e._v(" 3.1. Explanations")]),e._v(" "),i("p",[e._v("The "),i("code",[e._v("stopWords")]),e._v(" index setting allows the configuration of a list of words to be ignored in search queries. The stop words contained in a search query will be ignored by the engine when matching and ranking search results.")]),e._v(" "),i("h4",{attrs:{id:"_3-1-1-usage-example"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-1-usage-example"}},[e._v("#")]),e._v(" 3.1.1. Usage Example")]),e._v(" "),i("p",[e._v("Suppose a database contains articles written in English. Countless occurrences of "),i("code",[e._v("the")]),e._v(" and "),i("code",[e._v("of")]),e._v(" could deteriorate the relevancy of search results. To set "),i("code",[e._v("the")]),e._v(" and "),i("code",[e._v("of")]),e._v(" words as stop words, it can be specified the following way.")]),e._v(" "),i("p",[i("em",[i("strong",[e._v("Request payload "),i("code",[e._v("PUT")]),e._v("- "),i("code",[e._v("/indexes/articles/settings/stop-words")])])])]),e._v(" "),i("div",{staticClass:"language-json extra-class"},[i("pre",{pre:!0,attrs:{class:"language-json"}},[i("code",[i("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),i("span",{pre:!0,attrs:{class:"token string"}},[e._v('"the"')]),i("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),i("span",{pre:!0,attrs:{class:"token string"}},[e._v('"of"')]),i("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n")])])]),i("p",[e._v("By adding common English words such as "),i("code",[e._v("the")]),e._v(" or "),i("code",[e._v("of")]),e._v(" to the stop-words list, Meilisearch will not take them into consideration when calculating how relevant a result is.")]),e._v(" "),i("h3",{attrs:{id:"_3-2-global-settings-api-endpoints-definition"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-global-settings-api-endpoints-definition"}},[e._v("#")]),e._v(" 3.2. Global Settings API Endpoints Definition")]),e._v(" "),i("p",[i("code",[e._v("stopWords")]),e._v(" is a sub-resource of "),i("code",[e._v("/indexes/:index_uid/settings")]),e._v(".")]),e._v(" "),i("p",[e._v("See "),i("RouterLink",{attrs:{to:"/specifications/text/0123-settings-api.html"}},[e._v("Settings API")]),e._v(".")],1),e._v(" "),i("h3",{attrs:{id:"_3-3-api-endpoints-definition"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-api-endpoints-definition"}},[e._v("#")]),e._v(" 3.3. API Endpoints Definition")]),e._v(" "),i("p",[e._v("Manipulate the "),i("code",[e._v("stopWords")]),e._v(" setting of a Meilisearch index.")]),e._v(" "),i("h4",{attrs:{id:"_3-3-1-get-indexes-index-uid-settings-stop-words"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-1-get-indexes-index-uid-settings-stop-words"}},[e._v("#")]),e._v(" 3.3.1. "),i("code",[e._v("GET")]),e._v(" - "),i("code",[e._v("indexes/:index_uid/settings/stop-words")])]),e._v(" "),i("p",[e._v("Fetch the "),i("code",[e._v("stopWords")]),e._v(" setting of a Meilisearch index.")]),e._v(" "),i("h5",{attrs:{id:"_3-3-1-1-response-definition"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-1-1-response-definition"}},[e._v("#")]),e._v(" 3.3.1.1. Response Definition")]),e._v(" "),i("ul",[i("li",[e._v("Type: Array of String")]),e._v(" "),i("li",[e._v("Default: "),i("code",[e._v("[]")])])]),e._v(" "),i("h5",{attrs:{id:"_3-3-1-2-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-1-2-errors"}},[e._v("#")]),e._v(" 3.3.1.2. Errors")]),e._v(" "),i("ul",[i("li",[e._v("🔴 Sending an invalid index uid format for the "),i("code",[e._v(":index_uid")]),e._v(" path parameter returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_uid"}},[e._v("invalid_index_uid")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 If the requested "),i("code",[e._v("index_uid")]),e._v(" does not exist, the API returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_not_found"}},[e._v("index_not_found")]),e._v(" error.")],1)]),e._v(" "),i("h4",{attrs:{id:"_3-3-2-put-indexes-index-uid-settings-stop-words"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-put-indexes-index-uid-settings-stop-words"}},[e._v("#")]),e._v(" 3.3.2. "),i("code",[e._v("PUT")]),e._v(" - "),i("code",[e._v("indexes/:index_uid/settings/stop-words")])]),e._v(" "),i("p",[e._v("Modify the "),i("code",[e._v("stopWords")]),e._v(" setting of a Meilisearch index.")]),e._v(" "),i("h5",{attrs:{id:"_3-3-2-1-request-payload-definition"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-1-request-payload-definition"}},[e._v("#")]),e._v(" 3.3.2.1. Request Payload Definition")]),e._v(" "),i("ul",[i("li",[e._v("Type: Array of String / "),i("code",[e._v("null")])])]),e._v(" "),i("p",[e._v("Setting "),i("code",[e._v("null")]),e._v(" is equivalent to using the "),i("a",{attrs:{href:"#333-delete---indexesindexuidsettingsstop-words"}},[e._v("3.3.3. "),i("code",[e._v("DELETE")]),e._v(" - "),i("code",[e._v("indexes/:index_uid/settings/stop-words")])]),e._v(" API endpoint.")]),e._v(" "),i("h5",{attrs:{id:"_3-3-2-2-response-definition"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-2-response-definition"}},[e._v("#")]),e._v(" 3.3.2.2. Response Definition")]),e._v(" "),i("p",[e._v("When the request is successful, Meilisearch returns the HTTP code "),i("code",[e._v("202 Accepted")]),e._v(". The response's content is the summarized representation of the received asynchronous task.")]),e._v(" "),i("p",[e._v("See "),i("RouterLink",{attrs:{to:"/specifications/text/0060-tasks-api.html#summarized-task-object-for-202-accepted"}},[e._v("Summarized "),i("code",[e._v("task")]),e._v(" Object for "),i("code",[e._v("202 Accepted")])]),e._v(".")],1),e._v(" "),i("h5",{attrs:{id:"_3-3-2-3-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-3-errors"}},[e._v("#")]),e._v(" 3.3.2.3. Errors")]),e._v(" "),i("ul",[i("li",[e._v("🔴 Omitting Content-Type header returns a "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_content_type"}},[e._v("missing_content_type")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending an empty Content-Type returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_content_type"}},[e._v("invalid_content_type")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending a different Content-Type than "),i("code",[e._v("application/json")]),e._v(" returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_content_type"}},[e._v("invalid_content_type")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending an empty payload returns a "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_payload"}},[e._v("missing_payload")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending an invalid JSON payload returns a "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#malformed_payload"}},[e._v("malformed_payload")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending an invalid index uid format for the "),i("code",[e._v(":index_uid")]),e._v(" path parameter returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_uid"}},[e._v("invalid_index_uid")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending a request payload value type different of "),i("code",[e._v("Array of String")]),e._v(", "),i("code",[e._v("[]")]),e._v(", or "),i("code",[e._v("null")]),e._v(" returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_settings_stop_words"}},[e._v("invalid_settings_stop_words")]),e._v(" error.")],1)]),e._v(" "),i("h6",{attrs:{id:"_3-3-2-3-1-async-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-3-1-async-errors"}},[e._v("#")]),e._v(" 3.3.2.3.1. Async Errors")]),e._v(" "),i("ul",[i("li",[e._v("🔴 When Meilisearch is secured, if the API Key do not have the "),i("code",[e._v("indexes.create")]),e._v(" action defined, the API returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_not_found"}},[e._v("index_not_found")]),e._v(" error in the related asynchronous "),i("code",[e._v("task")]),e._v(" resource. See "),i("a",{attrs:{href:"#3222-response-definition"}},[e._v("3.3.2.2. Response Definition")]),e._v(".")],1)]),e._v(" "),i("blockquote",[i("p",[e._v("Otherwise, Meilisearch will create the index in a lazy way. See "),i("a",{attrs:{href:"#3224-lazy-index-creation"}},[e._v("3.2.2.4. Lazy Index Creation")]),e._v(".")])]),e._v(" "),i("h5",{attrs:{id:"_3-3-2-4-lazy-index-creation"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-4-lazy-index-creation"}},[e._v("#")]),e._v(" 3.3.2.4. Lazy Index Creation")]),e._v(" "),i("p",[e._v("If the requested "),i("code",[e._v("index_uid")]),e._v(" does not exist, and the authorization layer allows it (See "),i("a",{attrs:{href:"#33231-async-errors"}},[e._v("3.3.2.3.1. Async Errors")]),e._v("), Meilisearch will create the index when the related asynchronous task resource is executed. See "),i("a",{attrs:{href:"#3322-response-definition"}},[e._v("3.3.2.2. Response Definition")]),e._v(".")]),e._v(" "),i("h4",{attrs:{id:"_3-3-3-delete-indexes-index-uid-settings-stop-words"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-3-delete-indexes-index-uid-settings-stop-words"}},[e._v("#")]),e._v(" 3.3.3. "),i("code",[e._v("DELETE")]),e._v(" - "),i("code",[e._v("indexes/:index_uid/settings/stop-words")])]),e._v(" "),i("p",[e._v("Reset the "),i("code",[e._v("stopWords")]),e._v(" setting of a Meilisearch index to the default value "),i("code",[e._v("[]")]),e._v(".")]),e._v(" "),i("h5",{attrs:{id:"_3-3-3-1-response-definition"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-3-1-response-definition"}},[e._v("#")]),e._v(" 3.3.3.1. Response Definition")]),e._v(" "),i("p",[e._v("When the request is in a successful state, Meilisearch returns the HTTP code "),i("code",[e._v("202 Accepted")]),e._v(". The response's content is the summarized representation of the received asynchronous task.")]),e._v(" "),i("p",[e._v("See "),i("RouterLink",{attrs:{to:"/specifications/text/0060-tasks-api.html#summarized-task-object-for-202-accepted"}},[e._v("Summarized "),i("code",[e._v("task")]),e._v(" Object for "),i("code",[e._v("202 Accepted")])]),e._v(".")],1),e._v(" "),i("h5",{attrs:{id:"_3-3-3-3-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-3-3-errors"}},[e._v("#")]),e._v(" 3.3.3.3. Errors")]),e._v(" "),i("ul",[i("li",[e._v("🔴 Sending an invalid index uid format for the "),i("code",[e._v(":index_uid")]),e._v(" path parameter returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_uid"}},[e._v("invalid_index_uid")]),e._v(" error.")],1)]),e._v(" "),i("h6",{attrs:{id:"_3-3-3-3-1-asynchronous-index-not-found-error"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-3-3-1-asynchronous-index-not-found-error"}},[e._v("#")]),e._v(" 3.3.3.3.1. Asynchronous Index Not Found Error")]),e._v(" "),i("ul",[i("li",[e._v("🔴 If the requested "),i("code",[e._v("index_uid")]),e._v(" does not exist, the API returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_not_found"}},[e._v("index_not_found")]),e._v(" error in the related async "),i("code",[e._v("task")]),e._v(" resource. See "),i("a",{attrs:{href:"#3331-response-definition"}},[e._v("3.3.3.1. Response Definition")]),e._v(".")],1)]),e._v(" "),i("h4",{attrs:{id:"_3-3-4-general-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-4-general-errors"}},[e._v("#")]),e._v(" 3.3.4. General Errors")]),e._v(" "),i("p",[e._v("These errors apply to all endpoints described here.")]),e._v(" "),i("h5",{attrs:{id:"_3-3-4-1-auth-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-4-1-auth-errors"}},[e._v("#")]),e._v(" 3.3.4.1 Auth Errors")]),e._v(" "),i("p",[e._v("The auth layer can return the following errors if Meilisearch is secured (a master-key is defined).")]),e._v(" "),i("ul",[i("li",[e._v("🔴 Accessing this route without the "),i("code",[e._v("Authorization")]),e._v(" header returns a "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_authorization_header"}},[e._v("missing_authorization_header")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Accessing this route with a key that does not have permissions (i.e. other than the master-key) returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key"}},[e._v("invalid_api_key")]),e._v(" error.")],1)]),e._v(" "),i("h2",{attrs:{id:"_4-technical-details"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_4-technical-details"}},[e._v("#")]),e._v(" 4. Technical Details")]),e._v(" "),i("h3",{attrs:{id:"_4-1-triggering-documents-re-indexing"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-triggering-documents-re-indexing"}},[e._v("#")]),e._v(" 4.1. Triggering Documents Re-Indexing")]),e._v(" "),i("p",[e._v("Meilisearch favors search speed and makes a trade-off on indexing speed by computing internal data structures to get search results as fast as possible.")]),e._v(" "),i("p",[e._v("Modifying this index setting cause documents to be re-indexed.")]),e._v(" "),i("h2",{attrs:{id:"_5-future-possibilities"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_5-future-possibilities"}},[e._v("#")]),e._v(" 5. Future Possibilities")]),e._v(" "),i("p",[e._v("n/a")])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[46],{470:function(e,t,i){"use strict";i.r(t);var s=i(62),r=Object(s.a)({},(function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[i("h1",{attrs:{id:"stop-words-setting-api"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#stop-words-setting-api"}},[e._v("#")]),e._v(" Stop Words Setting API")]),e._v(" "),i("h2",{attrs:{id:"_1-summary"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_1-summary"}},[e._v("#")]),e._v(" 1. Summary")]),e._v(" "),i("p",[e._v("This specification describes the "),i("code",[e._v("stopWords")]),e._v(" index setting API endpoints.")]),e._v(" "),i("h2",{attrs:{id:"_2-motivation"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_2-motivation"}},[e._v("#")]),e._v(" 2. Motivation")]),e._v(" "),i("p",[e._v("N/A")]),e._v(" "),i("h2",{attrs:{id:"_3-functional-specification"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-functional-specification"}},[e._v("#")]),e._v(" 3. Functional Specification")]),e._v(" "),i("h3",{attrs:{id:"_3-1-explanations"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-explanations"}},[e._v("#")]),e._v(" 3.1. Explanations")]),e._v(" "),i("p",[e._v("The "),i("code",[e._v("stopWords")]),e._v(" index setting allows the configuration of a list of words to be ignored in search queries. The stop words contained in a search query will be ignored by the engine when matching and ranking search results.")]),e._v(" "),i("h4",{attrs:{id:"_3-1-1-usage-example"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-1-usage-example"}},[e._v("#")]),e._v(" 3.1.1. Usage Example")]),e._v(" "),i("p",[e._v("Suppose a database contains articles written in English. Countless occurrences of "),i("code",[e._v("the")]),e._v(" and "),i("code",[e._v("of")]),e._v(" could deteriorate the relevancy of search results. To set "),i("code",[e._v("the")]),e._v(" and "),i("code",[e._v("of")]),e._v(" words as stop words, it can be specified the following way.")]),e._v(" "),i("p",[i("em",[i("strong",[e._v("Request payload "),i("code",[e._v("PUT")]),e._v("- "),i("code",[e._v("/indexes/articles/settings/stop-words")])])])]),e._v(" "),i("div",{staticClass:"language-json extra-class"},[i("pre",{pre:!0,attrs:{class:"language-json"}},[i("code",[i("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),i("span",{pre:!0,attrs:{class:"token string"}},[e._v('"the"')]),i("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),i("span",{pre:!0,attrs:{class:"token string"}},[e._v('"of"')]),i("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n")])])]),i("p",[e._v("By adding common English words such as "),i("code",[e._v("the")]),e._v(" or "),i("code",[e._v("of")]),e._v(" to the stop-words list, Meilisearch will not take them into consideration when calculating how relevant a result is.")]),e._v(" "),i("h3",{attrs:{id:"_3-2-global-settings-api-endpoints-definition"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-global-settings-api-endpoints-definition"}},[e._v("#")]),e._v(" 3.2. Global Settings API Endpoints Definition")]),e._v(" "),i("p",[i("code",[e._v("stopWords")]),e._v(" is a sub-resource of "),i("code",[e._v("/indexes/:index_uid/settings")]),e._v(".")]),e._v(" "),i("p",[e._v("See "),i("RouterLink",{attrs:{to:"/specifications/text/0123-settings-api.html"}},[e._v("Settings API")]),e._v(".")],1),e._v(" "),i("h3",{attrs:{id:"_3-3-api-endpoints-definition"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-api-endpoints-definition"}},[e._v("#")]),e._v(" 3.3. API Endpoints Definition")]),e._v(" "),i("p",[e._v("Manipulate the "),i("code",[e._v("stopWords")]),e._v(" setting of a Meilisearch index.")]),e._v(" "),i("h4",{attrs:{id:"_3-3-1-get-indexes-index-uid-settings-stop-words"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-1-get-indexes-index-uid-settings-stop-words"}},[e._v("#")]),e._v(" 3.3.1. "),i("code",[e._v("GET")]),e._v(" - "),i("code",[e._v("indexes/:index_uid/settings/stop-words")])]),e._v(" "),i("p",[e._v("Fetch the "),i("code",[e._v("stopWords")]),e._v(" setting of a Meilisearch index.")]),e._v(" "),i("h5",{attrs:{id:"_3-3-1-1-response-definition"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-1-1-response-definition"}},[e._v("#")]),e._v(" 3.3.1.1. Response Definition")]),e._v(" "),i("ul",[i("li",[e._v("Type: Array of String")]),e._v(" "),i("li",[e._v("Default: "),i("code",[e._v("[]")])])]),e._v(" "),i("h5",{attrs:{id:"_3-3-1-2-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-1-2-errors"}},[e._v("#")]),e._v(" 3.3.1.2. Errors")]),e._v(" "),i("ul",[i("li",[e._v("🔴 Sending an invalid index uid format for the "),i("code",[e._v(":index_uid")]),e._v(" path parameter returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_uid"}},[e._v("invalid_index_uid")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 If the requested "),i("code",[e._v("index_uid")]),e._v(" does not exist, the API returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_not_found"}},[e._v("index_not_found")]),e._v(" error.")],1)]),e._v(" "),i("h4",{attrs:{id:"_3-3-2-put-indexes-index-uid-settings-stop-words"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-put-indexes-index-uid-settings-stop-words"}},[e._v("#")]),e._v(" 3.3.2. "),i("code",[e._v("PUT")]),e._v(" - "),i("code",[e._v("indexes/:index_uid/settings/stop-words")])]),e._v(" "),i("p",[e._v("Modify the "),i("code",[e._v("stopWords")]),e._v(" setting of a Meilisearch index.")]),e._v(" "),i("h5",{attrs:{id:"_3-3-2-1-request-payload-definition"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-1-request-payload-definition"}},[e._v("#")]),e._v(" 3.3.2.1. Request Payload Definition")]),e._v(" "),i("ul",[i("li",[e._v("Type: Array of String / "),i("code",[e._v("null")])])]),e._v(" "),i("p",[e._v("Setting "),i("code",[e._v("null")]),e._v(" is equivalent to using the "),i("a",{attrs:{href:"#333-delete---indexesindexuidsettingsstop-words"}},[e._v("3.3.3. "),i("code",[e._v("DELETE")]),e._v(" - "),i("code",[e._v("indexes/:index_uid/settings/stop-words")])]),e._v(" API endpoint.")]),e._v(" "),i("h5",{attrs:{id:"_3-3-2-2-response-definition"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-2-response-definition"}},[e._v("#")]),e._v(" 3.3.2.2. Response Definition")]),e._v(" "),i("p",[e._v("When the request is successful, Meilisearch returns the HTTP code "),i("code",[e._v("202 Accepted")]),e._v(". The response's content is the summarized representation of the received asynchronous task.")]),e._v(" "),i("p",[e._v("See "),i("RouterLink",{attrs:{to:"/specifications/text/0060-tasks-api.html#summarized-task-object-for-202-accepted"}},[e._v("Summarized "),i("code",[e._v("task")]),e._v(" Object for "),i("code",[e._v("202 Accepted")])]),e._v(".")],1),e._v(" "),i("h5",{attrs:{id:"_3-3-2-3-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-3-errors"}},[e._v("#")]),e._v(" 3.3.2.3. Errors")]),e._v(" "),i("ul",[i("li",[e._v("🔴 Omitting Content-Type header returns a "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_content_type"}},[e._v("missing_content_type")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending an empty Content-Type returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_content_type"}},[e._v("invalid_content_type")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending a different Content-Type than "),i("code",[e._v("application/json")]),e._v(" returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_content_type"}},[e._v("invalid_content_type")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending an empty payload returns a "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_payload"}},[e._v("missing_payload")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending an invalid JSON payload returns a "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#malformed_payload"}},[e._v("malformed_payload")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending an invalid index uid format for the "),i("code",[e._v(":index_uid")]),e._v(" path parameter returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_uid"}},[e._v("invalid_index_uid")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending a request payload value type different of "),i("code",[e._v("Array of String")]),e._v(", "),i("code",[e._v("[]")]),e._v(", or "),i("code",[e._v("null")]),e._v(" returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_settings_stop_words"}},[e._v("invalid_settings_stop_words")]),e._v(" error.")],1)]),e._v(" "),i("h6",{attrs:{id:"_3-3-2-3-1-async-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-3-1-async-errors"}},[e._v("#")]),e._v(" 3.3.2.3.1. Async Errors")]),e._v(" "),i("ul",[i("li",[e._v("🔴 When Meilisearch is secured, if the API Key do not have the "),i("code",[e._v("indexes.create")]),e._v(" action defined, the API returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_not_found"}},[e._v("index_not_found")]),e._v(" error in the related asynchronous "),i("code",[e._v("task")]),e._v(" resource. See "),i("a",{attrs:{href:"#3222-response-definition"}},[e._v("3.3.2.2. Response Definition")]),e._v(".")],1)]),e._v(" "),i("blockquote",[i("p",[e._v("Otherwise, Meilisearch will create the index in a lazy way. See "),i("a",{attrs:{href:"#3224-lazy-index-creation"}},[e._v("3.2.2.4. Lazy Index Creation")]),e._v(".")])]),e._v(" "),i("h5",{attrs:{id:"_3-3-2-4-lazy-index-creation"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-4-lazy-index-creation"}},[e._v("#")]),e._v(" 3.3.2.4. Lazy Index Creation")]),e._v(" "),i("p",[e._v("If the requested "),i("code",[e._v("index_uid")]),e._v(" does not exist, and the authorization layer allows it (See "),i("a",{attrs:{href:"#33231-async-errors"}},[e._v("3.3.2.3.1. Async Errors")]),e._v("), Meilisearch will create the index when the related asynchronous task resource is executed. See "),i("a",{attrs:{href:"#3322-response-definition"}},[e._v("3.3.2.2. Response Definition")]),e._v(".")]),e._v(" "),i("h4",{attrs:{id:"_3-3-3-delete-indexes-index-uid-settings-stop-words"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-3-delete-indexes-index-uid-settings-stop-words"}},[e._v("#")]),e._v(" 3.3.3. "),i("code",[e._v("DELETE")]),e._v(" - "),i("code",[e._v("indexes/:index_uid/settings/stop-words")])]),e._v(" "),i("p",[e._v("Reset the "),i("code",[e._v("stopWords")]),e._v(" setting of a Meilisearch index to the default value "),i("code",[e._v("[]")]),e._v(".")]),e._v(" "),i("h5",{attrs:{id:"_3-3-3-1-response-definition"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-3-1-response-definition"}},[e._v("#")]),e._v(" 3.3.3.1. Response Definition")]),e._v(" "),i("p",[e._v("When the request is in a successful state, Meilisearch returns the HTTP code "),i("code",[e._v("202 Accepted")]),e._v(". The response's content is the summarized representation of the received asynchronous task.")]),e._v(" "),i("p",[e._v("See "),i("RouterLink",{attrs:{to:"/specifications/text/0060-tasks-api.html#summarized-task-object-for-202-accepted"}},[e._v("Summarized "),i("code",[e._v("task")]),e._v(" Object for "),i("code",[e._v("202 Accepted")])]),e._v(".")],1),e._v(" "),i("h5",{attrs:{id:"_3-3-3-3-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-3-3-errors"}},[e._v("#")]),e._v(" 3.3.3.3. Errors")]),e._v(" "),i("ul",[i("li",[e._v("🔴 Sending an invalid index uid format for the "),i("code",[e._v(":index_uid")]),e._v(" path parameter returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_uid"}},[e._v("invalid_index_uid")]),e._v(" error.")],1)]),e._v(" "),i("h6",{attrs:{id:"_3-3-3-3-1-asynchronous-index-not-found-error"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-3-3-1-asynchronous-index-not-found-error"}},[e._v("#")]),e._v(" 3.3.3.3.1. Asynchronous Index Not Found Error")]),e._v(" "),i("ul",[i("li",[e._v("🔴 If the requested "),i("code",[e._v("index_uid")]),e._v(" does not exist, the API returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_not_found"}},[e._v("index_not_found")]),e._v(" error in the related async "),i("code",[e._v("task")]),e._v(" resource. See "),i("a",{attrs:{href:"#3331-response-definition"}},[e._v("3.3.3.1. Response Definition")]),e._v(".")],1)]),e._v(" "),i("h4",{attrs:{id:"_3-3-4-general-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-4-general-errors"}},[e._v("#")]),e._v(" 3.3.4. General Errors")]),e._v(" "),i("p",[e._v("These errors apply to all endpoints described here.")]),e._v(" "),i("h5",{attrs:{id:"_3-3-4-1-auth-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-4-1-auth-errors"}},[e._v("#")]),e._v(" 3.3.4.1 Auth Errors")]),e._v(" "),i("p",[e._v("The auth layer can return the following errors if Meilisearch is secured (a master-key is defined).")]),e._v(" "),i("ul",[i("li",[e._v("🔴 Accessing this route without the "),i("code",[e._v("Authorization")]),e._v(" header returns a "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_authorization_header"}},[e._v("missing_authorization_header")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Accessing this route with a key that does not have permissions (i.e. other than the master-key) returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key"}},[e._v("invalid_api_key")]),e._v(" error.")],1)]),e._v(" "),i("h2",{attrs:{id:"_4-technical-details"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_4-technical-details"}},[e._v("#")]),e._v(" 4. Technical Details")]),e._v(" "),i("h3",{attrs:{id:"_4-1-triggering-documents-re-indexing"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-triggering-documents-re-indexing"}},[e._v("#")]),e._v(" 4.1. Triggering Documents Re-Indexing")]),e._v(" "),i("p",[e._v("Meilisearch favors search speed and makes a trade-off on indexing speed by computing internal data structures to get search results as fast as possible.")]),e._v(" "),i("p",[e._v("Modifying this index setting cause documents to be re-indexed.")]),e._v(" "),i("h2",{attrs:{id:"_5-future-possibilities"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_5-future-possibilities"}},[e._v("#")]),e._v(" 5. Future Possibilities")]),e._v(" "),i("p",[e._v("n/a")])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file diff --git a/docs/assets/js/47.49c151b7.js b/docs/assets/js/47.bf881f32.js similarity index 99% rename from docs/assets/js/47.49c151b7.js rename to docs/assets/js/47.bf881f32.js index a74234fa2..a692af2d4 100644 --- a/docs/assets/js/47.49c151b7.js +++ b/docs/assets/js/47.bf881f32.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[47],{470:function(e,t,s){"use strict";s.r(t);var n=s(62),a=Object(n.a)({},(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[s("h1",{attrs:{id:"synonyms-setting-api"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#synonyms-setting-api"}},[e._v("#")]),e._v(" Synonyms Setting API")]),e._v(" "),s("h2",{attrs:{id:"_1-summary"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-summary"}},[e._v("#")]),e._v(" 1. Summary")]),e._v(" "),s("p",[e._v("This specification describes the "),s("code",[e._v("synonyms")]),e._v(" index setting API endpoints.")]),e._v(" "),s("h2",{attrs:{id:"_2-motivation"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-motivation"}},[e._v("#")]),e._v(" 2. Motivation")]),e._v(" "),s("p",[e._v("N/A")]),e._v(" "),s("h2",{attrs:{id:"_3-functional-specification"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-functional-specification"}},[e._v("#")]),e._v(" 3. Functional Specification")]),e._v(" "),s("h3",{attrs:{id:"_3-1-explanations"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-explanations"}},[e._v("#")]),e._v(" 3.1. Explanations")]),e._v(" "),s("p",[e._v("If multiple words have an equivalent meaning in a dataset, specifying a list of synonyms will make search results more relevant.")]),e._v(" "),s("p",[e._v("In general, a search on a word will return the same results as a search on any of its synonyms. There is one exception to this rule. See "),s("a",{attrs:{href:"#42-multi-word-phrases"}},[e._v("4.2. Multi-word Phrases")]),e._v(" section.")]),e._v(" "),s("p",[e._v("All synonyms are lowercased and de-unicoded during the indexing process. See "),s("a",{attrs:{href:"#41-normalization"}},[e._v("4.1. Normalization")]),e._v(" section.")]),e._v(" "),s("h4",{attrs:{id:"_3-1-1-usage-examples"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-1-usage-examples"}},[e._v("#")]),e._v(" 3.1.1. Usage Examples")]),e._v(" "),s("p",[e._v("Meilisearch supports two types of synonym declarations.")]),e._v(" "),s("h5",{attrs:{id:"_3-1-1-1-one-way-association"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-1-1-one-way-association"}},[e._v("#")]),e._v(" 3.1.1.1. One-way Association")]),e._v(" "),s("p",[e._v("One-way association permits to declare one word to be synonymous with another, but not the other way around.")]),e._v(" "),s("p",[s("em",[s("strong",[e._v("Request payload "),s("code",[e._v("PUT")]),e._v("- "),s("code",[e._v("/indexes/proucts/settings/synonyms")])])])]),e._v(" "),s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[e._v('"phone"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[e._v('"iphone"')]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),s("p",[e._v("In this case, a search for "),s("code",[e._v("phone")]),e._v(" will return documents containing "),s("code",[e._v("iphone")]),e._v(" as if they contained the word "),s("code",[e._v("phone")]),e._v(".")]),e._v(" "),s("p",[e._v("However, in the case of a search for "),s("code",[e._v("iphone")]),e._v(", documents containing "),s("code",[e._v("phone")]),e._v(" will be ranked lower in the results due to the "),s("code",[e._v("typo")]),e._v(" ranking rule.")]),e._v(" "),s("h5",{attrs:{id:"_3-1-1-2-mutual-association"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-1-2-mutual-association"}},[e._v("#")]),e._v(" 3.1.1.2. Mutual Association")]),e._v(" "),s("p",[e._v("By associating one or more synonyms with each other, they will be considered the same in both directions.")]),e._v(" "),s("p",[s("em",[s("strong",[e._v("Request payload "),s("code",[e._v("PUT")]),e._v("- "),s("code",[e._v("/indexes/proucts/settings/synonyms")])])])]),e._v(" "),s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[e._v('"shoe"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[e._v('"boot"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[e._v('"slipper"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[e._v('"sneakers"')]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[e._v('"boot"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[e._v('"shoe"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[e._v('"slipper"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[e._v('"sneakers"')]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[e._v('"slipper"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[e._v('"shoe"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[e._v('"boot"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[e._v('"sneakers"')]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[e._v('"sneakers"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[e._v('"shoe"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[e._v('"boot"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[e._v('"slipper"')]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),s("p",[e._v("When a search is done with one of these words, all synonyms will be considered as the same word and will appear in the search results.")]),e._v(" "),s("h3",{attrs:{id:"_3-2-global-settings-api-endpoints-definition"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-global-settings-api-endpoints-definition"}},[e._v("#")]),e._v(" 3.2. Global Settings API Endpoints Definition")]),e._v(" "),s("p",[s("code",[e._v("synonyms")]),e._v(" is a sub-resource of "),s("code",[e._v("/indexes/:index_uid/settings")]),e._v(".")]),e._v(" "),s("p",[e._v("See "),s("RouterLink",{attrs:{to:"/specifications/text/0123-settings-api.html"}},[e._v("Settings API")]),e._v(".")],1),e._v(" "),s("h3",{attrs:{id:"_3-3-api-endpoints-definition"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-api-endpoints-definition"}},[e._v("#")]),e._v(" 3.3. API Endpoints Definition")]),e._v(" "),s("p",[e._v("Manipulate the "),s("code",[e._v("synonyms")]),e._v(" setting of a Meilisearch index.")]),e._v(" "),s("h4",{attrs:{id:"_3-3-1-get-indexes-index-uid-settings-synonyms"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-1-get-indexes-index-uid-settings-synonyms"}},[e._v("#")]),e._v(" 3.3.1. "),s("code",[e._v("GET")]),e._v(" - "),s("code",[e._v("indexes/:index_uid/settings/synonyms")])]),e._v(" "),s("p",[e._v("Fetch the "),s("code",[e._v("synonyms")]),e._v(" setting of a Meilisearch index.")]),e._v(" "),s("h5",{attrs:{id:"_3-3-1-1-response-definition"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-1-1-response-definition"}},[e._v("#")]),e._v(" 3.3.1.1. Response Definition")]),e._v(" "),s("ul",[s("li",[e._v("Type: Object")]),e._v(" "),s("li",[e._v("Default: "),s("code",[e._v("{}")])])]),e._v(" "),s("h5",{attrs:{id:"_3-3-1-2-errors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-1-2-errors"}},[e._v("#")]),e._v(" 3.3.1.2. Errors")]),e._v(" "),s("ul",[s("li",[e._v("🔴 Sending an invalid index uid format for the "),s("code",[e._v(":index_uid")]),e._v(" path parameter returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_uid"}},[e._v("invalid_index_uid")]),e._v(" error.")],1),e._v(" "),s("li",[e._v("🔴 If the requested "),s("code",[e._v("index_uid")]),e._v(" does not exist, the API returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_not_found"}},[e._v("index_not_found")]),e._v(" error.")],1)]),e._v(" "),s("h4",{attrs:{id:"_3-3-2-put-indexes-index-uid-settings-synonyms"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-put-indexes-index-uid-settings-synonyms"}},[e._v("#")]),e._v(" 3.3.2. "),s("code",[e._v("PUT")]),e._v(" - "),s("code",[e._v("indexes/:index_uid/settings/synonyms")])]),e._v(" "),s("p",[e._v("Modify the "),s("code",[e._v("synonyms")]),e._v(" setting of a Meilisearch index.")]),e._v(" "),s("h5",{attrs:{id:"_3-3-2-1-request-payload-definition"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-1-request-payload-definition"}},[e._v("#")]),e._v(" 3.3.2.1. Request Payload Definition")]),e._v(" "),s("ul",[s("li",[e._v("Type: Object / "),s("code",[e._v("null")])])]),e._v(" "),s("p",[e._v("Setting "),s("code",[e._v("null")]),e._v(" is equivalent to using the "),s("a",{attrs:{href:"#333-delete---indexesindexuidsettingssynonyms"}},[e._v("3.3.3. "),s("code",[e._v("DELETE")]),e._v(" - "),s("code",[e._v("indexes/:index_uid/settings/synonyms")])]),e._v(" API endpoint.")]),e._v(" "),s("h5",{attrs:{id:"_3-3-2-2-response-definition"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-2-response-definition"}},[e._v("#")]),e._v(" 3.3.2.2. Response Definition")]),e._v(" "),s("p",[e._v("When the request is successful, Meilisearch returns the HTTP code "),s("code",[e._v("202 Accepted")]),e._v(". The response's content is the summarized representation of the received asynchronous task.")]),e._v(" "),s("p",[e._v("See "),s("RouterLink",{attrs:{to:"/specifications/text/0060-tasks-api.html#summarized-task-object-for-202-accepted"}},[e._v("Summarized "),s("code",[e._v("task")]),e._v(" Object for "),s("code",[e._v("202 Accepted")])]),e._v(".")],1),e._v(" "),s("h5",{attrs:{id:"_3-3-2-3-errors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-3-errors"}},[e._v("#")]),e._v(" 3.3.2.3. Errors")]),e._v(" "),s("ul",[s("li",[e._v("🔴 Omitting Content-Type header returns a "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_content_type"}},[e._v("missing_content_type")]),e._v(" error.")],1),e._v(" "),s("li",[e._v("🔴 Sending an empty Content-Type returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_content_type"}},[e._v("invalid_content_type")]),e._v(" error.")],1),e._v(" "),s("li",[e._v("🔴 Sending a different Content-Type than "),s("code",[e._v("application/json")]),e._v(" returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_content_type"}},[e._v("invalid_content_type")]),e._v(" error.")],1),e._v(" "),s("li",[e._v("🔴 Sending an empty payload returns a "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_payload"}},[e._v("missing_payload")]),e._v(" error.")],1),e._v(" "),s("li",[e._v("🔴 Sending an invalid JSON payload returns a "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#malformed_payload"}},[e._v("malformed_payload")]),e._v(" error.")],1),e._v(" "),s("li",[e._v("🔴 Sending an invalid index uid format for the "),s("code",[e._v(":index_uid")]),e._v(" path parameter returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_uid"}},[e._v("invalid_index_uid")]),e._v(" error.")],1),e._v(" "),s("li",[e._v("🔴 Sending a request payload value type different of "),s("code",[e._v("Object")]),e._v(", or "),s("code",[e._v("null")]),e._v(" returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_settings_synonyms"}},[e._v("invalid_settings_synonyms")]),e._v(" error.")],1)]),e._v(" "),s("h6",{attrs:{id:"_3-3-2-3-1-async-errors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-3-1-async-errors"}},[e._v("#")]),e._v(" 3.3.2.3.1. Async Errors")]),e._v(" "),s("ul",[s("li",[e._v("🔴 When Meilisearch is secured, if the API Key do not have the "),s("code",[e._v("indexes.create")]),e._v(" action defined, the API returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_not_found"}},[e._v("index_not_found")]),e._v(" error in the related asynchronous "),s("code",[e._v("task")]),e._v(" resource. See "),s("a",{attrs:{href:"#3222-response-definition"}},[e._v("3.3.2.2. Response Definition")]),e._v(".")],1)]),e._v(" "),s("blockquote",[s("p",[e._v("Otherwise, Meilisearch will create the index in a lazy way. See "),s("a",{attrs:{href:"#3224-lazy-index-creation"}},[e._v("3.2.2.4. Lazy Index Creation")]),e._v(".")])]),e._v(" "),s("h5",{attrs:{id:"_3-3-2-4-lazy-index-creation"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-4-lazy-index-creation"}},[e._v("#")]),e._v(" 3.3.2.4. Lazy Index Creation")]),e._v(" "),s("p",[e._v("If the requested "),s("code",[e._v("index_uid")]),e._v(" does not exist, and the authorization layer allows it (See "),s("a",{attrs:{href:"#33231-async-errors"}},[e._v("3.3.2.3.1. Async Errors")]),e._v("), Meilisearch will create the index when the related asynchronous task resource is executed. See "),s("a",{attrs:{href:"#3322-response-definition"}},[e._v("3.3.2.2. Response Definition")]),e._v(".")]),e._v(" "),s("h4",{attrs:{id:"_3-3-3-delete-indexes-index-uid-settings-synonyms"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-3-delete-indexes-index-uid-settings-synonyms"}},[e._v("#")]),e._v(" 3.3.3. "),s("code",[e._v("DELETE")]),e._v(" - "),s("code",[e._v("indexes/:index_uid/settings/synonyms")])]),e._v(" "),s("p",[e._v("Reset the "),s("code",[e._v("synonyms")]),e._v(" setting of a Meilisearch index to the default value "),s("code",[e._v("{}")]),e._v(".")]),e._v(" "),s("h5",{attrs:{id:"_3-3-3-1-response-definition"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-3-1-response-definition"}},[e._v("#")]),e._v(" 3.3.3.1. Response Definition")]),e._v(" "),s("p",[e._v("When the request is in a successful state, Meilisearch returns the HTTP code "),s("code",[e._v("202 Accepted")]),e._v(". The response's content is the summarized representation of the received asynchronous task.")]),e._v(" "),s("p",[e._v("See "),s("RouterLink",{attrs:{to:"/specifications/text/0060-tasks-api.html#summarized-task-object-for-202-accepted"}},[e._v("Summarized "),s("code",[e._v("task")]),e._v(" Object for "),s("code",[e._v("202 Accepted")])]),e._v(".")],1),e._v(" "),s("h5",{attrs:{id:"_3-3-3-3-errors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-3-3-errors"}},[e._v("#")]),e._v(" 3.3.3.3. Errors")]),e._v(" "),s("ul",[s("li",[e._v("🔴 Sending an invalid index uid format for the "),s("code",[e._v(":index_uid")]),e._v(" path parameter returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_uid"}},[e._v("invalid_index_uid")]),e._v(" error.")],1)]),e._v(" "),s("h6",{attrs:{id:"_3-3-3-3-1-asynchronous-index-not-found-error"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-3-3-1-asynchronous-index-not-found-error"}},[e._v("#")]),e._v(" 3.3.3.3.1. Asynchronous Index Not Found Error")]),e._v(" "),s("ul",[s("li",[e._v("🔴 If the requested "),s("code",[e._v("index_uid")]),e._v(" does not exist, the API returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_not_found"}},[e._v("index_not_found")]),e._v(" error in the related async "),s("code",[e._v("task")]),e._v(" resource. See "),s("a",{attrs:{href:"#3331-response-definition"}},[e._v("3.3.3.1. Response Definition")]),e._v(".")],1)]),e._v(" "),s("h4",{attrs:{id:"_3-3-4-general-errors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-4-general-errors"}},[e._v("#")]),e._v(" 3.3.4. General Errors")]),e._v(" "),s("p",[e._v("These errors apply to all endpoints described here.")]),e._v(" "),s("h5",{attrs:{id:"_3-3-4-1-auth-errors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-4-1-auth-errors"}},[e._v("#")]),e._v(" 3.3.4.1 Auth Errors")]),e._v(" "),s("p",[e._v("The auth layer can return the following errors if Meilisearch is secured (a master key is defined).")]),e._v(" "),s("ul",[s("li",[e._v("🔴 Accessing this route without the "),s("code",[e._v("Authorization")]),e._v(" header returns a "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_authorization_header"}},[e._v("missing_authorization_header")]),e._v(" error.")],1),e._v(" "),s("li",[e._v("🔴 Accessing this route with a key that does not have permissions (i.e. other than the master-key) returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key"}},[e._v("invalid_api_key")]),e._v(" error.")],1)]),e._v(" "),s("h2",{attrs:{id:"_4-technical-details"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-technical-details"}},[e._v("#")]),e._v(" 4. Technical Details")]),e._v(" "),s("h3",{attrs:{id:"_4-1-normalization"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-normalization"}},[e._v("#")]),e._v(" 4.1. Normalization")]),e._v(" "),s("p",[e._v("All synonyms are lowercased and de-unicoded during the indexing process.")]),e._v(" "),s("h3",{attrs:{id:"_4-1-1-example"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-1-example"}},[e._v("#")]),e._v(" 4.1.1. Example")]),e._v(" "),s("p",[e._v("Consider a situation where "),s("code",[e._v("Résumé")]),e._v(" and "),s("code",[e._v("CV")]),e._v(" are set as synonyms.")]),e._v(" "),s("p",[s("em",[s("strong",[e._v("Request payload "),s("code",[e._v("GET")]),e._v("- "),s("code",[e._v("/indexes/jobs/settings/synonyms")])])])]),e._v(" "),s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[e._v('"Résumé"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[e._v('"CV"')]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[e._v('"CV"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[e._v('"Résumé"')]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),s("p",[e._v("A search for "),s("code",[e._v("cv")]),e._v(" would return any documents containing "),s("code",[e._v("cv")]),e._v(" or "),s("code",[e._v("CV")]),e._v(", in addition to any that contain "),s("code",[e._v("Résumé")]),e._v(", "),s("code",[e._v("resumé")]),e._v(", "),s("code",[e._v("resume")]),e._v(", etc. unaffected by case or accent marks.")]),e._v(" "),s("h3",{attrs:{id:"_4-2-multi-word-phrases"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-multi-word-phrases"}},[e._v("#")]),e._v(" 4.2. Multi-word Phrases")]),e._v(" "),s("p",[e._v("Multi-word phrases are treated differently than associations between individual words.")]),e._v(" "),s("p",[e._v("When a multi-word phrase is considered the synonym of another word or phrase, the exact search query will always take precedence over its synonym(s).")]),e._v(" "),s("h4",{attrs:{id:"_4-2-1-example"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-1-example"}},[e._v("#")]),e._v(" 4.2.1. Example")]),e._v(" "),s("p",[e._v("Suppose "),s("code",[e._v("San Francisco")]),e._v(" and "),s("code",[e._v("SF")]),e._v(" as synonyms with a mutual association")]),e._v(" "),s("p",[s("em",[s("strong",[e._v("Request payload "),s("code",[e._v("GET")]),e._v("- "),s("code",[e._v("/indexes/jobs/settings/synonyms")])])])]),e._v(" "),s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[e._v('"San Francisco"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[e._v('"SF"')]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[e._v('"SF"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[e._v('"San Francisco"')]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),s("p",[e._v("In this case, a search for "),s("code",[e._v("SF")]),e._v(", results containing "),s("code",[e._v("San Francisco")]),e._v(" will also be returned. However, they will be considered less relevant than those containing "),s("code",[e._v("SF")]),e._v(". The reverse is also true.")]),e._v(" "),s("h3",{attrs:{id:"_4-3-three-words-limitation"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-3-three-words-limitation"}},[e._v("#")]),e._v(" 4.3. Three Words Limitation")]),e._v(" "),s("p",[e._v("Multi-word synonyms are limited to a maximum of three words.")]),e._v(" "),s("p",[e._v("For example, although "),s("code",[e._v("League of Legends")]),e._v(" and "),s("code",[e._v("LOL")]),e._v(" can be synonymous, it will not work for "),s("code",[e._v("The Lord of the Rings")]),e._v(" and "),s("code",[e._v("LOTR")]),e._v(".")]),e._v(" "),s("h2",{attrs:{id:"_5-future-possibilities"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_5-future-possibilities"}},[e._v("#")]),e._v(" 5. Future Possibilities")]),e._v(" "),s("ul",[s("li",[e._v("Automatically declare mutual association")])])])}),[],!1,null,null,null);t.default=a.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[47],{471:function(e,t,s){"use strict";s.r(t);var n=s(62),a=Object(n.a)({},(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[s("h1",{attrs:{id:"synonyms-setting-api"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#synonyms-setting-api"}},[e._v("#")]),e._v(" Synonyms Setting API")]),e._v(" "),s("h2",{attrs:{id:"_1-summary"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-summary"}},[e._v("#")]),e._v(" 1. Summary")]),e._v(" "),s("p",[e._v("This specification describes the "),s("code",[e._v("synonyms")]),e._v(" index setting API endpoints.")]),e._v(" "),s("h2",{attrs:{id:"_2-motivation"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-motivation"}},[e._v("#")]),e._v(" 2. Motivation")]),e._v(" "),s("p",[e._v("N/A")]),e._v(" "),s("h2",{attrs:{id:"_3-functional-specification"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-functional-specification"}},[e._v("#")]),e._v(" 3. Functional Specification")]),e._v(" "),s("h3",{attrs:{id:"_3-1-explanations"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-explanations"}},[e._v("#")]),e._v(" 3.1. Explanations")]),e._v(" "),s("p",[e._v("If multiple words have an equivalent meaning in a dataset, specifying a list of synonyms will make search results more relevant.")]),e._v(" "),s("p",[e._v("In general, a search on a word will return the same results as a search on any of its synonyms. There is one exception to this rule. See "),s("a",{attrs:{href:"#42-multi-word-phrases"}},[e._v("4.2. Multi-word Phrases")]),e._v(" section.")]),e._v(" "),s("p",[e._v("All synonyms are lowercased and de-unicoded during the indexing process. See "),s("a",{attrs:{href:"#41-normalization"}},[e._v("4.1. Normalization")]),e._v(" section.")]),e._v(" "),s("h4",{attrs:{id:"_3-1-1-usage-examples"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-1-usage-examples"}},[e._v("#")]),e._v(" 3.1.1. Usage Examples")]),e._v(" "),s("p",[e._v("Meilisearch supports two types of synonym declarations.")]),e._v(" "),s("h5",{attrs:{id:"_3-1-1-1-one-way-association"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-1-1-one-way-association"}},[e._v("#")]),e._v(" 3.1.1.1. One-way Association")]),e._v(" "),s("p",[e._v("One-way association permits to declare one word to be synonymous with another, but not the other way around.")]),e._v(" "),s("p",[s("em",[s("strong",[e._v("Request payload "),s("code",[e._v("PUT")]),e._v("- "),s("code",[e._v("/indexes/proucts/settings/synonyms")])])])]),e._v(" "),s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[e._v('"phone"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[e._v('"iphone"')]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),s("p",[e._v("In this case, a search for "),s("code",[e._v("phone")]),e._v(" will return documents containing "),s("code",[e._v("iphone")]),e._v(" as if they contained the word "),s("code",[e._v("phone")]),e._v(".")]),e._v(" "),s("p",[e._v("However, in the case of a search for "),s("code",[e._v("iphone")]),e._v(", documents containing "),s("code",[e._v("phone")]),e._v(" will be ranked lower in the results due to the "),s("code",[e._v("typo")]),e._v(" ranking rule.")]),e._v(" "),s("h5",{attrs:{id:"_3-1-1-2-mutual-association"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-1-2-mutual-association"}},[e._v("#")]),e._v(" 3.1.1.2. Mutual Association")]),e._v(" "),s("p",[e._v("By associating one or more synonyms with each other, they will be considered the same in both directions.")]),e._v(" "),s("p",[s("em",[s("strong",[e._v("Request payload "),s("code",[e._v("PUT")]),e._v("- "),s("code",[e._v("/indexes/proucts/settings/synonyms")])])])]),e._v(" "),s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[e._v('"shoe"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[e._v('"boot"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[e._v('"slipper"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[e._v('"sneakers"')]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[e._v('"boot"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[e._v('"shoe"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[e._v('"slipper"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[e._v('"sneakers"')]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[e._v('"slipper"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[e._v('"shoe"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[e._v('"boot"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[e._v('"sneakers"')]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[e._v('"sneakers"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[e._v('"shoe"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[e._v('"boot"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[e._v('"slipper"')]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),s("p",[e._v("When a search is done with one of these words, all synonyms will be considered as the same word and will appear in the search results.")]),e._v(" "),s("h3",{attrs:{id:"_3-2-global-settings-api-endpoints-definition"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-global-settings-api-endpoints-definition"}},[e._v("#")]),e._v(" 3.2. Global Settings API Endpoints Definition")]),e._v(" "),s("p",[s("code",[e._v("synonyms")]),e._v(" is a sub-resource of "),s("code",[e._v("/indexes/:index_uid/settings")]),e._v(".")]),e._v(" "),s("p",[e._v("See "),s("RouterLink",{attrs:{to:"/specifications/text/0123-settings-api.html"}},[e._v("Settings API")]),e._v(".")],1),e._v(" "),s("h3",{attrs:{id:"_3-3-api-endpoints-definition"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-api-endpoints-definition"}},[e._v("#")]),e._v(" 3.3. API Endpoints Definition")]),e._v(" "),s("p",[e._v("Manipulate the "),s("code",[e._v("synonyms")]),e._v(" setting of a Meilisearch index.")]),e._v(" "),s("h4",{attrs:{id:"_3-3-1-get-indexes-index-uid-settings-synonyms"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-1-get-indexes-index-uid-settings-synonyms"}},[e._v("#")]),e._v(" 3.3.1. "),s("code",[e._v("GET")]),e._v(" - "),s("code",[e._v("indexes/:index_uid/settings/synonyms")])]),e._v(" "),s("p",[e._v("Fetch the "),s("code",[e._v("synonyms")]),e._v(" setting of a Meilisearch index.")]),e._v(" "),s("h5",{attrs:{id:"_3-3-1-1-response-definition"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-1-1-response-definition"}},[e._v("#")]),e._v(" 3.3.1.1. Response Definition")]),e._v(" "),s("ul",[s("li",[e._v("Type: Object")]),e._v(" "),s("li",[e._v("Default: "),s("code",[e._v("{}")])])]),e._v(" "),s("h5",{attrs:{id:"_3-3-1-2-errors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-1-2-errors"}},[e._v("#")]),e._v(" 3.3.1.2. Errors")]),e._v(" "),s("ul",[s("li",[e._v("🔴 Sending an invalid index uid format for the "),s("code",[e._v(":index_uid")]),e._v(" path parameter returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_uid"}},[e._v("invalid_index_uid")]),e._v(" error.")],1),e._v(" "),s("li",[e._v("🔴 If the requested "),s("code",[e._v("index_uid")]),e._v(" does not exist, the API returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_not_found"}},[e._v("index_not_found")]),e._v(" error.")],1)]),e._v(" "),s("h4",{attrs:{id:"_3-3-2-put-indexes-index-uid-settings-synonyms"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-put-indexes-index-uid-settings-synonyms"}},[e._v("#")]),e._v(" 3.3.2. "),s("code",[e._v("PUT")]),e._v(" - "),s("code",[e._v("indexes/:index_uid/settings/synonyms")])]),e._v(" "),s("p",[e._v("Modify the "),s("code",[e._v("synonyms")]),e._v(" setting of a Meilisearch index.")]),e._v(" "),s("h5",{attrs:{id:"_3-3-2-1-request-payload-definition"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-1-request-payload-definition"}},[e._v("#")]),e._v(" 3.3.2.1. Request Payload Definition")]),e._v(" "),s("ul",[s("li",[e._v("Type: Object / "),s("code",[e._v("null")])])]),e._v(" "),s("p",[e._v("Setting "),s("code",[e._v("null")]),e._v(" is equivalent to using the "),s("a",{attrs:{href:"#333-delete---indexesindexuidsettingssynonyms"}},[e._v("3.3.3. "),s("code",[e._v("DELETE")]),e._v(" - "),s("code",[e._v("indexes/:index_uid/settings/synonyms")])]),e._v(" API endpoint.")]),e._v(" "),s("h5",{attrs:{id:"_3-3-2-2-response-definition"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-2-response-definition"}},[e._v("#")]),e._v(" 3.3.2.2. Response Definition")]),e._v(" "),s("p",[e._v("When the request is successful, Meilisearch returns the HTTP code "),s("code",[e._v("202 Accepted")]),e._v(". The response's content is the summarized representation of the received asynchronous task.")]),e._v(" "),s("p",[e._v("See "),s("RouterLink",{attrs:{to:"/specifications/text/0060-tasks-api.html#summarized-task-object-for-202-accepted"}},[e._v("Summarized "),s("code",[e._v("task")]),e._v(" Object for "),s("code",[e._v("202 Accepted")])]),e._v(".")],1),e._v(" "),s("h5",{attrs:{id:"_3-3-2-3-errors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-3-errors"}},[e._v("#")]),e._v(" 3.3.2.3. Errors")]),e._v(" "),s("ul",[s("li",[e._v("🔴 Omitting Content-Type header returns a "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_content_type"}},[e._v("missing_content_type")]),e._v(" error.")],1),e._v(" "),s("li",[e._v("🔴 Sending an empty Content-Type returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_content_type"}},[e._v("invalid_content_type")]),e._v(" error.")],1),e._v(" "),s("li",[e._v("🔴 Sending a different Content-Type than "),s("code",[e._v("application/json")]),e._v(" returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_content_type"}},[e._v("invalid_content_type")]),e._v(" error.")],1),e._v(" "),s("li",[e._v("🔴 Sending an empty payload returns a "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_payload"}},[e._v("missing_payload")]),e._v(" error.")],1),e._v(" "),s("li",[e._v("🔴 Sending an invalid JSON payload returns a "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#malformed_payload"}},[e._v("malformed_payload")]),e._v(" error.")],1),e._v(" "),s("li",[e._v("🔴 Sending an invalid index uid format for the "),s("code",[e._v(":index_uid")]),e._v(" path parameter returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_uid"}},[e._v("invalid_index_uid")]),e._v(" error.")],1),e._v(" "),s("li",[e._v("🔴 Sending a request payload value type different of "),s("code",[e._v("Object")]),e._v(", or "),s("code",[e._v("null")]),e._v(" returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_settings_synonyms"}},[e._v("invalid_settings_synonyms")]),e._v(" error.")],1)]),e._v(" "),s("h6",{attrs:{id:"_3-3-2-3-1-async-errors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-3-1-async-errors"}},[e._v("#")]),e._v(" 3.3.2.3.1. Async Errors")]),e._v(" "),s("ul",[s("li",[e._v("🔴 When Meilisearch is secured, if the API Key do not have the "),s("code",[e._v("indexes.create")]),e._v(" action defined, the API returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_not_found"}},[e._v("index_not_found")]),e._v(" error in the related asynchronous "),s("code",[e._v("task")]),e._v(" resource. See "),s("a",{attrs:{href:"#3222-response-definition"}},[e._v("3.3.2.2. Response Definition")]),e._v(".")],1)]),e._v(" "),s("blockquote",[s("p",[e._v("Otherwise, Meilisearch will create the index in a lazy way. See "),s("a",{attrs:{href:"#3224-lazy-index-creation"}},[e._v("3.2.2.4. Lazy Index Creation")]),e._v(".")])]),e._v(" "),s("h5",{attrs:{id:"_3-3-2-4-lazy-index-creation"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-4-lazy-index-creation"}},[e._v("#")]),e._v(" 3.3.2.4. Lazy Index Creation")]),e._v(" "),s("p",[e._v("If the requested "),s("code",[e._v("index_uid")]),e._v(" does not exist, and the authorization layer allows it (See "),s("a",{attrs:{href:"#33231-async-errors"}},[e._v("3.3.2.3.1. Async Errors")]),e._v("), Meilisearch will create the index when the related asynchronous task resource is executed. See "),s("a",{attrs:{href:"#3322-response-definition"}},[e._v("3.3.2.2. Response Definition")]),e._v(".")]),e._v(" "),s("h4",{attrs:{id:"_3-3-3-delete-indexes-index-uid-settings-synonyms"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-3-delete-indexes-index-uid-settings-synonyms"}},[e._v("#")]),e._v(" 3.3.3. "),s("code",[e._v("DELETE")]),e._v(" - "),s("code",[e._v("indexes/:index_uid/settings/synonyms")])]),e._v(" "),s("p",[e._v("Reset the "),s("code",[e._v("synonyms")]),e._v(" setting of a Meilisearch index to the default value "),s("code",[e._v("{}")]),e._v(".")]),e._v(" "),s("h5",{attrs:{id:"_3-3-3-1-response-definition"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-3-1-response-definition"}},[e._v("#")]),e._v(" 3.3.3.1. Response Definition")]),e._v(" "),s("p",[e._v("When the request is in a successful state, Meilisearch returns the HTTP code "),s("code",[e._v("202 Accepted")]),e._v(". The response's content is the summarized representation of the received asynchronous task.")]),e._v(" "),s("p",[e._v("See "),s("RouterLink",{attrs:{to:"/specifications/text/0060-tasks-api.html#summarized-task-object-for-202-accepted"}},[e._v("Summarized "),s("code",[e._v("task")]),e._v(" Object for "),s("code",[e._v("202 Accepted")])]),e._v(".")],1),e._v(" "),s("h5",{attrs:{id:"_3-3-3-3-errors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-3-3-errors"}},[e._v("#")]),e._v(" 3.3.3.3. Errors")]),e._v(" "),s("ul",[s("li",[e._v("🔴 Sending an invalid index uid format for the "),s("code",[e._v(":index_uid")]),e._v(" path parameter returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_uid"}},[e._v("invalid_index_uid")]),e._v(" error.")],1)]),e._v(" "),s("h6",{attrs:{id:"_3-3-3-3-1-asynchronous-index-not-found-error"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-3-3-1-asynchronous-index-not-found-error"}},[e._v("#")]),e._v(" 3.3.3.3.1. Asynchronous Index Not Found Error")]),e._v(" "),s("ul",[s("li",[e._v("🔴 If the requested "),s("code",[e._v("index_uid")]),e._v(" does not exist, the API returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_not_found"}},[e._v("index_not_found")]),e._v(" error in the related async "),s("code",[e._v("task")]),e._v(" resource. See "),s("a",{attrs:{href:"#3331-response-definition"}},[e._v("3.3.3.1. Response Definition")]),e._v(".")],1)]),e._v(" "),s("h4",{attrs:{id:"_3-3-4-general-errors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-4-general-errors"}},[e._v("#")]),e._v(" 3.3.4. General Errors")]),e._v(" "),s("p",[e._v("These errors apply to all endpoints described here.")]),e._v(" "),s("h5",{attrs:{id:"_3-3-4-1-auth-errors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-4-1-auth-errors"}},[e._v("#")]),e._v(" 3.3.4.1 Auth Errors")]),e._v(" "),s("p",[e._v("The auth layer can return the following errors if Meilisearch is secured (a master key is defined).")]),e._v(" "),s("ul",[s("li",[e._v("🔴 Accessing this route without the "),s("code",[e._v("Authorization")]),e._v(" header returns a "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_authorization_header"}},[e._v("missing_authorization_header")]),e._v(" error.")],1),e._v(" "),s("li",[e._v("🔴 Accessing this route with a key that does not have permissions (i.e. other than the master-key) returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key"}},[e._v("invalid_api_key")]),e._v(" error.")],1)]),e._v(" "),s("h2",{attrs:{id:"_4-technical-details"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-technical-details"}},[e._v("#")]),e._v(" 4. Technical Details")]),e._v(" "),s("h3",{attrs:{id:"_4-1-normalization"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-normalization"}},[e._v("#")]),e._v(" 4.1. Normalization")]),e._v(" "),s("p",[e._v("All synonyms are lowercased and de-unicoded during the indexing process.")]),e._v(" "),s("h3",{attrs:{id:"_4-1-1-example"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-1-example"}},[e._v("#")]),e._v(" 4.1.1. Example")]),e._v(" "),s("p",[e._v("Consider a situation where "),s("code",[e._v("Résumé")]),e._v(" and "),s("code",[e._v("CV")]),e._v(" are set as synonyms.")]),e._v(" "),s("p",[s("em",[s("strong",[e._v("Request payload "),s("code",[e._v("GET")]),e._v("- "),s("code",[e._v("/indexes/jobs/settings/synonyms")])])])]),e._v(" "),s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[e._v('"Résumé"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[e._v('"CV"')]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[e._v('"CV"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[e._v('"Résumé"')]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),s("p",[e._v("A search for "),s("code",[e._v("cv")]),e._v(" would return any documents containing "),s("code",[e._v("cv")]),e._v(" or "),s("code",[e._v("CV")]),e._v(", in addition to any that contain "),s("code",[e._v("Résumé")]),e._v(", "),s("code",[e._v("resumé")]),e._v(", "),s("code",[e._v("resume")]),e._v(", etc. unaffected by case or accent marks.")]),e._v(" "),s("h3",{attrs:{id:"_4-2-multi-word-phrases"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-multi-word-phrases"}},[e._v("#")]),e._v(" 4.2. Multi-word Phrases")]),e._v(" "),s("p",[e._v("Multi-word phrases are treated differently than associations between individual words.")]),e._v(" "),s("p",[e._v("When a multi-word phrase is considered the synonym of another word or phrase, the exact search query will always take precedence over its synonym(s).")]),e._v(" "),s("h4",{attrs:{id:"_4-2-1-example"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-1-example"}},[e._v("#")]),e._v(" 4.2.1. Example")]),e._v(" "),s("p",[e._v("Suppose "),s("code",[e._v("San Francisco")]),e._v(" and "),s("code",[e._v("SF")]),e._v(" as synonyms with a mutual association")]),e._v(" "),s("p",[s("em",[s("strong",[e._v("Request payload "),s("code",[e._v("GET")]),e._v("- "),s("code",[e._v("/indexes/jobs/settings/synonyms")])])])]),e._v(" "),s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[e._v('"San Francisco"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[e._v('"SF"')]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[e._v('"SF"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token string"}},[e._v('"San Francisco"')]),e._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),s("p",[e._v("In this case, a search for "),s("code",[e._v("SF")]),e._v(", results containing "),s("code",[e._v("San Francisco")]),e._v(" will also be returned. However, they will be considered less relevant than those containing "),s("code",[e._v("SF")]),e._v(". The reverse is also true.")]),e._v(" "),s("h3",{attrs:{id:"_4-3-three-words-limitation"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-3-three-words-limitation"}},[e._v("#")]),e._v(" 4.3. Three Words Limitation")]),e._v(" "),s("p",[e._v("Multi-word synonyms are limited to a maximum of three words.")]),e._v(" "),s("p",[e._v("For example, although "),s("code",[e._v("League of Legends")]),e._v(" and "),s("code",[e._v("LOL")]),e._v(" can be synonymous, it will not work for "),s("code",[e._v("The Lord of the Rings")]),e._v(" and "),s("code",[e._v("LOTR")]),e._v(".")]),e._v(" "),s("h2",{attrs:{id:"_5-future-possibilities"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_5-future-possibilities"}},[e._v("#")]),e._v(" 5. Future Possibilities")]),e._v(" "),s("ul",[s("li",[e._v("Automatically declare mutual association")])])])}),[],!1,null,null,null);t.default=a.exports}}]); \ No newline at end of file diff --git a/docs/assets/js/5.2065d417.js b/docs/assets/js/5.689b79cc.js similarity index 64% rename from docs/assets/js/5.2065d417.js rename to docs/assets/js/5.689b79cc.js index 275438953..f76022c50 100644 --- a/docs/assets/js/5.2065d417.js +++ b/docs/assets/js/5.689b79cc.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[5],{385:function(t,e,a){},423:function(t,e,a){"use strict";a(385)},430:function(t,e,a){"use strict";a.r(e);var n={name:"CodeBlock",props:{title:{type:String,required:!0},active:{type:Boolean,default:!1}},mounted:function(){this.$parent&&this.$parent.loadTabs&&this.$parent.loadTabs()}},i=(a(423),a(62)),s=Object(i.a)(n,(function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"theme-code-block",class:{"theme-code-block__active":this.active}},[this._t("default")],2)}),[],!1,null,"759a7d02",null);e.default=s.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[5],{387:function(t,e,a){},425:function(t,e,a){"use strict";a(387)},431:function(t,e,a){"use strict";a.r(e);var n={name:"CodeBlock",props:{title:{type:String,required:!0},active:{type:Boolean,default:!1}},mounted:function(){this.$parent&&this.$parent.loadTabs&&this.$parent.loadTabs()}},i=(a(425),a(62)),s=Object(i.a)(n,(function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"theme-code-block",class:{"theme-code-block__active":this.active}},[this._t("default")],2)}),[],!1,null,"759a7d02",null);e.default=s.exports}}]); \ No newline at end of file diff --git a/docs/assets/js/50.e4b54756.js b/docs/assets/js/50.dcf47d3d.js similarity index 99% rename from docs/assets/js/50.e4b54756.js rename to docs/assets/js/50.dcf47d3d.js index bb6fe2986..d394ebbec 100644 --- a/docs/assets/js/50.e4b54756.js +++ b/docs/assets/js/50.dcf47d3d.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[50],{475:function(e,t,i){"use strict";i.r(t);var r=i(62),a=Object(r.a)({},(function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[i("h1",{attrs:{id:"indexes-api"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#indexes-api"}},[e._v("#")]),e._v(" Indexes API")]),e._v(" "),i("h2",{attrs:{id:"_1-summary"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_1-summary"}},[e._v("#")]),e._v(" 1. Summary")]),e._v(" "),i("p",[e._v("This specification describes the indexes API endpoints. The endpoint gives the possibility to get, get all, create, update and delete Meilsearch indexes.")]),e._v(" "),i("h2",{attrs:{id:"_2-motivation"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_2-motivation"}},[e._v("#")]),e._v(" 2. Motivation")]),e._v(" "),i("p",[e._v("N/A")]),e._v(" "),i("h2",{attrs:{id:"_3-functional-specification"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-functional-specification"}},[e._v("#")]),e._v(" 3. Functional Specification")]),e._v(" "),i("p",[e._v("Indexes contain a set of documents in which to search and have their specific settings.")]),e._v(" "),i("p",[e._v("See "),i("RouterLink",{attrs:{to:"/specifications/text/0124-documents-api.html"}},[e._v("Documents API specification")]),e._v(" and "),i("RouterLink",{attrs:{to:"/specifications/text/0123-settings-api.html"}},[e._v("Settings API specification")]),e._v(" for more details.")],1),e._v(" "),i("h3",{attrs:{id:"_3-1-index-api-resource-definition"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-index-api-resource-definition"}},[e._v("#")]),e._v(" 3.1. "),i("code",[e._v("index")]),e._v(" API Resource Definition")]),e._v(" "),i("table",[i("thead",[i("tr",[i("th",[e._v("Field")]),e._v(" "),i("th",[e._v("Type")]),e._v(" "),i("th",[e._v("Required")])])]),e._v(" "),i("tbody",[i("tr",[i("td",[i("a",{attrs:{href:"#311-uid"}},[e._v("uid")])]),e._v(" "),i("td",[e._v("string")]),e._v(" "),i("td",[e._v("True")])]),e._v(" "),i("tr",[i("td",[i("a",{attrs:{href:"#313-primaryKey"}},[e._v("primaryKey")])]),e._v(" "),i("td",[e._v("string / "),i("code",[e._v("null")])]),e._v(" "),i("td",[e._v("False")])]),e._v(" "),i("tr",[i("td",[i("a",{attrs:{href:"#314-createdAt"}},[e._v("createdAt")])]),e._v(" "),i("td",[e._v("string")]),e._v(" "),i("td",[e._v("False")])]),e._v(" "),i("tr",[i("td",[i("a",{attrs:{href:"#315-updatedAt"}},[e._v("updatedAt")])]),e._v(" "),i("td",[e._v("string")]),e._v(" "),i("td",[e._v("False")])])])]),e._v(" "),i("h4",{attrs:{id:"_3-1-1-uid"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-1-uid"}},[e._v("#")]),e._v(" 3.1.1. "),i("code",[e._v("uid")])]),e._v(" "),i("ul",[i("li",[e._v("Type: string")]),e._v(" "),i("li",[e._v("Required: true")])]),e._v(" "),i("p",[e._v("A unique identifier for the index.")]),e._v(" "),i("p",[e._v("This field is mandatory when creating an index and cannot be changed afterwards.")]),e._v(" "),i("p",[e._v("The field "),i("code",[e._v("uid")]),e._v(" can be an integer or a string containing only alphanumeric characters, hyphens (-) and underscores (_).")]),e._v(" "),i("h4",{attrs:{id:"_3-1-2-primarykey"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-2-primarykey"}},[e._v("#")]),e._v(" 3.1.2. "),i("code",[e._v("primaryKey")])]),e._v(" "),i("ul",[i("li",[e._v("Type: string")]),e._v(" "),i("li",[e._v("Required: false")]),e._v(" "),i("li",[e._v("Default: "),i("code",[e._v("null")])])]),e._v(" "),i("p",[e._v("The primary key is the attribute in a document whose value is unique amongst all the other documents.")]),e._v(" "),i("p",[e._v("This field allows bypassing the auto-inference mechanism of the document identifiers.")]),e._v(" "),i("p",[e._v("By default, the "),i("code",[e._v("primaryKey")]),e._v(" will be chosen by the auto-inference mechanism by the engine when a first document is indexed.")]),e._v(" "),i("p",[e._v("Specifying this field tells the engine to use the document attribute specified in "),i("code",[e._v("primaryKey")]),e._v(" and bypasses this mechanism.")]),e._v(" "),i("p",[e._v("When the index is empty, it is possible to modify the "),i("code",[e._v("primaryKey")]),e._v(".")]),e._v(" "),i("h4",{attrs:{id:"_3-1-3-createdat"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-3-createdat"}},[e._v("#")]),e._v(" 3.1.3. "),i("code",[e._v("createdAt")])]),e._v(" "),i("ul",[i("li",[e._v("Type: string")]),e._v(" "),i("li",[e._v("Required: false")])]),e._v(" "),i("p",[e._v("The creation date on which the index has been created.")]),e._v(" "),i("p",[e._v("Automatically generated by the engine at the creation of an index.")]),e._v(" "),i("p",[e._v("Represented with the "),i("code",[e._v("RFC 3339")]),e._v(" format.")]),e._v(" "),i("h4",{attrs:{id:"_3-1-4-updatedat"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-4-updatedat"}},[e._v("#")]),e._v(" 3.1.4. "),i("code",[e._v("updatedAt")])]),e._v(" "),i("ul",[i("li",[e._v("Type: string")]),e._v(" "),i("li",[e._v("Required: false")])]),e._v(" "),i("p",[e._v("The latest date on which the index has been updated.")]),e._v(" "),i("p",[e._v("Automatically generated by the engine at the creation/update of an index.")]),e._v(" "),i("p",[e._v("Represented wih the "),i("code",[e._v("RFC 3339")]),e._v(" format.")]),e._v(" "),i("h3",{attrs:{id:"_3-2-api-endpoints-definition"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-api-endpoints-definition"}},[e._v("#")]),e._v(" 3.2. API Endpoints Definition")]),e._v(" "),i("p",[e._v("Manipulate indexes of a Meilisearch instance.")]),e._v(" "),i("ul",[i("li",[i("a",{attrs:{href:"#321-get---indexes"}},[e._v("3.2.1. "),i("code",[e._v("GET")]),e._v(" - "),i("code",[e._v("indexes")])])]),e._v(" "),i("li",[i("a",{attrs:{href:"#322-get---indexesindexuid"}},[e._v("3.2.2. "),i("code",[e._v("GET")]),e._v(" - "),i("code",[e._v("indexes/:index_uid")])])]),e._v(" "),i("li",[i("a",{attrs:{href:"#323-post---indexes"}},[e._v("3.2.3. "),i("code",[e._v("POST")]),e._v(" - "),i("code",[e._v("indexes")])])]),e._v(" "),i("li",[i("a",{attrs:{href:"#324-patch---indexesindexuid"}},[e._v("3.2.4. "),i("code",[e._v("PATCH")]),e._v(" - "),i("code",[e._v("indexes/:index_uid")])])]),e._v(" "),i("li",[i("a",{attrs:{href:"#325-delete---indexesindexuid"}},[e._v("3.2.5. "),i("code",[e._v("DELETE")]),e._v(" - "),i("code",[e._v("indexes/:index_uid")])])])]),e._v(" "),i("h4",{attrs:{id:"_3-2-1-get-indexes"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-1-get-indexes"}},[e._v("#")]),e._v(" 3.2.1. "),i("code",[e._v("GET")]),e._v(" - "),i("code",[e._v("indexes")])]),e._v(" "),i("p",[e._v("List all indexes of a Meilisearch instance.")]),e._v(" "),i("p",[e._v("The results are sorted in ascending alphanumeric order from the "),i("code",[e._v("uid")]),e._v(" field.")]),e._v(" "),i("h5",{attrs:{id:"_3-2-1-1-query-parameters"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-1-1-query-parameters"}},[e._v("#")]),e._v(" 3.2.1.1. Query Parameters")]),e._v(" "),i("table",[i("thead",[i("tr",[i("th",[e._v("Field")]),e._v(" "),i("th",[e._v("Type")]),e._v(" "),i("th",[e._v("Required")])])]),e._v(" "),i("tbody",[i("tr",[i("td",[i("code",[e._v("offset")])]),e._v(" "),i("td",[e._v("integer / "),i("code",[e._v("null")])]),e._v(" "),i("td",[e._v("false")])]),e._v(" "),i("tr",[i("td",[i("code",[e._v("limit")])]),e._v(" "),i("td",[e._v("integer / "),i("code",[e._v("null")])]),e._v(" "),i("td",[e._v("false")])])])]),e._v(" "),i("h6",{attrs:{id:"_3-2-1-1-1-offset"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-1-1-1-offset"}},[e._v("#")]),e._v(" 3.2.1.1.1. "),i("code",[e._v("offset")])]),e._v(" "),i("ul",[i("li",[e._v("Type: Integer")]),e._v(" "),i("li",[e._v("Required: False")]),e._v(" "),i("li",[e._v("Default: "),i("code",[e._v("0")])])]),e._v(" "),i("p",[e._v("Sets the starting point in the results, effectively skipping over a given number of indexes.")]),e._v(" "),i("h6",{attrs:{id:"_3-2-1-1-2-limit"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-1-1-2-limit"}},[e._v("#")]),e._v(" 3.2.1.1.2. "),i("code",[e._v("limit")])]),e._v(" "),i("ul",[i("li",[e._v("Type: Integer")]),e._v(" "),i("li",[e._v("Required: False")]),e._v(" "),i("li",[e._v("Default: "),i("code",[e._v("20")])])]),e._v(" "),i("p",[e._v("Sets the maximum number of indexes to be returned by the current request.")]),e._v(" "),i("h5",{attrs:{id:"_3-2-1-2-response-definition"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-1-2-response-definition"}},[e._v("#")]),e._v(" 3.2.1.2. Response Definition")]),e._v(" "),i("p",[e._v("An object containing all the indexes.")]),e._v(" "),i("table",[i("thead",[i("tr",[i("th",[e._v("Field")]),e._v(" "),i("th",[e._v("Type")]),e._v(" "),i("th",[e._v("Required")])])]),e._v(" "),i("tbody",[i("tr",[i("td",[i("code",[e._v("results")])]),e._v(" "),i("td",[e._v("Array[Index]")]),e._v(" "),i("td",[e._v("true")])]),e._v(" "),i("tr",[i("td",[i("code",[e._v("offset")])]),e._v(" "),i("td",[e._v("integer")]),e._v(" "),i("td",[e._v("true")])]),e._v(" "),i("tr",[i("td",[i("code",[e._v("limit")])]),e._v(" "),i("td",[e._v("integer")]),e._v(" "),i("td",[e._v("true")])]),e._v(" "),i("tr",[i("td",[i("code",[e._v("total")])]),e._v(" "),i("td",[e._v("integer")]),e._v(" "),i("td",[e._v("true")])])])]),e._v(" "),i("h6",{attrs:{id:"_3-2-1-2-1-results"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-1-2-1-results"}},[e._v("#")]),e._v(" 3.2.1.2.1. "),i("code",[e._v("results")])]),e._v(" "),i("ul",[i("li",[e._v("Type: Array[Index]")]),e._v(" "),i("li",[e._v("Required: True")])]),e._v(" "),i("p",[e._v("An array containing the fetched indexes.")]),e._v(" "),i("h6",{attrs:{id:"_3-2-1-2-2-offset"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-1-2-2-offset"}},[e._v("#")]),e._v(" 3.2.1.2.2. "),i("code",[e._v("offset")])]),e._v(" "),i("ul",[i("li",[e._v("Type: Integer")]),e._v(" "),i("li",[e._v("Required: True")])]),e._v(" "),i("p",[e._v("Gives the "),i("code",[e._v("offset")]),e._v(" parameter used for the query.")]),e._v(" "),i("blockquote",[i("p",[e._v("See "),i("a",{attrs:{href:"#32111-offset"}},[e._v("3.2.1.1.1. "),i("code",[e._v("offset")])]),e._v(" section.")])]),e._v(" "),i("h6",{attrs:{id:"_3-2-1-2-3-limit"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-1-2-3-limit"}},[e._v("#")]),e._v(" 3.2.1.2.3. "),i("code",[e._v("limit")])]),e._v(" "),i("ul",[i("li",[e._v("Type: Integer")]),e._v(" "),i("li",[e._v("Required: True")])]),e._v(" "),i("p",[e._v("Gives the "),i("code",[e._v("limit")]),e._v(" parameter used for the query.")]),e._v(" "),i("blockquote",[i("p",[e._v("See "),i("a",{attrs:{href:"#32112-limit"}},[e._v("3.2.1.1.2. "),i("code",[e._v("limit")])]),e._v(" section.")])]),e._v(" "),i("h6",{attrs:{id:"_3-2-1-2-3-total"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-1-2-3-total"}},[e._v("#")]),e._v(" 3.2.1.2.3. "),i("code",[e._v("total")])]),e._v(" "),i("ul",[i("li",[e._v("Type: Integer")]),e._v(" "),i("li",[e._v("Required: True")])]),e._v(" "),i("p",[e._v("Gives the total number of indexes that can be browsed.")]),e._v(" "),i("h4",{attrs:{id:"_3-2-2-get-indexes-index-uid"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-2-get-indexes-index-uid"}},[e._v("#")]),e._v(" 3.2.2. "),i("code",[e._v("GET")]),e._v(" - "),i("code",[e._v("indexes/:index_uid")])]),e._v(" "),i("p",[e._v("Fetch an index of a Meilisearch instance.")]),e._v(" "),i("h5",{attrs:{id:"_3-2-2-1-response-definition"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-2-1-response-definition"}},[e._v("#")]),e._v(" 3.2.2.1. Response Definition")]),e._v(" "),i("table",[i("thead",[i("tr",[i("th",[e._v("Field")]),e._v(" "),i("th",[e._v("Type")]),e._v(" "),i("th",[e._v("Required")])])]),e._v(" "),i("tbody",[i("tr",[i("td",[i("code",[e._v("uid")])]),e._v(" "),i("td",[e._v("string")]),e._v(" "),i("td",[e._v("true")])]),e._v(" "),i("tr",[i("td",[i("code",[e._v("primaryKey")])]),e._v(" "),i("td",[e._v("string / "),i("code",[e._v("null")])]),e._v(" "),i("td",[e._v("true")])]),e._v(" "),i("tr",[i("td",[i("code",[e._v("createdAt")])]),e._v(" "),i("td",[e._v("string")]),e._v(" "),i("td",[e._v("true")])]),e._v(" "),i("tr",[i("td",[i("code",[e._v("updatedAt")])]),e._v(" "),i("td",[e._v("string")]),e._v(" "),i("td",[e._v("true")])])])]),e._v(" "),i("h5",{attrs:{id:"_3-2-2-2-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-2-2-errors"}},[e._v("#")]),e._v(" 3.2.2.2. Errors")]),e._v(" "),i("ul",[i("li",[e._v("🔴 Sending an invalid index uid format for the "),i("code",[e._v(":index_uid")]),e._v(" path parameter returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_uid"}},[e._v("invalid_index_uid")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 If the requested "),i("code",[e._v("index_uid")]),e._v(" does not exist, the API returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_not_found"}},[e._v("index_not_found")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending a value with a different type than "),i("code",[e._v("Integer")]),e._v(" or "),i("code",[e._v("null")]),e._v(" for "),i("code",[e._v("offset")]),e._v(" will return a "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_offset"}},[e._v("invalid_index_offset")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending a value with a different type than "),i("code",[e._v("Integer")]),e._v(" or "),i("code",[e._v("null")]),e._v(" for "),i("code",[e._v("limit")]),e._v(" will return a "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_limit"}},[e._v("invalid_index_limit")]),e._v(" error.")],1)]),e._v(" "),i("h4",{attrs:{id:"_3-2-3-post-indexes"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-3-post-indexes"}},[e._v("#")]),e._v(" 3.2.3. "),i("code",[e._v("POST")]),e._v(" - "),i("code",[e._v("indexes")])]),e._v(" "),i("p",[e._v("Creates an index.")]),e._v(" "),i("h5",{attrs:{id:"_3-2-3-1-request-payload-definition"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-3-1-request-payload-definition"}},[e._v("#")]),e._v(" 3.2.3.1. Request Payload Definition")]),e._v(" "),i("table",[i("thead",[i("tr",[i("th",[e._v("Field")]),e._v(" "),i("th",[e._v("Type")]),e._v(" "),i("th",[e._v("Required")])])]),e._v(" "),i("tbody",[i("tr",[i("td",[i("code",[e._v("uid")])]),e._v(" "),i("td",[e._v("string")]),e._v(" "),i("td",[e._v("true")])]),e._v(" "),i("tr",[i("td",[i("code",[e._v("primaryKey")])]),e._v(" "),i("td",[e._v("string / "),i("code",[e._v("null")])]),e._v(" "),i("td",[e._v("false")])])])]),e._v(" "),i("h5",{attrs:{id:"_3-2-3-2-response-definition"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-3-2-response-definition"}},[e._v("#")]),e._v(" 3.2.3.2. Response Definition")]),e._v(" "),i("p",[e._v("When the request is successful, Meilisearch returns the HTTP code "),i("code",[e._v("202 Accepted")]),e._v(". The response's content is the summarized representation of the received asynchronous task.")]),e._v(" "),i("p",[e._v("See "),i("RouterLink",{attrs:{to:"/specifications/text/0060-tasks-api.html#summarized-task-object-for-202-accepted"}},[e._v("Summarized "),i("code",[e._v("task")]),e._v(" Object for "),i("code",[e._v("202 Accepted")])]),e._v(".")],1),e._v(" "),i("h5",{attrs:{id:"_3-2-3-3-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-3-3-errors"}},[e._v("#")]),e._v(" 3.2.3.3. Errors")]),e._v(" "),i("ul",[i("li",[e._v("🔴 Omitting Content-Type header returns a "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_content_type"}},[e._v("missing_content_type")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending an empty Content-Type returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_content_type"}},[e._v("invalid_content_type")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending a different Content-Type than "),i("code",[e._v("application/json")]),e._v(" returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_content_type"}},[e._v("invalid_content_type")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending an empty payload returns a "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_payload"}},[e._v("missing_payload")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending an invalid JSON payload returns a "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#malformed_payload"}},[e._v("malformed_payload")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Omitting "),i("code",[e._v("uid")]),e._v(" field from the payload returns a "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_index_uid"}},[e._v("missing_index_uid")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending a value with a different type than "),i("code",[e._v("string")]),e._v(" for "),i("code",[e._v("uid")]),e._v(" will return a "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_uid"}},[e._v("invalid_index_uid")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending an invalid index uid format for "),i("code",[e._v("uid")]),e._v(" returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_uid"}},[e._v("invalid_index_uid")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending a value with a different type than "),i("code",[e._v("string")]),e._v(" or "),i("code",[e._v("null")]),e._v(" for "),i("code",[e._v("primaryKey")]),e._v(" field will return a "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_primary_key"}},[e._v("invalid_index_primary_key")]),e._v(" error.")],1)]),e._v(" "),i("h6",{attrs:{id:"_3-2-3-3-1-async-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-3-3-1-async-errors"}},[e._v("#")]),e._v(" 3.2.3.3.1. Async Errors")]),e._v(" "),i("ul",[i("li",[e._v("🔴 When Meilisearch is secured by a master key, if the API Key used do not have the "),i("code",[e._v("indexes.create")]),e._v(" action defined, the API returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_not_found"}},[e._v("index_not_found")]),e._v(" error in the related asynchronous "),i("code",[e._v("task")]),e._v(" resource. See "),i("a",{attrs:{href:"#3222-response-definition"}},[e._v("3.2.2.2. Response Definition")]),e._v(".")],1),e._v(" "),i("li",[e._v("🔴 Sending a "),i("code",[e._v("uid")]),e._v(" that already exists returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_already_exists"}},[e._v("index_already_exists")]),e._v(" error.")],1)]),e._v(" "),i("h4",{attrs:{id:"_3-2-4-patch-indexes-index-uid"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-patch-indexes-index-uid"}},[e._v("#")]),e._v(" 3.2.4. "),i("code",[e._v("PATCH")]),e._v(" - "),i("code",[e._v("indexes/:index_uid")])]),e._v(" "),i("p",[e._v("Updates an index.")]),e._v(" "),i("p",[e._v("The "),i("code",[e._v("primaryKey")]),e._v(" field can be updated when the index is empty. If the "),i("code",[e._v("primaryKey")]),e._v(" is not defined, the indexing process will try to auto-infer the "),i("code",[e._v("primaryKey")]),e._v(" by searching the first attribute containing "),i("code",[e._v("id")]),e._v(" in the first document payload to index.")]),e._v(" "),i("h5",{attrs:{id:"_3-2-4-1-request-payload-definition"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-1-request-payload-definition"}},[e._v("#")]),e._v(" 3.2.4.1. Request Payload Definition")]),e._v(" "),i("table",[i("thead",[i("tr",[i("th",[e._v("Field")]),e._v(" "),i("th",[e._v("Type")]),e._v(" "),i("th",[e._v("Required")])])]),e._v(" "),i("tbody",[i("tr",[i("td",[i("code",[e._v("primaryKey")])]),e._v(" "),i("td",[e._v("string / "),i("code",[e._v("null")])]),e._v(" "),i("td",[e._v("False")])])])]),e._v(" "),i("h5",{attrs:{id:"_3-2-4-2-response-definition"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-2-response-definition"}},[e._v("#")]),e._v(" 3.2.4.2. Response Definition")]),e._v(" "),i("p",[e._v("When the request is successful, Meilisearch returns the HTTP code "),i("code",[e._v("202 Accepted")]),e._v(". The response's content is the summarized representation of the received asynchronous task.")]),e._v(" "),i("p",[e._v("See "),i("RouterLink",{attrs:{to:"/specifications/text/0060-tasks-api.html#summarized-task-object-for-202-accepted"}},[e._v("Summarized "),i("code",[e._v("task")]),e._v(" Object for "),i("code",[e._v("202 Accepted")])]),e._v(".")],1),e._v(" "),i("h5",{attrs:{id:"_3-2-4-3-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-3-errors"}},[e._v("#")]),e._v(" 3.2.4.3. Errors")]),e._v(" "),i("ul",[i("li",[e._v("🔴 Omitting Content-Type header returns a "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_content_type"}},[e._v("missing_content_type")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending an empty Content-Type returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_content_type"}},[e._v("invalid_content_type")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending a different Content-Type than "),i("code",[e._v("application/json")]),e._v(" returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_content_type"}},[e._v("invalid_content_type")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending an empty payload returns a "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_payload"}},[e._v("missing_payload")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending an invalid JSON payload returns a "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#malformed_payload"}},[e._v("malformed_payload")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending an invalid index uid format for the "),i("code",[e._v(":index_uid")]),e._v(" path parameter returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_uid"}},[e._v("invalid_index_uid")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending "),i("code",[e._v("uid")]),e._v(" in the payload request returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#immutable_index_uid"}},[e._v("immutable_index_uid")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending "),i("code",[e._v("createdAt")]),e._v(" in the payload request returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#immutable_index_created_at"}},[e._v("immutable_created_at")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending "),i("code",[e._v("updatedAt")]),e._v(" in the payload request returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#immutable_index_updated_at"}},[e._v("immutable_updated_at")]),e._v(" error.")],1)]),e._v(" "),i("h6",{attrs:{id:"_3-2-4-3-1-async-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-3-1-async-errors"}},[e._v("#")]),e._v(" 3.2.4.3.1. Async Errors")]),e._v(" "),i("ul",[i("li",[e._v("🔴 When updating the "),i("code",[e._v("primaryKey")]),e._v(", if the previous "),i("code",[e._v("primaryKey")]),e._v(" value has already been used for a document, the API returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_primary_key_already_exists"}},[e._v("index_primary_key_already_exists")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 If the requested "),i("code",[e._v("index_uid")]),e._v(" does not exist, the API returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_not_found"}},[e._v("index_not_found")]),e._v(" error.")],1)]),e._v(" "),i("h4",{attrs:{id:"_3-2-5-delete-indexes-index-uid"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-5-delete-indexes-index-uid"}},[e._v("#")]),e._v(" 3.2.5. "),i("code",[e._v("DELETE")]),e._v(" - "),i("code",[e._v("indexes/:index_uid")])]),e._v(" "),i("p",[e._v("Deletes an index.")]),e._v(" "),i("h5",{attrs:{id:"_3-2-4-1-response-definition"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-1-response-definition"}},[e._v("#")]),e._v(" 3.2.4.1. Response Definition")]),e._v(" "),i("p",[e._v("When the request is successful, Meilisearch returns the HTTP code "),i("code",[e._v("202 Accepted")]),e._v(". The response's content is the summarized representation of the received asynchronous task.")]),e._v(" "),i("p",[e._v("See "),i("RouterLink",{attrs:{to:"/specifications/text/0060-tasks-api.html#summarized-task-object-for-202-accepted"}},[e._v("Summarized "),i("code",[e._v("task")]),e._v(" Object for "),i("code",[e._v("202 Accepted")])]),e._v(".")],1),e._v(" "),i("h5",{attrs:{id:"_3-2-4-2-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-2-errors"}},[e._v("#")]),e._v(" 3.2.4.2. Errors")]),e._v(" "),i("ul",[i("li",[e._v("🔴 Sending an invalid index uid format for the "),i("code",[e._v(":index_uid")]),e._v(" path parameter returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_uid"}},[e._v("invalid_index_uid")]),e._v(" error.")],1)]),e._v(" "),i("h6",{attrs:{id:"_3-2-4-2-1-async-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-2-1-async-errors"}},[e._v("#")]),e._v(" 3.2.4.2.1 Async Errors")]),e._v(" "),i("ul",[i("li",[e._v("🔴 If the requested "),i("code",[e._v("index_uid")]),e._v(" does not exist, the API returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_not_found"}},[e._v("index_not_found")]),e._v(" error.")],1)]),e._v(" "),i("h4",{attrs:{id:"_3-2-6-general-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-6-general-errors"}},[e._v("#")]),e._v(" 3.2.6. General Errors")]),e._v(" "),i("p",[e._v("These errors apply to all endpoints described here.")]),e._v(" "),i("h5",{attrs:{id:"_3-2-6-1-auth-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-6-1-auth-errors"}},[e._v("#")]),e._v(" 3.2.6.1 Auth Errors")]),e._v(" "),i("p",[e._v("The auth layer can return the following errors if Meilisearch is secured (a master-key is defined).")]),e._v(" "),i("ul",[i("li",[e._v("🔴 Accessing this route without the "),i("code",[e._v("Authorization")]),e._v(" header returns a "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_authorization_header"}},[e._v("missing_authorization_header")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Accessing this route with a key that does not have the required permissions (i.e. other than the master-key) returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key"}},[e._v("invalid_api_key")]),e._v(" error.")],1)]),e._v(" "),i("h2",{attrs:{id:"_4-technical-details"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_4-technical-details"}},[e._v("#")]),e._v(" 4. Technical Details")]),e._v(" "),i("ul",[i("li",[e._v("Meilisearch can accommodate an "),i("strong",[e._v("arbitrary number")]),e._v(" of indexes as long as the disk size they take is under 2TiB.")]),e._v(" "),i("li",[e._v("If having indexes bigger than 2TiB, then Meilisearch can still accommodate them as long as the sum of the disk sizes taken by any group of 20 of the existing indexes is below the size of the virtual address space devoted to a process by the OS (around 80 TiB on x64 Linux).")]),e._v(" "),i("li",[e._v("While indexes bigger in size than 2TiB are supported, the performance of making updates to these big indexes might be reduced.")]),e._v(" "),i("li",[e._v("While Meilisearch supports an arbitrary number of indexes, having hundreds of indexes accessed at random will trigger more reads from disk and might be slower, the number of concurrently accessed indexes should be limited if possible. For instance, if requiring multi-tenancy, consider using "),i("RouterLink",{attrs:{to:"/specifications/text/0089-tenant-tokens.html"}},[e._v("tenant tokens")]),e._v(" in a single index rather than creating one index per tenant.")],1)]),e._v(" "),i("h2",{attrs:{id:"_5-future-possibilities"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_5-future-possibilities"}},[e._v("#")]),e._v(" 5. Future Possibilities")]),e._v(" "),i("ul",[i("li",[e._v("Rework the "),i("code",[e._v("primaryKey")]),e._v(" concept")])])])}),[],!1,null,null,null);t.default=a.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[50],{476:function(e,t,i){"use strict";i.r(t);var r=i(62),a=Object(r.a)({},(function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[i("h1",{attrs:{id:"indexes-api"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#indexes-api"}},[e._v("#")]),e._v(" Indexes API")]),e._v(" "),i("h2",{attrs:{id:"_1-summary"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_1-summary"}},[e._v("#")]),e._v(" 1. Summary")]),e._v(" "),i("p",[e._v("This specification describes the indexes API endpoints. The endpoint gives the possibility to get, get all, create, update and delete Meilsearch indexes.")]),e._v(" "),i("h2",{attrs:{id:"_2-motivation"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_2-motivation"}},[e._v("#")]),e._v(" 2. Motivation")]),e._v(" "),i("p",[e._v("N/A")]),e._v(" "),i("h2",{attrs:{id:"_3-functional-specification"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-functional-specification"}},[e._v("#")]),e._v(" 3. Functional Specification")]),e._v(" "),i("p",[e._v("Indexes contain a set of documents in which to search and have their specific settings.")]),e._v(" "),i("p",[e._v("See "),i("RouterLink",{attrs:{to:"/specifications/text/0124-documents-api.html"}},[e._v("Documents API specification")]),e._v(" and "),i("RouterLink",{attrs:{to:"/specifications/text/0123-settings-api.html"}},[e._v("Settings API specification")]),e._v(" for more details.")],1),e._v(" "),i("h3",{attrs:{id:"_3-1-index-api-resource-definition"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-index-api-resource-definition"}},[e._v("#")]),e._v(" 3.1. "),i("code",[e._v("index")]),e._v(" API Resource Definition")]),e._v(" "),i("table",[i("thead",[i("tr",[i("th",[e._v("Field")]),e._v(" "),i("th",[e._v("Type")]),e._v(" "),i("th",[e._v("Required")])])]),e._v(" "),i("tbody",[i("tr",[i("td",[i("a",{attrs:{href:"#311-uid"}},[e._v("uid")])]),e._v(" "),i("td",[e._v("string")]),e._v(" "),i("td",[e._v("True")])]),e._v(" "),i("tr",[i("td",[i("a",{attrs:{href:"#313-primaryKey"}},[e._v("primaryKey")])]),e._v(" "),i("td",[e._v("string / "),i("code",[e._v("null")])]),e._v(" "),i("td",[e._v("False")])]),e._v(" "),i("tr",[i("td",[i("a",{attrs:{href:"#314-createdAt"}},[e._v("createdAt")])]),e._v(" "),i("td",[e._v("string")]),e._v(" "),i("td",[e._v("False")])]),e._v(" "),i("tr",[i("td",[i("a",{attrs:{href:"#315-updatedAt"}},[e._v("updatedAt")])]),e._v(" "),i("td",[e._v("string")]),e._v(" "),i("td",[e._v("False")])])])]),e._v(" "),i("h4",{attrs:{id:"_3-1-1-uid"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-1-uid"}},[e._v("#")]),e._v(" 3.1.1. "),i("code",[e._v("uid")])]),e._v(" "),i("ul",[i("li",[e._v("Type: string")]),e._v(" "),i("li",[e._v("Required: true")])]),e._v(" "),i("p",[e._v("A unique identifier for the index.")]),e._v(" "),i("p",[e._v("This field is mandatory when creating an index and cannot be changed afterwards.")]),e._v(" "),i("p",[e._v("The field "),i("code",[e._v("uid")]),e._v(" can be an integer or a string containing only alphanumeric characters, hyphens (-) and underscores (_).")]),e._v(" "),i("h4",{attrs:{id:"_3-1-2-primarykey"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-2-primarykey"}},[e._v("#")]),e._v(" 3.1.2. "),i("code",[e._v("primaryKey")])]),e._v(" "),i("ul",[i("li",[e._v("Type: string")]),e._v(" "),i("li",[e._v("Required: false")]),e._v(" "),i("li",[e._v("Default: "),i("code",[e._v("null")])])]),e._v(" "),i("p",[e._v("The primary key is the attribute in a document whose value is unique amongst all the other documents.")]),e._v(" "),i("p",[e._v("This field allows bypassing the auto-inference mechanism of the document identifiers.")]),e._v(" "),i("p",[e._v("By default, the "),i("code",[e._v("primaryKey")]),e._v(" will be chosen by the auto-inference mechanism by the engine when a first document is indexed.")]),e._v(" "),i("p",[e._v("Specifying this field tells the engine to use the document attribute specified in "),i("code",[e._v("primaryKey")]),e._v(" and bypasses this mechanism.")]),e._v(" "),i("p",[e._v("When the index is empty, it is possible to modify the "),i("code",[e._v("primaryKey")]),e._v(".")]),e._v(" "),i("h4",{attrs:{id:"_3-1-3-createdat"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-3-createdat"}},[e._v("#")]),e._v(" 3.1.3. "),i("code",[e._v("createdAt")])]),e._v(" "),i("ul",[i("li",[e._v("Type: string")]),e._v(" "),i("li",[e._v("Required: false")])]),e._v(" "),i("p",[e._v("The creation date on which the index has been created.")]),e._v(" "),i("p",[e._v("Automatically generated by the engine at the creation of an index.")]),e._v(" "),i("p",[e._v("Represented with the "),i("code",[e._v("RFC 3339")]),e._v(" format.")]),e._v(" "),i("h4",{attrs:{id:"_3-1-4-updatedat"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-4-updatedat"}},[e._v("#")]),e._v(" 3.1.4. "),i("code",[e._v("updatedAt")])]),e._v(" "),i("ul",[i("li",[e._v("Type: string")]),e._v(" "),i("li",[e._v("Required: false")])]),e._v(" "),i("p",[e._v("The latest date on which the index has been updated.")]),e._v(" "),i("p",[e._v("Automatically generated by the engine at the creation/update of an index.")]),e._v(" "),i("p",[e._v("Represented wih the "),i("code",[e._v("RFC 3339")]),e._v(" format.")]),e._v(" "),i("h3",{attrs:{id:"_3-2-api-endpoints-definition"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-api-endpoints-definition"}},[e._v("#")]),e._v(" 3.2. API Endpoints Definition")]),e._v(" "),i("p",[e._v("Manipulate indexes of a Meilisearch instance.")]),e._v(" "),i("ul",[i("li",[i("a",{attrs:{href:"#321-get---indexes"}},[e._v("3.2.1. "),i("code",[e._v("GET")]),e._v(" - "),i("code",[e._v("indexes")])])]),e._v(" "),i("li",[i("a",{attrs:{href:"#322-get---indexesindexuid"}},[e._v("3.2.2. "),i("code",[e._v("GET")]),e._v(" - "),i("code",[e._v("indexes/:index_uid")])])]),e._v(" "),i("li",[i("a",{attrs:{href:"#323-post---indexes"}},[e._v("3.2.3. "),i("code",[e._v("POST")]),e._v(" - "),i("code",[e._v("indexes")])])]),e._v(" "),i("li",[i("a",{attrs:{href:"#324-patch---indexesindexuid"}},[e._v("3.2.4. "),i("code",[e._v("PATCH")]),e._v(" - "),i("code",[e._v("indexes/:index_uid")])])]),e._v(" "),i("li",[i("a",{attrs:{href:"#325-delete---indexesindexuid"}},[e._v("3.2.5. "),i("code",[e._v("DELETE")]),e._v(" - "),i("code",[e._v("indexes/:index_uid")])])])]),e._v(" "),i("h4",{attrs:{id:"_3-2-1-get-indexes"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-1-get-indexes"}},[e._v("#")]),e._v(" 3.2.1. "),i("code",[e._v("GET")]),e._v(" - "),i("code",[e._v("indexes")])]),e._v(" "),i("p",[e._v("List all indexes of a Meilisearch instance.")]),e._v(" "),i("p",[e._v("The results are sorted in ascending alphanumeric order from the "),i("code",[e._v("uid")]),e._v(" field.")]),e._v(" "),i("h5",{attrs:{id:"_3-2-1-1-query-parameters"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-1-1-query-parameters"}},[e._v("#")]),e._v(" 3.2.1.1. Query Parameters")]),e._v(" "),i("table",[i("thead",[i("tr",[i("th",[e._v("Field")]),e._v(" "),i("th",[e._v("Type")]),e._v(" "),i("th",[e._v("Required")])])]),e._v(" "),i("tbody",[i("tr",[i("td",[i("code",[e._v("offset")])]),e._v(" "),i("td",[e._v("integer / "),i("code",[e._v("null")])]),e._v(" "),i("td",[e._v("false")])]),e._v(" "),i("tr",[i("td",[i("code",[e._v("limit")])]),e._v(" "),i("td",[e._v("integer / "),i("code",[e._v("null")])]),e._v(" "),i("td",[e._v("false")])])])]),e._v(" "),i("h6",{attrs:{id:"_3-2-1-1-1-offset"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-1-1-1-offset"}},[e._v("#")]),e._v(" 3.2.1.1.1. "),i("code",[e._v("offset")])]),e._v(" "),i("ul",[i("li",[e._v("Type: Integer")]),e._v(" "),i("li",[e._v("Required: False")]),e._v(" "),i("li",[e._v("Default: "),i("code",[e._v("0")])])]),e._v(" "),i("p",[e._v("Sets the starting point in the results, effectively skipping over a given number of indexes.")]),e._v(" "),i("h6",{attrs:{id:"_3-2-1-1-2-limit"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-1-1-2-limit"}},[e._v("#")]),e._v(" 3.2.1.1.2. "),i("code",[e._v("limit")])]),e._v(" "),i("ul",[i("li",[e._v("Type: Integer")]),e._v(" "),i("li",[e._v("Required: False")]),e._v(" "),i("li",[e._v("Default: "),i("code",[e._v("20")])])]),e._v(" "),i("p",[e._v("Sets the maximum number of indexes to be returned by the current request.")]),e._v(" "),i("h5",{attrs:{id:"_3-2-1-2-response-definition"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-1-2-response-definition"}},[e._v("#")]),e._v(" 3.2.1.2. Response Definition")]),e._v(" "),i("p",[e._v("An object containing all the indexes.")]),e._v(" "),i("table",[i("thead",[i("tr",[i("th",[e._v("Field")]),e._v(" "),i("th",[e._v("Type")]),e._v(" "),i("th",[e._v("Required")])])]),e._v(" "),i("tbody",[i("tr",[i("td",[i("code",[e._v("results")])]),e._v(" "),i("td",[e._v("Array[Index]")]),e._v(" "),i("td",[e._v("true")])]),e._v(" "),i("tr",[i("td",[i("code",[e._v("offset")])]),e._v(" "),i("td",[e._v("integer")]),e._v(" "),i("td",[e._v("true")])]),e._v(" "),i("tr",[i("td",[i("code",[e._v("limit")])]),e._v(" "),i("td",[e._v("integer")]),e._v(" "),i("td",[e._v("true")])]),e._v(" "),i("tr",[i("td",[i("code",[e._v("total")])]),e._v(" "),i("td",[e._v("integer")]),e._v(" "),i("td",[e._v("true")])])])]),e._v(" "),i("h6",{attrs:{id:"_3-2-1-2-1-results"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-1-2-1-results"}},[e._v("#")]),e._v(" 3.2.1.2.1. "),i("code",[e._v("results")])]),e._v(" "),i("ul",[i("li",[e._v("Type: Array[Index]")]),e._v(" "),i("li",[e._v("Required: True")])]),e._v(" "),i("p",[e._v("An array containing the fetched indexes.")]),e._v(" "),i("h6",{attrs:{id:"_3-2-1-2-2-offset"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-1-2-2-offset"}},[e._v("#")]),e._v(" 3.2.1.2.2. "),i("code",[e._v("offset")])]),e._v(" "),i("ul",[i("li",[e._v("Type: Integer")]),e._v(" "),i("li",[e._v("Required: True")])]),e._v(" "),i("p",[e._v("Gives the "),i("code",[e._v("offset")]),e._v(" parameter used for the query.")]),e._v(" "),i("blockquote",[i("p",[e._v("See "),i("a",{attrs:{href:"#32111-offset"}},[e._v("3.2.1.1.1. "),i("code",[e._v("offset")])]),e._v(" section.")])]),e._v(" "),i("h6",{attrs:{id:"_3-2-1-2-3-limit"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-1-2-3-limit"}},[e._v("#")]),e._v(" 3.2.1.2.3. "),i("code",[e._v("limit")])]),e._v(" "),i("ul",[i("li",[e._v("Type: Integer")]),e._v(" "),i("li",[e._v("Required: True")])]),e._v(" "),i("p",[e._v("Gives the "),i("code",[e._v("limit")]),e._v(" parameter used for the query.")]),e._v(" "),i("blockquote",[i("p",[e._v("See "),i("a",{attrs:{href:"#32112-limit"}},[e._v("3.2.1.1.2. "),i("code",[e._v("limit")])]),e._v(" section.")])]),e._v(" "),i("h6",{attrs:{id:"_3-2-1-2-3-total"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-1-2-3-total"}},[e._v("#")]),e._v(" 3.2.1.2.3. "),i("code",[e._v("total")])]),e._v(" "),i("ul",[i("li",[e._v("Type: Integer")]),e._v(" "),i("li",[e._v("Required: True")])]),e._v(" "),i("p",[e._v("Gives the total number of indexes that can be browsed.")]),e._v(" "),i("h4",{attrs:{id:"_3-2-2-get-indexes-index-uid"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-2-get-indexes-index-uid"}},[e._v("#")]),e._v(" 3.2.2. "),i("code",[e._v("GET")]),e._v(" - "),i("code",[e._v("indexes/:index_uid")])]),e._v(" "),i("p",[e._v("Fetch an index of a Meilisearch instance.")]),e._v(" "),i("h5",{attrs:{id:"_3-2-2-1-response-definition"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-2-1-response-definition"}},[e._v("#")]),e._v(" 3.2.2.1. Response Definition")]),e._v(" "),i("table",[i("thead",[i("tr",[i("th",[e._v("Field")]),e._v(" "),i("th",[e._v("Type")]),e._v(" "),i("th",[e._v("Required")])])]),e._v(" "),i("tbody",[i("tr",[i("td",[i("code",[e._v("uid")])]),e._v(" "),i("td",[e._v("string")]),e._v(" "),i("td",[e._v("true")])]),e._v(" "),i("tr",[i("td",[i("code",[e._v("primaryKey")])]),e._v(" "),i("td",[e._v("string / "),i("code",[e._v("null")])]),e._v(" "),i("td",[e._v("true")])]),e._v(" "),i("tr",[i("td",[i("code",[e._v("createdAt")])]),e._v(" "),i("td",[e._v("string")]),e._v(" "),i("td",[e._v("true")])]),e._v(" "),i("tr",[i("td",[i("code",[e._v("updatedAt")])]),e._v(" "),i("td",[e._v("string")]),e._v(" "),i("td",[e._v("true")])])])]),e._v(" "),i("h5",{attrs:{id:"_3-2-2-2-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-2-2-errors"}},[e._v("#")]),e._v(" 3.2.2.2. Errors")]),e._v(" "),i("ul",[i("li",[e._v("🔴 Sending an invalid index uid format for the "),i("code",[e._v(":index_uid")]),e._v(" path parameter returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_uid"}},[e._v("invalid_index_uid")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 If the requested "),i("code",[e._v("index_uid")]),e._v(" does not exist, the API returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_not_found"}},[e._v("index_not_found")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending a value with a different type than "),i("code",[e._v("Integer")]),e._v(" or "),i("code",[e._v("null")]),e._v(" for "),i("code",[e._v("offset")]),e._v(" will return a "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_offset"}},[e._v("invalid_index_offset")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending a value with a different type than "),i("code",[e._v("Integer")]),e._v(" or "),i("code",[e._v("null")]),e._v(" for "),i("code",[e._v("limit")]),e._v(" will return a "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_limit"}},[e._v("invalid_index_limit")]),e._v(" error.")],1)]),e._v(" "),i("h4",{attrs:{id:"_3-2-3-post-indexes"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-3-post-indexes"}},[e._v("#")]),e._v(" 3.2.3. "),i("code",[e._v("POST")]),e._v(" - "),i("code",[e._v("indexes")])]),e._v(" "),i("p",[e._v("Creates an index.")]),e._v(" "),i("h5",{attrs:{id:"_3-2-3-1-request-payload-definition"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-3-1-request-payload-definition"}},[e._v("#")]),e._v(" 3.2.3.1. Request Payload Definition")]),e._v(" "),i("table",[i("thead",[i("tr",[i("th",[e._v("Field")]),e._v(" "),i("th",[e._v("Type")]),e._v(" "),i("th",[e._v("Required")])])]),e._v(" "),i("tbody",[i("tr",[i("td",[i("code",[e._v("uid")])]),e._v(" "),i("td",[e._v("string")]),e._v(" "),i("td",[e._v("true")])]),e._v(" "),i("tr",[i("td",[i("code",[e._v("primaryKey")])]),e._v(" "),i("td",[e._v("string / "),i("code",[e._v("null")])]),e._v(" "),i("td",[e._v("false")])])])]),e._v(" "),i("h5",{attrs:{id:"_3-2-3-2-response-definition"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-3-2-response-definition"}},[e._v("#")]),e._v(" 3.2.3.2. Response Definition")]),e._v(" "),i("p",[e._v("When the request is successful, Meilisearch returns the HTTP code "),i("code",[e._v("202 Accepted")]),e._v(". The response's content is the summarized representation of the received asynchronous task.")]),e._v(" "),i("p",[e._v("See "),i("RouterLink",{attrs:{to:"/specifications/text/0060-tasks-api.html#summarized-task-object-for-202-accepted"}},[e._v("Summarized "),i("code",[e._v("task")]),e._v(" Object for "),i("code",[e._v("202 Accepted")])]),e._v(".")],1),e._v(" "),i("h5",{attrs:{id:"_3-2-3-3-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-3-3-errors"}},[e._v("#")]),e._v(" 3.2.3.3. Errors")]),e._v(" "),i("ul",[i("li",[e._v("🔴 Omitting Content-Type header returns a "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_content_type"}},[e._v("missing_content_type")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending an empty Content-Type returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_content_type"}},[e._v("invalid_content_type")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending a different Content-Type than "),i("code",[e._v("application/json")]),e._v(" returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_content_type"}},[e._v("invalid_content_type")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending an empty payload returns a "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_payload"}},[e._v("missing_payload")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending an invalid JSON payload returns a "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#malformed_payload"}},[e._v("malformed_payload")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Omitting "),i("code",[e._v("uid")]),e._v(" field from the payload returns a "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_index_uid"}},[e._v("missing_index_uid")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending a value with a different type than "),i("code",[e._v("string")]),e._v(" for "),i("code",[e._v("uid")]),e._v(" will return a "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_uid"}},[e._v("invalid_index_uid")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending an invalid index uid format for "),i("code",[e._v("uid")]),e._v(" returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_uid"}},[e._v("invalid_index_uid")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending a value with a different type than "),i("code",[e._v("string")]),e._v(" or "),i("code",[e._v("null")]),e._v(" for "),i("code",[e._v("primaryKey")]),e._v(" field will return a "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_primary_key"}},[e._v("invalid_index_primary_key")]),e._v(" error.")],1)]),e._v(" "),i("h6",{attrs:{id:"_3-2-3-3-1-async-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-3-3-1-async-errors"}},[e._v("#")]),e._v(" 3.2.3.3.1. Async Errors")]),e._v(" "),i("ul",[i("li",[e._v("🔴 When Meilisearch is secured by a master key, if the API Key used do not have the "),i("code",[e._v("indexes.create")]),e._v(" action defined, the API returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_not_found"}},[e._v("index_not_found")]),e._v(" error in the related asynchronous "),i("code",[e._v("task")]),e._v(" resource. See "),i("a",{attrs:{href:"#3222-response-definition"}},[e._v("3.2.2.2. Response Definition")]),e._v(".")],1),e._v(" "),i("li",[e._v("🔴 Sending a "),i("code",[e._v("uid")]),e._v(" that already exists returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_already_exists"}},[e._v("index_already_exists")]),e._v(" error.")],1)]),e._v(" "),i("h4",{attrs:{id:"_3-2-4-patch-indexes-index-uid"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-patch-indexes-index-uid"}},[e._v("#")]),e._v(" 3.2.4. "),i("code",[e._v("PATCH")]),e._v(" - "),i("code",[e._v("indexes/:index_uid")])]),e._v(" "),i("p",[e._v("Updates an index.")]),e._v(" "),i("p",[e._v("The "),i("code",[e._v("primaryKey")]),e._v(" field can be updated when the index is empty. If the "),i("code",[e._v("primaryKey")]),e._v(" is not defined, the indexing process will try to auto-infer the "),i("code",[e._v("primaryKey")]),e._v(" by searching the first attribute containing "),i("code",[e._v("id")]),e._v(" in the first document payload to index.")]),e._v(" "),i("h5",{attrs:{id:"_3-2-4-1-request-payload-definition"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-1-request-payload-definition"}},[e._v("#")]),e._v(" 3.2.4.1. Request Payload Definition")]),e._v(" "),i("table",[i("thead",[i("tr",[i("th",[e._v("Field")]),e._v(" "),i("th",[e._v("Type")]),e._v(" "),i("th",[e._v("Required")])])]),e._v(" "),i("tbody",[i("tr",[i("td",[i("code",[e._v("primaryKey")])]),e._v(" "),i("td",[e._v("string / "),i("code",[e._v("null")])]),e._v(" "),i("td",[e._v("False")])])])]),e._v(" "),i("h5",{attrs:{id:"_3-2-4-2-response-definition"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-2-response-definition"}},[e._v("#")]),e._v(" 3.2.4.2. Response Definition")]),e._v(" "),i("p",[e._v("When the request is successful, Meilisearch returns the HTTP code "),i("code",[e._v("202 Accepted")]),e._v(". The response's content is the summarized representation of the received asynchronous task.")]),e._v(" "),i("p",[e._v("See "),i("RouterLink",{attrs:{to:"/specifications/text/0060-tasks-api.html#summarized-task-object-for-202-accepted"}},[e._v("Summarized "),i("code",[e._v("task")]),e._v(" Object for "),i("code",[e._v("202 Accepted")])]),e._v(".")],1),e._v(" "),i("h5",{attrs:{id:"_3-2-4-3-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-3-errors"}},[e._v("#")]),e._v(" 3.2.4.3. Errors")]),e._v(" "),i("ul",[i("li",[e._v("🔴 Omitting Content-Type header returns a "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_content_type"}},[e._v("missing_content_type")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending an empty Content-Type returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_content_type"}},[e._v("invalid_content_type")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending a different Content-Type than "),i("code",[e._v("application/json")]),e._v(" returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_content_type"}},[e._v("invalid_content_type")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending an empty payload returns a "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_payload"}},[e._v("missing_payload")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending an invalid JSON payload returns a "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#malformed_payload"}},[e._v("malformed_payload")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending an invalid index uid format for the "),i("code",[e._v(":index_uid")]),e._v(" path parameter returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_uid"}},[e._v("invalid_index_uid")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending "),i("code",[e._v("uid")]),e._v(" in the payload request returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#immutable_index_uid"}},[e._v("immutable_index_uid")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending "),i("code",[e._v("createdAt")]),e._v(" in the payload request returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#immutable_index_created_at"}},[e._v("immutable_created_at")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Sending "),i("code",[e._v("updatedAt")]),e._v(" in the payload request returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#immutable_index_updated_at"}},[e._v("immutable_updated_at")]),e._v(" error.")],1)]),e._v(" "),i("h6",{attrs:{id:"_3-2-4-3-1-async-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-3-1-async-errors"}},[e._v("#")]),e._v(" 3.2.4.3.1. Async Errors")]),e._v(" "),i("ul",[i("li",[e._v("🔴 When updating the "),i("code",[e._v("primaryKey")]),e._v(", if the previous "),i("code",[e._v("primaryKey")]),e._v(" value has already been used for a document, the API returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_primary_key_already_exists"}},[e._v("index_primary_key_already_exists")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 If the requested "),i("code",[e._v("index_uid")]),e._v(" does not exist, the API returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_not_found"}},[e._v("index_not_found")]),e._v(" error.")],1)]),e._v(" "),i("h4",{attrs:{id:"_3-2-5-delete-indexes-index-uid"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-5-delete-indexes-index-uid"}},[e._v("#")]),e._v(" 3.2.5. "),i("code",[e._v("DELETE")]),e._v(" - "),i("code",[e._v("indexes/:index_uid")])]),e._v(" "),i("p",[e._v("Deletes an index.")]),e._v(" "),i("h5",{attrs:{id:"_3-2-4-1-response-definition"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-1-response-definition"}},[e._v("#")]),e._v(" 3.2.4.1. Response Definition")]),e._v(" "),i("p",[e._v("When the request is successful, Meilisearch returns the HTTP code "),i("code",[e._v("202 Accepted")]),e._v(". The response's content is the summarized representation of the received asynchronous task.")]),e._v(" "),i("p",[e._v("See "),i("RouterLink",{attrs:{to:"/specifications/text/0060-tasks-api.html#summarized-task-object-for-202-accepted"}},[e._v("Summarized "),i("code",[e._v("task")]),e._v(" Object for "),i("code",[e._v("202 Accepted")])]),e._v(".")],1),e._v(" "),i("h5",{attrs:{id:"_3-2-4-2-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-2-errors"}},[e._v("#")]),e._v(" 3.2.4.2. Errors")]),e._v(" "),i("ul",[i("li",[e._v("🔴 Sending an invalid index uid format for the "),i("code",[e._v(":index_uid")]),e._v(" path parameter returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_index_uid"}},[e._v("invalid_index_uid")]),e._v(" error.")],1)]),e._v(" "),i("h6",{attrs:{id:"_3-2-4-2-1-async-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-2-1-async-errors"}},[e._v("#")]),e._v(" 3.2.4.2.1 Async Errors")]),e._v(" "),i("ul",[i("li",[e._v("🔴 If the requested "),i("code",[e._v("index_uid")]),e._v(" does not exist, the API returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_not_found"}},[e._v("index_not_found")]),e._v(" error.")],1)]),e._v(" "),i("h4",{attrs:{id:"_3-2-6-general-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-6-general-errors"}},[e._v("#")]),e._v(" 3.2.6. General Errors")]),e._v(" "),i("p",[e._v("These errors apply to all endpoints described here.")]),e._v(" "),i("h5",{attrs:{id:"_3-2-6-1-auth-errors"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-6-1-auth-errors"}},[e._v("#")]),e._v(" 3.2.6.1 Auth Errors")]),e._v(" "),i("p",[e._v("The auth layer can return the following errors if Meilisearch is secured (a master-key is defined).")]),e._v(" "),i("ul",[i("li",[e._v("🔴 Accessing this route without the "),i("code",[e._v("Authorization")]),e._v(" header returns a "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_authorization_header"}},[e._v("missing_authorization_header")]),e._v(" error.")],1),e._v(" "),i("li",[e._v("🔴 Accessing this route with a key that does not have the required permissions (i.e. other than the master-key) returns an "),i("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key"}},[e._v("invalid_api_key")]),e._v(" error.")],1)]),e._v(" "),i("h2",{attrs:{id:"_4-technical-details"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_4-technical-details"}},[e._v("#")]),e._v(" 4. Technical Details")]),e._v(" "),i("ul",[i("li",[e._v("Meilisearch can accommodate an "),i("strong",[e._v("arbitrary number")]),e._v(" of indexes as long as the disk size they take is under 2TiB.")]),e._v(" "),i("li",[e._v("If having indexes bigger than 2TiB, then Meilisearch can still accommodate them as long as the sum of the disk sizes taken by any group of 20 of the existing indexes is below the size of the virtual address space devoted to a process by the OS (around 80 TiB on x64 Linux).")]),e._v(" "),i("li",[e._v("While indexes bigger in size than 2TiB are supported, the performance of making updates to these big indexes might be reduced.")]),e._v(" "),i("li",[e._v("While Meilisearch supports an arbitrary number of indexes, having hundreds of indexes accessed at random will trigger more reads from disk and might be slower, the number of concurrently accessed indexes should be limited if possible. For instance, if requiring multi-tenancy, consider using "),i("RouterLink",{attrs:{to:"/specifications/text/0089-tenant-tokens.html"}},[e._v("tenant tokens")]),e._v(" in a single index rather than creating one index per tenant.")],1)]),e._v(" "),i("h2",{attrs:{id:"_5-future-possibilities"}},[i("a",{staticClass:"header-anchor",attrs:{href:"#_5-future-possibilities"}},[e._v("#")]),e._v(" 5. Future Possibilities")]),e._v(" "),i("ul",[i("li",[e._v("Rework the "),i("code",[e._v("primaryKey")]),e._v(" concept")])])])}),[],!1,null,null,null);t.default=a.exports}}]); \ No newline at end of file diff --git a/docs/assets/js/52.c36008c5.js b/docs/assets/js/52.55ac3382.js similarity index 99% rename from docs/assets/js/52.c36008c5.js rename to docs/assets/js/52.55ac3382.js index 53c0a734e..279037526 100644 --- a/docs/assets/js/52.c36008c5.js +++ b/docs/assets/js/52.55ac3382.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[52],{476:function(t,s,a){"use strict";a.r(s);var e=a(62),n=Object(e.a)({},(function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("ul",[a("li",[t._v("Title: Indexing JSON")]),t._v(" "),a("li",[t._v("Start Date: 2022-08-16")]),t._v(" "),a("li",[t._v("Specification PR: "),a("a",{attrs:{href:"https://github.com/meilisearch/specifications/pull/167",target:"_blank",rel:"noopener noreferrer"}},[t._v("PR-#167"),a("OutboundLink")],1)]),t._v(" "),a("li",[t._v("Discovery Issue: n/a")])]),t._v(" "),a("h1",{attrs:{id:"indexing-json"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#indexing-json"}},[t._v("#")]),t._v(" Indexing JSON")]),t._v(" "),a("h2",{attrs:{id:"_1-functional-specification"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-functional-specification"}},[t._v("#")]),t._v(" 1. Functional Specification")]),t._v(" "),a("h3",{attrs:{id:"i-summary"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#i-summary"}},[t._v("#")]),t._v(" I. Summary")]),t._v(" "),a("p",[t._v("To index documents, the body of the add documents request has to match a specific format. That specific format is then parsed and tokenized inside MeiliSearch. After which, the documents added are in the pool of searchable and returnable documents.")]),t._v(" "),a("p",[t._v("A "),a("a",{attrs:{href:"http://json.org/",target:"_blank",rel:"noopener noreferrer"}},[t._v("JSON"),a("OutboundLink")],1),t._v(" data format is easier to use than a CSV format because it propose a convenient format for storing structured data.\nWhen indexing multiple documents you should prefer using "),a("RouterLink",{attrs:{to:"/specifications/text/0028-indexing-ndjson.html"}},[t._v("ndjson")]),t._v(". It's faster and more concise.")],1),t._v(" "),a("h4",{attrs:{id:"summary-key-points"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#summary-key-points"}},[t._v("#")]),t._v(" Summary Key Points")]),t._v(" "),a("ul",[a("li",[a("code",[t._v("application/json")]),t._v(" Content-Type header is now supported.")]),t._v(" "),a("li",[t._v("The error cases have been strengthened and completed. See Errors part.")])]),t._v(" "),a("h3",{attrs:{id:"ii-explanation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#ii-explanation"}},[t._v("#")]),t._v(" II. Explanation")]),t._v(" "),a("ul",[a("li",[t._v("Meilisearch accept an array of documents")]),t._v(" "),a("li",[t._v("Or a single document.")]),t._v(" "),a("li",[t._v("The data should be encoded in UTF-8.")])]),t._v(" "),a("h4",{attrs:{id:"example-of-a-valid-json"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#example-of-a-valid-json"}},[t._v("#")]),t._v(" Example of a valid JSON")]),t._v(" "),a("p",[t._v('To send the following documents;\n\'\'\'\n{"id":1, "label": "t-shirt", "colors": ["red", "green", "blue"]}\n{"id":499, "label": "hoodie", "colors": ["purple"]}\n\'\'\'')]),t._v(" "),a("p",[t._v("You can send them in an array like that;")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"id"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"label"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"t-shirt"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"colors"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"red"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"green"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"blue"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"id"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("499")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"label"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"hoodie"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"colors"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"purple"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])]),a("p",[t._v("You also have the possibility to format the json however you like. Here is another way to send the two same documents;")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"id"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"label"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"t-shirt"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"colors"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"red"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"green"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"blue"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"id"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("499")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"label"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"hoodie"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"colors"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"purple"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])]),a("p",[t._v("Or you could two requests to send the documents directly;")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"id"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"label"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"t-shirt"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"colors"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"red"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"green"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"blue"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("And")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"id"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("499")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"label"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"hoodie"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"colors"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"purple"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("For example.")]),t._v(" "),a("p",[t._v("/!\\ Be cautious though, if you send the two documents in a single request like that for example;")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"id"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"label"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"t-shirt"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"colors"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"red"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"green"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"blue"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"id"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("499")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"label"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"hoodie"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"colors"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"purple"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("Meilisearch will only index the first document and "),a("strong",[t._v("won't")]),t._v(" throw an error.")]),t._v(" "),a("h4",{attrs:{id:"api-endpoints"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#api-endpoints"}},[t._v("#")]),t._v(" API Endpoints")]),t._v(" "),a("blockquote",[a("p",[t._v("Each API endpoints mentioned above will now require a "),a("code",[t._v("application/json")]),t._v(" as "),a("code",[t._v("Content-Type")]),t._v(" header to be processed as JSON data.")])]),t._v(" "),a("p",[a("strong",[t._v("As a developer, I want to upload a JSON payload of documents so that end-user can search them")])]),t._v(" "),a("p",[a("strong",[t._v("POST documents")]),t._v(" "),a("code",[t._v("/indexes/:indexUid/documents")])]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("curl")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("\n -X POST "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'http://localhost:7700/indexes/movies/documents'")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("\n -H "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Content-Type: application/json'")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("\n --data-binary "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('\'\n [{"id":1, "label": "t-shirt", "price": 4.99, "colors": ["red", "green", "blue"]},{"id":499, "label": "hoodie", "price": 19.99, "colors": ["purple"]}]\'')]),t._v("\n")])])]),a("blockquote",[a("p",[t._v("202 Accepted - Response")])]),t._v(" "),a("p",[a("strong",[t._v("PUT documents")]),t._v(" "),a("code",[t._v("/indexes/:indexUid/documents")])]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("curl")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("\n -X PUT "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'http://localhost:7700/indexes/movies/documents'")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("\n -H "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Content-Type: application/json'")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("\n --data-binary "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('\'\n [{"id":1, "label": "t-shirt", "price": 4.99, "colors": ["red", "green", "blue"]},{"id":499, "label": "hoodie", "price": 19.99, "colors": ["purple"]}]\'')]),t._v("\n")])])]),a("blockquote",[a("p",[t._v("202 Accepted - Response")])]),t._v(" "),a("h5",{attrs:{id:"errors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#errors"}},[t._v("#")]),t._v(" Errors")]),t._v(" "),a("ul",[a("li",[t._v("🔴 Omitted "),a("code",[t._v("Content-Type")]),t._v(" header will lead to a 415 Unsupported Media Type - "),a("strong",[t._v("missing_content_type")]),t._v(" error code.")]),t._v(" "),a("li",[t._v("🔴 Sending an empty "),a("code",[t._v("Content-Type")]),t._v(" will lead to a 415 Unsupported Media Type - "),a("strong",[t._v("invalid_content_type")]),t._v(" error code.")]),t._v(" "),a("li",[t._v("🔴 Sending a different "),a("code",[t._v("Content-Type")]),t._v(" than "),a("code",[t._v("application/json")]),t._v(", "),a("code",[t._v("application/x-ndjson")]),t._v(" or "),a("code",[t._v("text/csv")]),t._v(" will lead to 415 Unsupported Media Type "),a("strong",[t._v("invalid_content_type")]),t._v(" error code.")]),t._v(" "),a("li",[t._v("🔴 Sending an empty payload will lead to a 400 Bad Request - "),a("strong",[t._v("missing_payload")]),t._v(" error code.")]),t._v(" "),a("li",[t._v("🔴 Sending a different payload type than the "),a("code",[t._v("Content-Type")]),t._v(" header should return a 400 Bad Request - "),a("strong",[t._v("malformed_payload")]),t._v(" error code.")]),t._v(" "),a("li",[t._v("🔴 Sending a payload excessing the limit will lead to a 413 Payload Too Large - "),a("strong",[t._v("payload_too_large")]),t._v(" error code.")]),t._v(" "),a("li",[t._v("🔴 Sending an invalid json format will lead to a 400 bad_request - "),a("strong",[t._v("malformed_payload")]),t._v(" error code.")])]),t._v(" "),a("h5",{attrs:{id:"errors-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#errors-definition"}},[t._v("#")]),t._v(" Errors Definition")]),t._v(" "),a("h2",{attrs:{id:"missing-content-type"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#missing-content-type"}},[t._v("#")]),t._v(" missing_content_type")]),t._v(" "),a("h3",{attrs:{id:"context"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#context"}},[t._v("#")]),t._v(" Context")]),t._v(" "),a("p",[t._v("This error occurs when the Content-Type header is missing.")]),t._v(" "),a("h3",{attrs:{id:"error-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#error-definition"}},[t._v("#")]),t._v(" Error Definition")]),t._v(" "),a("p",[t._v("HTTP Code: "),a("code",[t._v("415 Unsupported Media Type")])]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"message"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"A Content-Type header is missing. Accepted values for the Content-Type header are: :contentTypeList"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"missing_content_type"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"invalid_request"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"link"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"https://docs.meilisearch.com/errors#missing_content_type"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("ul",[a("li",[t._v("The "),a("code",[t._v(":contentTypeList")]),t._v(" is inferred when the message is generated. The values are separated by a "),a("code",[t._v(",")]),t._v(" char. e.g. "),a("code",[t._v("application/json")]),t._v(", "),a("code",[t._v("text/csv")]),t._v(".")])]),t._v(" "),a("hr"),t._v(" "),a("h2",{attrs:{id:"invalid-content-type"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#invalid-content-type"}},[t._v("#")]),t._v(" invalid_content_type")]),t._v(" "),a("h3",{attrs:{id:"context-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#context-2"}},[t._v("#")]),t._v(" Context")]),t._v(" "),a("p",[t._v("This error occurs when the provided content-type is not handled by the API method.")]),t._v(" "),a("h3",{attrs:{id:"error-definition-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#error-definition-2"}},[t._v("#")]),t._v(" Error Definition")]),t._v(" "),a("p",[t._v("HTTP Code: "),a("code",[t._v("415 Unsupported Media Type")])]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"message"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"The Content-Type :contentType is invalid. Accepted values for the Content-Type header are: :contentTypeList"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"invalid_content_type"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"invalid_request"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"link"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"https://docs.meilisearch.com/errors#invalid_content_type"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("ul",[a("li",[t._v("The "),a("code",[t._v(":contentTypeList")]),t._v(" is inferred when the message is generated. The values are separated by a "),a("code",[t._v(",")]),t._v(" char. e.g. "),a("code",[t._v("application/json")]),t._v(", "),a("code",[t._v("text/csv")]),t._v(".")])]),t._v(" "),a("hr"),t._v(" "),a("h2",{attrs:{id:"missing-payload"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#missing-payload"}},[t._v("#")]),t._v(" missing_payload")]),t._v(" "),a("h3",{attrs:{id:"context-3"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#context-3"}},[t._v("#")]),t._v(" Context")]),t._v(" "),a("p",[t._v("This error occurs when the client does not provide a mandatory payload to the request.")]),t._v(" "),a("h3",{attrs:{id:"error-definition-3"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#error-definition-3"}},[t._v("#")]),t._v(" Error Definition")]),t._v(" "),a("p",[t._v("HTTP Code: "),a("code",[t._v("400 Bad Request")])]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"message"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"A :payloadType payload is missing."')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"missing_payload"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"invalid_request"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"link"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"https://docs.meilisearch.com/errors#missing_payload"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("ul",[a("li",[t._v("The "),a("code",[t._v(":payloadType")]),t._v(" is inferred when the message is generated. e.g. "),a("code",[t._v("json")]),t._v(", "),a("code",[t._v("ndjson")]),t._v(", "),a("code",[t._v("csv")])])]),t._v(" "),a("hr"),t._v(" "),a("h2",{attrs:{id:"malformed-payload"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#malformed-payload"}},[t._v("#")]),t._v(" malformed_payload")]),t._v(" "),a("h3",{attrs:{id:"context-4"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#context-4"}},[t._v("#")]),t._v(" Context")]),t._v(" "),a("p",[t._v("This error occurs when the format sent in the payload is malformed. The payload contains a syntax error.")]),t._v(" "),a("h3",{attrs:{id:"error-definition-4"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#error-definition-4"}},[t._v("#")]),t._v(" Error Definition")]),t._v(" "),a("p",[t._v("HTTP Code: "),a("code",[t._v("400 Bad Request")])]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"message"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"The :payloadType payload provided is malformed. :syntaxErrorHelper."')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"malformed_payload"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"invalid_request"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"link"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"https://docs.meilisearch.com/errors#malformed_payload"')]),t._v("\n")])])]),a("ul",[a("li",[t._v("The "),a("code",[t._v(":payloadType")]),t._v(" is inferred when the message is generated. e.g. "),a("code",[t._v("json")]),t._v(", "),a("code",[t._v("ndjson")]),t._v(", "),a("code",[t._v("csv")])]),t._v(" "),a("li",[t._v("The "),a("code",[t._v(":syntaxErrorHelper")]),t._v(" is inferred when the message is generated.")])]),t._v(" "),a("hr"),t._v(" "),a("h2",{attrs:{id:"_2-technical-details"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-technical-details"}},[t._v("#")]),t._v(" 2. Technical details")]),t._v(" "),a("p",[t._v("n/a")]),t._v(" "),a("h2",{attrs:{id:"_3-future-possibilities"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-future-possibilities"}},[t._v("#")]),t._v(" 3. Future possibilities")]),t._v(" "),a("ul",[a("li",[t._v("Throw an error when there is multiple documents in the payload but not in an array.")])])])}),[],!1,null,null,null);s.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[52],{475:function(t,s,a){"use strict";a.r(s);var e=a(62),n=Object(e.a)({},(function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("ul",[a("li",[t._v("Title: Indexing JSON")]),t._v(" "),a("li",[t._v("Start Date: 2022-08-16")]),t._v(" "),a("li",[t._v("Specification PR: "),a("a",{attrs:{href:"https://github.com/meilisearch/specifications/pull/167",target:"_blank",rel:"noopener noreferrer"}},[t._v("PR-#167"),a("OutboundLink")],1)]),t._v(" "),a("li",[t._v("Discovery Issue: n/a")])]),t._v(" "),a("h1",{attrs:{id:"indexing-json"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#indexing-json"}},[t._v("#")]),t._v(" Indexing JSON")]),t._v(" "),a("h2",{attrs:{id:"_1-functional-specification"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-functional-specification"}},[t._v("#")]),t._v(" 1. Functional Specification")]),t._v(" "),a("h3",{attrs:{id:"i-summary"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#i-summary"}},[t._v("#")]),t._v(" I. Summary")]),t._v(" "),a("p",[t._v("To index documents, the body of the add documents request has to match a specific format. That specific format is then parsed and tokenized inside MeiliSearch. After which, the documents added are in the pool of searchable and returnable documents.")]),t._v(" "),a("p",[t._v("A "),a("a",{attrs:{href:"http://json.org/",target:"_blank",rel:"noopener noreferrer"}},[t._v("JSON"),a("OutboundLink")],1),t._v(" data format is easier to use than a CSV format because it propose a convenient format for storing structured data.\nWhen indexing multiple documents you should prefer using "),a("RouterLink",{attrs:{to:"/specifications/text/0028-indexing-ndjson.html"}},[t._v("ndjson")]),t._v(". It's faster and more concise.")],1),t._v(" "),a("h4",{attrs:{id:"summary-key-points"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#summary-key-points"}},[t._v("#")]),t._v(" Summary Key Points")]),t._v(" "),a("ul",[a("li",[a("code",[t._v("application/json")]),t._v(" Content-Type header is now supported.")]),t._v(" "),a("li",[t._v("The error cases have been strengthened and completed. See Errors part.")])]),t._v(" "),a("h3",{attrs:{id:"ii-explanation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#ii-explanation"}},[t._v("#")]),t._v(" II. Explanation")]),t._v(" "),a("ul",[a("li",[t._v("Meilisearch accept an array of documents")]),t._v(" "),a("li",[t._v("Or a single document.")]),t._v(" "),a("li",[t._v("The data should be encoded in UTF-8.")])]),t._v(" "),a("h4",{attrs:{id:"example-of-a-valid-json"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#example-of-a-valid-json"}},[t._v("#")]),t._v(" Example of a valid JSON")]),t._v(" "),a("p",[t._v('To send the following documents;\n\'\'\'\n{"id":1, "label": "t-shirt", "colors": ["red", "green", "blue"]}\n{"id":499, "label": "hoodie", "colors": ["purple"]}\n\'\'\'')]),t._v(" "),a("p",[t._v("You can send them in an array like that;")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"id"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"label"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"t-shirt"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"colors"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"red"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"green"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"blue"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"id"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("499")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"label"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"hoodie"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"colors"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"purple"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])]),a("p",[t._v("You also have the possibility to format the json however you like. Here is another way to send the two same documents;")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"id"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"label"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"t-shirt"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"colors"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"red"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"green"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"blue"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"id"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("499")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"label"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"hoodie"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"colors"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"purple"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n")])])]),a("p",[t._v("Or you could two requests to send the documents directly;")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"id"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"label"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"t-shirt"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"colors"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"red"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"green"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"blue"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("And")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"id"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("499")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"label"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"hoodie"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"colors"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"purple"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("For example.")]),t._v(" "),a("p",[t._v("/!\\ Be cautious though, if you send the two documents in a single request like that for example;")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"id"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"label"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"t-shirt"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"colors"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"red"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"green"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"blue"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"id"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("499")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"label"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"hoodie"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"colors"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"purple"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("Meilisearch will only index the first document and "),a("strong",[t._v("won't")]),t._v(" throw an error.")]),t._v(" "),a("h4",{attrs:{id:"api-endpoints"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#api-endpoints"}},[t._v("#")]),t._v(" API Endpoints")]),t._v(" "),a("blockquote",[a("p",[t._v("Each API endpoints mentioned above will now require a "),a("code",[t._v("application/json")]),t._v(" as "),a("code",[t._v("Content-Type")]),t._v(" header to be processed as JSON data.")])]),t._v(" "),a("p",[a("strong",[t._v("As a developer, I want to upload a JSON payload of documents so that end-user can search them")])]),t._v(" "),a("p",[a("strong",[t._v("POST documents")]),t._v(" "),a("code",[t._v("/indexes/:indexUid/documents")])]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("curl")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("\n -X POST "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'http://localhost:7700/indexes/movies/documents'")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("\n -H "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Content-Type: application/json'")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("\n --data-binary "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('\'\n [{"id":1, "label": "t-shirt", "price": 4.99, "colors": ["red", "green", "blue"]},{"id":499, "label": "hoodie", "price": 19.99, "colors": ["purple"]}]\'')]),t._v("\n")])])]),a("blockquote",[a("p",[t._v("202 Accepted - Response")])]),t._v(" "),a("p",[a("strong",[t._v("PUT documents")]),t._v(" "),a("code",[t._v("/indexes/:indexUid/documents")])]),t._v(" "),a("div",{staticClass:"language-bash extra-class"},[a("pre",{pre:!0,attrs:{class:"language-bash"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("curl")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("\n -X PUT "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'http://localhost:7700/indexes/movies/documents'")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("\n -H "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Content-Type: application/json'")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("\\")]),t._v("\n --data-binary "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('\'\n [{"id":1, "label": "t-shirt", "price": 4.99, "colors": ["red", "green", "blue"]},{"id":499, "label": "hoodie", "price": 19.99, "colors": ["purple"]}]\'')]),t._v("\n")])])]),a("blockquote",[a("p",[t._v("202 Accepted - Response")])]),t._v(" "),a("h5",{attrs:{id:"errors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#errors"}},[t._v("#")]),t._v(" Errors")]),t._v(" "),a("ul",[a("li",[t._v("🔴 Omitted "),a("code",[t._v("Content-Type")]),t._v(" header will lead to a 415 Unsupported Media Type - "),a("strong",[t._v("missing_content_type")]),t._v(" error code.")]),t._v(" "),a("li",[t._v("🔴 Sending an empty "),a("code",[t._v("Content-Type")]),t._v(" will lead to a 415 Unsupported Media Type - "),a("strong",[t._v("invalid_content_type")]),t._v(" error code.")]),t._v(" "),a("li",[t._v("🔴 Sending a different "),a("code",[t._v("Content-Type")]),t._v(" than "),a("code",[t._v("application/json")]),t._v(", "),a("code",[t._v("application/x-ndjson")]),t._v(" or "),a("code",[t._v("text/csv")]),t._v(" will lead to 415 Unsupported Media Type "),a("strong",[t._v("invalid_content_type")]),t._v(" error code.")]),t._v(" "),a("li",[t._v("🔴 Sending an empty payload will lead to a 400 Bad Request - "),a("strong",[t._v("missing_payload")]),t._v(" error code.")]),t._v(" "),a("li",[t._v("🔴 Sending a different payload type than the "),a("code",[t._v("Content-Type")]),t._v(" header should return a 400 Bad Request - "),a("strong",[t._v("malformed_payload")]),t._v(" error code.")]),t._v(" "),a("li",[t._v("🔴 Sending a payload excessing the limit will lead to a 413 Payload Too Large - "),a("strong",[t._v("payload_too_large")]),t._v(" error code.")]),t._v(" "),a("li",[t._v("🔴 Sending an invalid json format will lead to a 400 bad_request - "),a("strong",[t._v("malformed_payload")]),t._v(" error code.")])]),t._v(" "),a("h5",{attrs:{id:"errors-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#errors-definition"}},[t._v("#")]),t._v(" Errors Definition")]),t._v(" "),a("h2",{attrs:{id:"missing-content-type"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#missing-content-type"}},[t._v("#")]),t._v(" missing_content_type")]),t._v(" "),a("h3",{attrs:{id:"context"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#context"}},[t._v("#")]),t._v(" Context")]),t._v(" "),a("p",[t._v("This error occurs when the Content-Type header is missing.")]),t._v(" "),a("h3",{attrs:{id:"error-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#error-definition"}},[t._v("#")]),t._v(" Error Definition")]),t._v(" "),a("p",[t._v("HTTP Code: "),a("code",[t._v("415 Unsupported Media Type")])]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"message"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"A Content-Type header is missing. Accepted values for the Content-Type header are: :contentTypeList"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"missing_content_type"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"invalid_request"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"link"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"https://docs.meilisearch.com/errors#missing_content_type"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("ul",[a("li",[t._v("The "),a("code",[t._v(":contentTypeList")]),t._v(" is inferred when the message is generated. The values are separated by a "),a("code",[t._v(",")]),t._v(" char. e.g. "),a("code",[t._v("application/json")]),t._v(", "),a("code",[t._v("text/csv")]),t._v(".")])]),t._v(" "),a("hr"),t._v(" "),a("h2",{attrs:{id:"invalid-content-type"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#invalid-content-type"}},[t._v("#")]),t._v(" invalid_content_type")]),t._v(" "),a("h3",{attrs:{id:"context-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#context-2"}},[t._v("#")]),t._v(" Context")]),t._v(" "),a("p",[t._v("This error occurs when the provided content-type is not handled by the API method.")]),t._v(" "),a("h3",{attrs:{id:"error-definition-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#error-definition-2"}},[t._v("#")]),t._v(" Error Definition")]),t._v(" "),a("p",[t._v("HTTP Code: "),a("code",[t._v("415 Unsupported Media Type")])]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"message"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"The Content-Type :contentType is invalid. Accepted values for the Content-Type header are: :contentTypeList"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"invalid_content_type"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"invalid_request"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"link"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"https://docs.meilisearch.com/errors#invalid_content_type"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("ul",[a("li",[t._v("The "),a("code",[t._v(":contentTypeList")]),t._v(" is inferred when the message is generated. The values are separated by a "),a("code",[t._v(",")]),t._v(" char. e.g. "),a("code",[t._v("application/json")]),t._v(", "),a("code",[t._v("text/csv")]),t._v(".")])]),t._v(" "),a("hr"),t._v(" "),a("h2",{attrs:{id:"missing-payload"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#missing-payload"}},[t._v("#")]),t._v(" missing_payload")]),t._v(" "),a("h3",{attrs:{id:"context-3"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#context-3"}},[t._v("#")]),t._v(" Context")]),t._v(" "),a("p",[t._v("This error occurs when the client does not provide a mandatory payload to the request.")]),t._v(" "),a("h3",{attrs:{id:"error-definition-3"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#error-definition-3"}},[t._v("#")]),t._v(" Error Definition")]),t._v(" "),a("p",[t._v("HTTP Code: "),a("code",[t._v("400 Bad Request")])]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"message"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"A :payloadType payload is missing."')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"missing_payload"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"invalid_request"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"link"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"https://docs.meilisearch.com/errors#missing_payload"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("ul",[a("li",[t._v("The "),a("code",[t._v(":payloadType")]),t._v(" is inferred when the message is generated. e.g. "),a("code",[t._v("json")]),t._v(", "),a("code",[t._v("ndjson")]),t._v(", "),a("code",[t._v("csv")])])]),t._v(" "),a("hr"),t._v(" "),a("h2",{attrs:{id:"malformed-payload"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#malformed-payload"}},[t._v("#")]),t._v(" malformed_payload")]),t._v(" "),a("h3",{attrs:{id:"context-4"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#context-4"}},[t._v("#")]),t._v(" Context")]),t._v(" "),a("p",[t._v("This error occurs when the format sent in the payload is malformed. The payload contains a syntax error.")]),t._v(" "),a("h3",{attrs:{id:"error-definition-4"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#error-definition-4"}},[t._v("#")]),t._v(" Error Definition")]),t._v(" "),a("p",[t._v("HTTP Code: "),a("code",[t._v("400 Bad Request")])]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"message"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"The :payloadType payload provided is malformed. :syntaxErrorHelper."')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"code"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"malformed_payload"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"invalid_request"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"link"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"https://docs.meilisearch.com/errors#malformed_payload"')]),t._v("\n")])])]),a("ul",[a("li",[t._v("The "),a("code",[t._v(":payloadType")]),t._v(" is inferred when the message is generated. e.g. "),a("code",[t._v("json")]),t._v(", "),a("code",[t._v("ndjson")]),t._v(", "),a("code",[t._v("csv")])]),t._v(" "),a("li",[t._v("The "),a("code",[t._v(":syntaxErrorHelper")]),t._v(" is inferred when the message is generated.")])]),t._v(" "),a("hr"),t._v(" "),a("h2",{attrs:{id:"_2-technical-details"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-technical-details"}},[t._v("#")]),t._v(" 2. Technical details")]),t._v(" "),a("p",[t._v("n/a")]),t._v(" "),a("h2",{attrs:{id:"_3-future-possibilities"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-future-possibilities"}},[t._v("#")]),t._v(" 3. Future possibilities")]),t._v(" "),a("ul",[a("li",[t._v("Throw an error when there is multiple documents in the payload but not in an array.")])])])}),[],!1,null,null,null);s.default=n.exports}}]); \ No newline at end of file diff --git a/docs/assets/js/56.a3d19c35.js b/docs/assets/js/56.dfe45e94.js similarity index 99% rename from docs/assets/js/56.a3d19c35.js rename to docs/assets/js/56.dfe45e94.js index 02551afa7..105eaa9ad 100644 --- a/docs/assets/js/56.a3d19c35.js +++ b/docs/assets/js/56.dfe45e94.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[56],{480:function(e,t,s){"use strict";s.r(t);var a=s(62),i=Object(a.a)({},(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[s("h1",{attrs:{id:"metrics-api"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#metrics-api"}},[e._v("#")]),e._v(" Metrics API")]),e._v(" "),s("p",[e._v("This endpoint is currently "),s("RouterLink",{attrs:{to:"/specifications/text/0193-experimental-features.html"}},[e._v("experimental")]),e._v(".")],1),e._v(" "),s("p",[e._v("This means that it can break at any time between two minor versions as long as it is not stabilized.")]),e._v(" "),s("h2",{attrs:{id:"_1-summary"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-summary"}},[e._v("#")]),e._v(" 1. Summary")]),e._v(" "),s("p",[e._v("This specification describes the metrics API endpoint with the exhaustive list of returned metrics.")]),e._v(" "),s("p",[e._v("The endpoint returns observability data to monitor a Meilisearch instance using "),s("a",{attrs:{href:"https://prometheus.io/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Prometheus"),s("OutboundLink")],1),e._v(".")]),e._v(" "),s("h2",{attrs:{id:"_2-motivation"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-motivation"}},[e._v("#")]),e._v(" 2. Motivation")]),e._v(" "),s("p",[e._v("Improve the capabilities of a Meilisearch instance regarding observability and ease its integration into monitoring stacks.")]),e._v(" "),s("h2",{attrs:{id:"_3-functional-specification"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-functional-specification"}},[e._v("#")]),e._v(" 3. Functional Specification")]),e._v(" "),s("h3",{attrs:{id:"_3-1-activating-the-feature"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-activating-the-feature"}},[e._v("#")]),e._v(" 3.1. Activating the feature")]),e._v(" "),s("p",[e._v("By default, the "),s("code",[e._v("/metrics")]),e._v(" endpoint is not accessible. To activate it, the "),s("code",[e._v("--experimental-enable-metrics")]),e._v(" CLI option or "),s("code",[e._v("MEILI_EXPERIMENTAL_ENABLE_METRICS")]),e._v(" env var must be specified at launch. See "),s("RouterLink",{attrs:{to:"/specifications/text/0119-instance-options.html"}},[e._v("Instance Options")])],1),e._v(" "),s("h3",{attrs:{id:"_3-2-metrics-api-resource-definition"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-metrics-api-resource-definition"}},[e._v("#")]),e._v(" 3.2. "),s("code",[e._v("metrics")]),e._v(" API resource definition")]),e._v(" "),s("p",[e._v("Prometheus metrics format is text-based and line-oriented. Lines are separated by a line feed character (n).")]),e._v(" "),s("p",[e._v("A metric is composed of several fields:")]),e._v(" "),s("ul",[s("li",[s("code",[e._v("# HELP")]),e._v(" metadata")]),e._v(" "),s("li",[s("code",[e._v("# TYPE")]),e._v(" metadata")]),e._v(" "),s("li",[e._v("Metric name")]),e._v(" "),s("li",[e._v("Current metric value")])]),e._v(" "),s("p",[e._v("Meilisearch returns the metrics specified in the table below.")]),e._v(" "),s("table",[s("thead",[s("tr",[s("th",[e._v("Name")]),e._v(" "),s("th",[e._v("Type")])])]),e._v(" "),s("tbody",[s("tr",[s("td",[s("a",{attrs:{href:"#321-meilisearch_http_requests_total"}},[s("code",[e._v("meilisearch_http_requests_total")])])]),e._v(" "),s("td",[e._v("counter")])]),e._v(" "),s("tr",[s("td",[s("a",{attrs:{href:"#322-meilisearch_http_response_time_seconds"}},[s("code",[e._v("meilisearch_http_response_time_seconds")])])]),e._v(" "),s("td",[e._v("histogram")])]),e._v(" "),s("tr",[s("td",[s("a",{attrs:{href:"#323-meilisearch_db_size_bytes"}},[s("code",[e._v("meilisearch_db_size_bytes")])])]),e._v(" "),s("td",[e._v("gauge")])]),e._v(" "),s("tr",[s("td",[s("a",{attrs:{href:"#324-meilisearch_used_db_size_bytes"}},[s("code",[e._v("meilisearch_used_db_size_bytes")])])]),e._v(" "),s("td",[e._v("gauge")])]),e._v(" "),s("tr",[s("td",[s("a",{attrs:{href:"#325-meilisearch_index_docs_count"}},[s("code",[e._v("meilisearch_index_docs_count")])])]),e._v(" "),s("td",[e._v("gauge")])]),e._v(" "),s("tr",[s("td",[s("a",{attrs:{href:"#326-meilisearch_index_count"}},[s("code",[e._v("meilisearch_index_count")])])]),e._v(" "),s("td",[e._v("gauge")])]),e._v(" "),s("tr",[s("td",[s("a",{attrs:{href:"#327-meilisearch_nb_tasks"}},[s("code",[e._v("meilisearch_nb_tasks")])])]),e._v(" "),s("td",[e._v("counter")])]),e._v(" "),s("tr",[s("td",[s("a",{attrs:{href:"#328-meilisearch_last_update"}},[s("code",[e._v("meilisearch_last_update")])])]),e._v(" "),s("td",[e._v("gauge")])]),e._v(" "),s("tr",[s("td",[s("a",{attrs:{href:"#329-meilisearch_is_indexing"}},[s("code",[e._v("meilisearch_is_indexing")])])]),e._v(" "),s("td",[e._v("gauge")])])])]),e._v(" "),s("h4",{attrs:{id:"_3-2-1-meilisearch-http-requests-total"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-1-meilisearch-http-requests-total"}},[e._v("#")]),e._v(" 3.2.1 "),s("code",[e._v("meilisearch_http_requests_total")])]),e._v(" "),s("p",[e._v("Returns the number of times an API resource is accessed.")]),e._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v('# HELP http_requests_total HTTP requests total\n# TYPE http_requests_total counter\nmeilisearch_http_requests_total{method=":httpMethod",path=":resourcePath"} :numberOfRequest\n')])])]),s("h4",{attrs:{id:"_3-2-2-meilisearch-http-response-time-seconds"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-2-meilisearch-http-response-time-seconds"}},[e._v("#")]),e._v(" 3.2.2. "),s("code",[e._v("meilisearch_http_response_time_seconds")])]),e._v(" "),s("p",[e._v("Returns a time histogram showing the number of times an API resource call goes into a time bucket (expressed in second).")]),e._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v('# HELP http_response_time_seconds HTTP response times\n# TYPE http_response_time_seconds histogram\nhttp_response_time_seconds_bucket{method=":httpMethod",path=":resourcePath",le="0.0005"} :numberOfRequest\nhttp_response_time_seconds_bucket{method=":httpMethod",path=":resourcePath",le="0.0008"} :numberOfRequest\nhttp_response_time_seconds_bucket{method=":httpMethod",path=":resourcePath",le="0.00085"} :numberOfRequest\nhttp_response_time_seconds_bucket{method=":httpMethod",path=":resourcePath",le="0.0009"} :numberOfRequest\nhttp_response_time_seconds_bucket{method=":httpMethod",path=":resourcePath",le="0.00095"} :numberOfRequest\nhttp_response_time_seconds_bucket{method=":httpMethod",path=":resourcePath",le="0.001"} :numberOfRequest\nhttp_response_time_seconds_bucket{method=":httpMethod",path=":resourcePath",le="0.00105"} :numberOfRequest\nhttp_response_time_seconds_bucket{method=":httpMethod",path=":resourcePath",le="0.0011"} :numberOfRequest\nhttp_response_time_seconds_bucket{method=":httpMethod",path=":resourcePath",le="0.00115"} :numberOfRequest\nhttp_response_time_seconds_bucket{method=":httpMethod",path=":resourcePath",le="0.0012"} :numberOfRequest\nhttp_response_time_seconds_bucket{method=":httpMethod",path=":resourcePath",le="0.0015"} :numberOfRequest\nhttp_response_time_seconds_bucket{method=":httpMethod",path=":resourcePath",le="0.002"} :numberOfRequest\nhttp_response_time_seconds_bucket{method=":httpMethod",path=":resourcePath",le="0.003"} :numberOfRequest\nhttp_response_time_seconds_bucket{method=":httpMethod",path=":resourcePath",le="1"} :numberOfRequest\nhttp_response_time_seconds_bucket{method=":httpMethod",path=":resourcePath",le="+Inf"} :numberOfRequest\nhttp_response_time_seconds_sum{method=":httpMethod",path=":resourcePath"} :numberOfRequest\nmeilisearch_http_response_time_seconds_count{method=":httpMethod",path=":resourcePath"} :numberOfRequest\n')])])]),s("h4",{attrs:{id:"_3-2-3-meilisearch-db-size-bytes"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-3-meilisearch-db-size-bytes"}},[e._v("#")]),e._v(" 3.2.3. "),s("code",[e._v("meilisearch_db_size_bytes")])]),e._v(" "),s("p",[e._v("Returns the “real” size of the database on disk in bytes.\nIt includes all the lmdb memory mapped files plus all the files contained in the "),s("code",[e._v("data.ms")]),e._v(" directory (mainly the updates files that were not processed yet).")]),e._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("# HELP meilisearch_db_size_bytes Meilisearch Db Size In Bytes\n# TYPE meilisearch_db_size_bytes gauge\nmeilisearch_db_size_bytes :databaseSizeInBytes\n")])])]),s("h4",{attrs:{id:"_3-2-4-meilisearch-used-db-size-bytes"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-meilisearch-used-db-size-bytes"}},[e._v("#")]),e._v(" 3.2.4. "),s("code",[e._v("meilisearch_used_db_size_bytes")])]),e._v(" "),s("p",[e._v("Returns the size of the database actually used by meilisearch in bytes.\nInclude all the same files as "),s("code",[e._v("meilisearch_db_size_bytes")]),e._v(" except that when it comes to an LMDB database, we only count the pages used by meilisearch.\nThis means if you see a large gap between both metrics, adding documents will probably re-use freed pages instead of growing "),s("code",[e._v("meilisearch_db_size_bytes")]),e._v(".")]),e._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("# HELP meilisearch_used_db_size_bytes Meilisearch Used DB Size In Bytes\n# TYPE meilisearch_used_db_size_bytes gauge\nmeilisearch_used_db_size_bytes :databaseSizeInBytes\n")])])]),s("h4",{attrs:{id:"_3-2-5-meilisearch-index-docs-count"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-5-meilisearch-index-docs-count"}},[e._v("#")]),e._v(" 3.2.5. "),s("code",[e._v("meilisearch_index_docs_count")])]),e._v(" "),s("p",[e._v("Returns the number of documents for an index.")]),e._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v('# HELP meilisearch_index_docs_count Meilisearch Index Docs Count\n# TYPE meilisearch_index_docs_count gauge\nmeilisearch_index_docs_count{index=":indexUid"} :numberOfDocuments\n')])])]),s("h4",{attrs:{id:"_3-2-6-meilisearch-index-count"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-6-meilisearch-index-count"}},[e._v("#")]),e._v(" 3.2.6. "),s("code",[e._v("meilisearch_index_count")])]),e._v(" "),s("p",[e._v("Returns the total number of indexes for the Meilisearch instance.")]),e._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("# HELP meilisearch_index_count Meilisearch Index Count\n# TYPE meilisearch_index_count gauge\nmeilisearch_index_count :numberOfIndex\n")])])]),s("h4",{attrs:{id:"_3-2-7-meilisearch-nb-tasks"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-7-meilisearch-nb-tasks"}},[e._v("#")]),e._v(" 3.2.7. "),s("code",[e._v("meilisearch_nb_tasks")])]),e._v(" "),s("p",[e._v("Returns the total number of tasks for the Meilisearch instance parametrized by the kind of task and its value (see the table below).")]),e._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v('# HELP meilisearch_nb_tasks Meilisearch Number of tasks\n# TYPE meilisearch_nb_tasks gauge\nmeilisearch_nb_tasks{kind=":kind",value=":value"} :number\n')])])]),s("p",[e._v("Here is a list of available kind and associated values:")]),e._v(" "),s("table",[s("thead",[s("tr",[s("th",[e._v("Kind")]),e._v(" "),s("th",[e._v("values")])])]),e._v(" "),s("tbody",[s("tr",[s("td",[e._v("indexes")]),e._v(" "),s("td",[e._v("Any created indexes")])]),e._v(" "),s("tr",[s("td",[e._v("statuses")]),e._v(" "),s("td",[e._v("Any task statuses (i.e.: succeeded, failed, enqueued, etc...)")])]),e._v(" "),s("tr",[s("td",[e._v("types")]),e._v(" "),s("td",[e._v("Any task types (i.e.: documentAdditionOrUpdate, settingsUpdate, etc...)")])])])]),e._v(" "),s("h4",{attrs:{id:"_3-2-8-meilisearch-last-update"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-8-meilisearch-last-update"}},[e._v("#")]),e._v(" 3.2.8. "),s("code",[e._v("meilisearch_last_update")])]),e._v(" "),s("p",[e._v("Returns the timestamp of the last update.")]),e._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("# HELP meilisearch_last_update Meilisearch Last Update\n# TYPE meilisearch_last_update gauge\nmeilisearch_last_update :unixTimestamp\n")])])]),s("h4",{attrs:{id:"_3-2-8-meilisearch-is-indexing"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-8-meilisearch-is-indexing"}},[e._v("#")]),e._v(" 3.2.8. "),s("code",[e._v("meilisearch_is_indexing")])]),e._v(" "),s("p",[e._v("Returns "),s("code",[e._v("1")]),e._v(" if Meilisearch is indexing or "),s("code",[e._v("0")]),e._v(" if not.")]),e._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("# HELP meilisearch_is_indexing Meilisearch Is Indexing\n# TYPE meilisearch_is_indexing gauge\nmeilisearch_is_indexing :isIndexing\n")])])]),s("h3",{attrs:{id:"_3-3-api-endpoints-definition"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-api-endpoints-definition"}},[e._v("#")]),e._v(" 3.3. API Endpoints Definition")]),e._v(" "),s("h4",{attrs:{id:"_3-3-1-get-metrics"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-1-get-metrics"}},[e._v("#")]),e._v(" 3.3.1. "),s("code",[e._v("GET")]),e._v(" - "),s("code",[e._v("/metrics")])]),e._v(" "),s("p",[e._v("Fetch the metrics of the Meilisearch instance.")]),e._v(" "),s("p",[s("code",[e._v("200")]),e._v(" - Response body example")]),e._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v('# HELP meilisearch_database_size MeiliSearch Stats DbSize\n# TYPE meilisearch_database_size gauge\nmeilisearch_database_size 1097728\n# HELP meilisearch_docs_count MeiliSearch Stats Docs Count\n# TYPE meilisearch_docs_count gauge\nmeilisearch_docs_count{index="movies"} 807\nmeilisearch_docs_count{index="movies_2"} 0\n# HELP meilisearch_total_index MeiliSearch Stats Index Count\n# TYPE meilisearch_total_index gauge\nmeilisearch_total_index 2\n')])])]),s("h4",{attrs:{id:"_3-3-2-errors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-errors"}},[e._v("#")]),e._v(" 3.3.2. Errors")]),e._v(" "),s("ul",[s("li",[e._v("🔴 If "),s("code",[e._v("--experimental-enable-metrics")]),e._v(" CLI option / "),s("code",[e._v("MEILI_EXPERIMENTAL_ENABLE_METRICS")]),e._v(" env var is not specified at launch, the API returns a "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#feature-not-enabled"}},[e._v("feature_not_enabled")]),e._v(" error.")],1)]),e._v(" "),s("h5",{attrs:{id:"_3-3-2-1-auth-errors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-1-auth-errors"}},[e._v("#")]),e._v(" 3.3.2.1 Auth Errors")]),e._v(" "),s("p",[e._v("If a master key is used to secure a Meilisearch instance, the auth layer returns the following errors:")]),e._v(" "),s("ul",[s("li",[e._v("🔴 Accessing this route without the "),s("code",[e._v("Authorization")]),e._v(" header returns a "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_authorization_header"}},[e._v("missing_authorization_header")]),e._v(" error.")],1),e._v(" "),s("li",[e._v("🔴 Accessing this route with a key that does not have the permission "),s("code",[e._v("metrics.get")]),e._v(" (i.e. other than the master key) returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key"}},[e._v("invalid_api_key")]),e._v(" error.")],1),e._v(" "),s("li",[e._v("🔴 Accessing this route with a key that has a restriction on the indexes returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key"}},[e._v("invalid_api_key")]),e._v(" error.")],1)]),e._v(" "),s("h2",{attrs:{id:"_4-technical-details"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-technical-details"}},[e._v("#")]),e._v(" 4. Technical Details")]),e._v(" "),s("p",[e._v("N/A")]),e._v(" "),s("h2",{attrs:{id:"_5-future-possibilities"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_5-future-possibilities"}},[e._v("#")]),e._v(" 5. Future Possibilities")]),e._v(" "),s("ul",[s("li",[e._v("Merge "),s("code",[e._v("/stats")]),e._v(" with "),s("code",[e._v("/metrics")]),e._v(". A header could specify the preferred format. e.g "),s("code",[e._v("application/json")]),e._v(" (similar to actual "),s("code",[e._v("stats")]),e._v(" resource) or "),s("code",[e._v("text/plain")]),e._v(" (Prometheus)")])])])}),[],!1,null,null,null);t.default=i.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[56],{482:function(e,t,s){"use strict";s.r(t);var a=s(62),i=Object(a.a)({},(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[s("h1",{attrs:{id:"metrics-api"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#metrics-api"}},[e._v("#")]),e._v(" Metrics API")]),e._v(" "),s("p",[e._v("This endpoint is currently "),s("RouterLink",{attrs:{to:"/specifications/text/0193-experimental-features.html"}},[e._v("experimental")]),e._v(".")],1),e._v(" "),s("p",[e._v("This means that it can break at any time between two minor versions as long as it is not stabilized.")]),e._v(" "),s("h2",{attrs:{id:"_1-summary"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-summary"}},[e._v("#")]),e._v(" 1. Summary")]),e._v(" "),s("p",[e._v("This specification describes the metrics API endpoint with the exhaustive list of returned metrics.")]),e._v(" "),s("p",[e._v("The endpoint returns observability data to monitor a Meilisearch instance using "),s("a",{attrs:{href:"https://prometheus.io/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Prometheus"),s("OutboundLink")],1),e._v(".")]),e._v(" "),s("h2",{attrs:{id:"_2-motivation"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-motivation"}},[e._v("#")]),e._v(" 2. Motivation")]),e._v(" "),s("p",[e._v("Improve the capabilities of a Meilisearch instance regarding observability and ease its integration into monitoring stacks.")]),e._v(" "),s("h2",{attrs:{id:"_3-functional-specification"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-functional-specification"}},[e._v("#")]),e._v(" 3. Functional Specification")]),e._v(" "),s("h3",{attrs:{id:"_3-1-activating-the-feature"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-activating-the-feature"}},[e._v("#")]),e._v(" 3.1. Activating the feature")]),e._v(" "),s("p",[e._v("By default, the "),s("code",[e._v("/metrics")]),e._v(" endpoint is not accessible. To activate it, the "),s("code",[e._v("--experimental-enable-metrics")]),e._v(" CLI option or "),s("code",[e._v("MEILI_EXPERIMENTAL_ENABLE_METRICS")]),e._v(" env var must be specified at launch. See "),s("RouterLink",{attrs:{to:"/specifications/text/0119-instance-options.html"}},[e._v("Instance Options")])],1),e._v(" "),s("h3",{attrs:{id:"_3-2-metrics-api-resource-definition"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-metrics-api-resource-definition"}},[e._v("#")]),e._v(" 3.2. "),s("code",[e._v("metrics")]),e._v(" API resource definition")]),e._v(" "),s("p",[e._v("Prometheus metrics format is text-based and line-oriented. Lines are separated by a line feed character (n).")]),e._v(" "),s("p",[e._v("A metric is composed of several fields:")]),e._v(" "),s("ul",[s("li",[s("code",[e._v("# HELP")]),e._v(" metadata")]),e._v(" "),s("li",[s("code",[e._v("# TYPE")]),e._v(" metadata")]),e._v(" "),s("li",[e._v("Metric name")]),e._v(" "),s("li",[e._v("Current metric value")])]),e._v(" "),s("p",[e._v("Meilisearch returns the metrics specified in the table below.")]),e._v(" "),s("table",[s("thead",[s("tr",[s("th",[e._v("Name")]),e._v(" "),s("th",[e._v("Type")])])]),e._v(" "),s("tbody",[s("tr",[s("td",[s("a",{attrs:{href:"#321-meilisearch_http_requests_total"}},[s("code",[e._v("meilisearch_http_requests_total")])])]),e._v(" "),s("td",[e._v("counter")])]),e._v(" "),s("tr",[s("td",[s("a",{attrs:{href:"#322-meilisearch_http_response_time_seconds"}},[s("code",[e._v("meilisearch_http_response_time_seconds")])])]),e._v(" "),s("td",[e._v("histogram")])]),e._v(" "),s("tr",[s("td",[s("a",{attrs:{href:"#323-meilisearch_db_size_bytes"}},[s("code",[e._v("meilisearch_db_size_bytes")])])]),e._v(" "),s("td",[e._v("gauge")])]),e._v(" "),s("tr",[s("td",[s("a",{attrs:{href:"#324-meilisearch_used_db_size_bytes"}},[s("code",[e._v("meilisearch_used_db_size_bytes")])])]),e._v(" "),s("td",[e._v("gauge")])]),e._v(" "),s("tr",[s("td",[s("a",{attrs:{href:"#325-meilisearch_index_docs_count"}},[s("code",[e._v("meilisearch_index_docs_count")])])]),e._v(" "),s("td",[e._v("gauge")])]),e._v(" "),s("tr",[s("td",[s("a",{attrs:{href:"#326-meilisearch_index_count"}},[s("code",[e._v("meilisearch_index_count")])])]),e._v(" "),s("td",[e._v("gauge")])]),e._v(" "),s("tr",[s("td",[s("a",{attrs:{href:"#327-meilisearch_nb_tasks"}},[s("code",[e._v("meilisearch_nb_tasks")])])]),e._v(" "),s("td",[e._v("counter")])]),e._v(" "),s("tr",[s("td",[s("a",{attrs:{href:"#328-meilisearch_last_update"}},[s("code",[e._v("meilisearch_last_update")])])]),e._v(" "),s("td",[e._v("gauge")])]),e._v(" "),s("tr",[s("td",[s("a",{attrs:{href:"#329-meilisearch_is_indexing"}},[s("code",[e._v("meilisearch_is_indexing")])])]),e._v(" "),s("td",[e._v("gauge")])])])]),e._v(" "),s("h4",{attrs:{id:"_3-2-1-meilisearch-http-requests-total"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-1-meilisearch-http-requests-total"}},[e._v("#")]),e._v(" 3.2.1 "),s("code",[e._v("meilisearch_http_requests_total")])]),e._v(" "),s("p",[e._v("Returns the number of times an API resource is accessed.")]),e._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v('# HELP http_requests_total HTTP requests total\n# TYPE http_requests_total counter\nmeilisearch_http_requests_total{method=":httpMethod",path=":resourcePath"} :numberOfRequest\n')])])]),s("h4",{attrs:{id:"_3-2-2-meilisearch-http-response-time-seconds"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-2-meilisearch-http-response-time-seconds"}},[e._v("#")]),e._v(" 3.2.2. "),s("code",[e._v("meilisearch_http_response_time_seconds")])]),e._v(" "),s("p",[e._v("Returns a time histogram showing the number of times an API resource call goes into a time bucket (expressed in second).")]),e._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v('# HELP http_response_time_seconds HTTP response times\n# TYPE http_response_time_seconds histogram\nhttp_response_time_seconds_bucket{method=":httpMethod",path=":resourcePath",le="0.0005"} :numberOfRequest\nhttp_response_time_seconds_bucket{method=":httpMethod",path=":resourcePath",le="0.0008"} :numberOfRequest\nhttp_response_time_seconds_bucket{method=":httpMethod",path=":resourcePath",le="0.00085"} :numberOfRequest\nhttp_response_time_seconds_bucket{method=":httpMethod",path=":resourcePath",le="0.0009"} :numberOfRequest\nhttp_response_time_seconds_bucket{method=":httpMethod",path=":resourcePath",le="0.00095"} :numberOfRequest\nhttp_response_time_seconds_bucket{method=":httpMethod",path=":resourcePath",le="0.001"} :numberOfRequest\nhttp_response_time_seconds_bucket{method=":httpMethod",path=":resourcePath",le="0.00105"} :numberOfRequest\nhttp_response_time_seconds_bucket{method=":httpMethod",path=":resourcePath",le="0.0011"} :numberOfRequest\nhttp_response_time_seconds_bucket{method=":httpMethod",path=":resourcePath",le="0.00115"} :numberOfRequest\nhttp_response_time_seconds_bucket{method=":httpMethod",path=":resourcePath",le="0.0012"} :numberOfRequest\nhttp_response_time_seconds_bucket{method=":httpMethod",path=":resourcePath",le="0.0015"} :numberOfRequest\nhttp_response_time_seconds_bucket{method=":httpMethod",path=":resourcePath",le="0.002"} :numberOfRequest\nhttp_response_time_seconds_bucket{method=":httpMethod",path=":resourcePath",le="0.003"} :numberOfRequest\nhttp_response_time_seconds_bucket{method=":httpMethod",path=":resourcePath",le="1"} :numberOfRequest\nhttp_response_time_seconds_bucket{method=":httpMethod",path=":resourcePath",le="+Inf"} :numberOfRequest\nhttp_response_time_seconds_sum{method=":httpMethod",path=":resourcePath"} :numberOfRequest\nmeilisearch_http_response_time_seconds_count{method=":httpMethod",path=":resourcePath"} :numberOfRequest\n')])])]),s("h4",{attrs:{id:"_3-2-3-meilisearch-db-size-bytes"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-3-meilisearch-db-size-bytes"}},[e._v("#")]),e._v(" 3.2.3. "),s("code",[e._v("meilisearch_db_size_bytes")])]),e._v(" "),s("p",[e._v("Returns the “real” size of the database on disk in bytes.\nIt includes all the lmdb memory mapped files plus all the files contained in the "),s("code",[e._v("data.ms")]),e._v(" directory (mainly the updates files that were not processed yet).")]),e._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("# HELP meilisearch_db_size_bytes Meilisearch Db Size In Bytes\n# TYPE meilisearch_db_size_bytes gauge\nmeilisearch_db_size_bytes :databaseSizeInBytes\n")])])]),s("h4",{attrs:{id:"_3-2-4-meilisearch-used-db-size-bytes"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-meilisearch-used-db-size-bytes"}},[e._v("#")]),e._v(" 3.2.4. "),s("code",[e._v("meilisearch_used_db_size_bytes")])]),e._v(" "),s("p",[e._v("Returns the size of the database actually used by meilisearch in bytes.\nInclude all the same files as "),s("code",[e._v("meilisearch_db_size_bytes")]),e._v(" except that when it comes to an LMDB database, we only count the pages used by meilisearch.\nThis means if you see a large gap between both metrics, adding documents will probably re-use freed pages instead of growing "),s("code",[e._v("meilisearch_db_size_bytes")]),e._v(".")]),e._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("# HELP meilisearch_used_db_size_bytes Meilisearch Used DB Size In Bytes\n# TYPE meilisearch_used_db_size_bytes gauge\nmeilisearch_used_db_size_bytes :databaseSizeInBytes\n")])])]),s("h4",{attrs:{id:"_3-2-5-meilisearch-index-docs-count"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-5-meilisearch-index-docs-count"}},[e._v("#")]),e._v(" 3.2.5. "),s("code",[e._v("meilisearch_index_docs_count")])]),e._v(" "),s("p",[e._v("Returns the number of documents for an index.")]),e._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v('# HELP meilisearch_index_docs_count Meilisearch Index Docs Count\n# TYPE meilisearch_index_docs_count gauge\nmeilisearch_index_docs_count{index=":indexUid"} :numberOfDocuments\n')])])]),s("h4",{attrs:{id:"_3-2-6-meilisearch-index-count"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-6-meilisearch-index-count"}},[e._v("#")]),e._v(" 3.2.6. "),s("code",[e._v("meilisearch_index_count")])]),e._v(" "),s("p",[e._v("Returns the total number of indexes for the Meilisearch instance.")]),e._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("# HELP meilisearch_index_count Meilisearch Index Count\n# TYPE meilisearch_index_count gauge\nmeilisearch_index_count :numberOfIndex\n")])])]),s("h4",{attrs:{id:"_3-2-7-meilisearch-nb-tasks"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-7-meilisearch-nb-tasks"}},[e._v("#")]),e._v(" 3.2.7. "),s("code",[e._v("meilisearch_nb_tasks")])]),e._v(" "),s("p",[e._v("Returns the total number of tasks for the Meilisearch instance parametrized by the kind of task and its value (see the table below).")]),e._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v('# HELP meilisearch_nb_tasks Meilisearch Number of tasks\n# TYPE meilisearch_nb_tasks gauge\nmeilisearch_nb_tasks{kind=":kind",value=":value"} :number\n')])])]),s("p",[e._v("Here is a list of available kind and associated values:")]),e._v(" "),s("table",[s("thead",[s("tr",[s("th",[e._v("Kind")]),e._v(" "),s("th",[e._v("values")])])]),e._v(" "),s("tbody",[s("tr",[s("td",[e._v("indexes")]),e._v(" "),s("td",[e._v("Any created indexes")])]),e._v(" "),s("tr",[s("td",[e._v("statuses")]),e._v(" "),s("td",[e._v("Any task statuses (i.e.: succeeded, failed, enqueued, etc...)")])]),e._v(" "),s("tr",[s("td",[e._v("types")]),e._v(" "),s("td",[e._v("Any task types (i.e.: documentAdditionOrUpdate, settingsUpdate, etc...)")])])])]),e._v(" "),s("h4",{attrs:{id:"_3-2-8-meilisearch-last-update"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-8-meilisearch-last-update"}},[e._v("#")]),e._v(" 3.2.8. "),s("code",[e._v("meilisearch_last_update")])]),e._v(" "),s("p",[e._v("Returns the timestamp of the last update.")]),e._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("# HELP meilisearch_last_update Meilisearch Last Update\n# TYPE meilisearch_last_update gauge\nmeilisearch_last_update :unixTimestamp\n")])])]),s("h4",{attrs:{id:"_3-2-8-meilisearch-is-indexing"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-8-meilisearch-is-indexing"}},[e._v("#")]),e._v(" 3.2.8. "),s("code",[e._v("meilisearch_is_indexing")])]),e._v(" "),s("p",[e._v("Returns "),s("code",[e._v("1")]),e._v(" if Meilisearch is indexing or "),s("code",[e._v("0")]),e._v(" if not.")]),e._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v("# HELP meilisearch_is_indexing Meilisearch Is Indexing\n# TYPE meilisearch_is_indexing gauge\nmeilisearch_is_indexing :isIndexing\n")])])]),s("h3",{attrs:{id:"_3-3-api-endpoints-definition"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-api-endpoints-definition"}},[e._v("#")]),e._v(" 3.3. API Endpoints Definition")]),e._v(" "),s("h4",{attrs:{id:"_3-3-1-get-metrics"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-1-get-metrics"}},[e._v("#")]),e._v(" 3.3.1. "),s("code",[e._v("GET")]),e._v(" - "),s("code",[e._v("/metrics")])]),e._v(" "),s("p",[e._v("Fetch the metrics of the Meilisearch instance.")]),e._v(" "),s("p",[s("code",[e._v("200")]),e._v(" - Response body example")]),e._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[e._v('# HELP meilisearch_database_size MeiliSearch Stats DbSize\n# TYPE meilisearch_database_size gauge\nmeilisearch_database_size 1097728\n# HELP meilisearch_docs_count MeiliSearch Stats Docs Count\n# TYPE meilisearch_docs_count gauge\nmeilisearch_docs_count{index="movies"} 807\nmeilisearch_docs_count{index="movies_2"} 0\n# HELP meilisearch_total_index MeiliSearch Stats Index Count\n# TYPE meilisearch_total_index gauge\nmeilisearch_total_index 2\n')])])]),s("h4",{attrs:{id:"_3-3-2-errors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-errors"}},[e._v("#")]),e._v(" 3.3.2. Errors")]),e._v(" "),s("ul",[s("li",[e._v("🔴 If "),s("code",[e._v("--experimental-enable-metrics")]),e._v(" CLI option / "),s("code",[e._v("MEILI_EXPERIMENTAL_ENABLE_METRICS")]),e._v(" env var is not specified at launch, the API returns a "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#feature-not-enabled"}},[e._v("feature_not_enabled")]),e._v(" error.")],1)]),e._v(" "),s("h5",{attrs:{id:"_3-3-2-1-auth-errors"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-2-1-auth-errors"}},[e._v("#")]),e._v(" 3.3.2.1 Auth Errors")]),e._v(" "),s("p",[e._v("If a master key is used to secure a Meilisearch instance, the auth layer returns the following errors:")]),e._v(" "),s("ul",[s("li",[e._v("🔴 Accessing this route without the "),s("code",[e._v("Authorization")]),e._v(" header returns a "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_authorization_header"}},[e._v("missing_authorization_header")]),e._v(" error.")],1),e._v(" "),s("li",[e._v("🔴 Accessing this route with a key that does not have the permission "),s("code",[e._v("metrics.get")]),e._v(" (i.e. other than the master key) returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key"}},[e._v("invalid_api_key")]),e._v(" error.")],1),e._v(" "),s("li",[e._v("🔴 Accessing this route with a key that has a restriction on the indexes returns an "),s("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key"}},[e._v("invalid_api_key")]),e._v(" error.")],1)]),e._v(" "),s("h2",{attrs:{id:"_4-technical-details"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-technical-details"}},[e._v("#")]),e._v(" 4. Technical Details")]),e._v(" "),s("p",[e._v("N/A")]),e._v(" "),s("h2",{attrs:{id:"_5-future-possibilities"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_5-future-possibilities"}},[e._v("#")]),e._v(" 5. Future Possibilities")]),e._v(" "),s("ul",[s("li",[e._v("Merge "),s("code",[e._v("/stats")]),e._v(" with "),s("code",[e._v("/metrics")]),e._v(". A header could specify the preferred format. e.g "),s("code",[e._v("application/json")]),e._v(" (similar to actual "),s("code",[e._v("stats")]),e._v(" resource) or "),s("code",[e._v("text/plain")]),e._v(" (Prometheus)")])])])}),[],!1,null,null,null);t.default=i.exports}}]); \ No newline at end of file diff --git a/docs/assets/js/57.4dbfa071.js b/docs/assets/js/57.6e1d5d7b.js similarity index 97% rename from docs/assets/js/57.4dbfa071.js rename to docs/assets/js/57.6e1d5d7b.js index da19f026d..712603715 100644 --- a/docs/assets/js/57.4dbfa071.js +++ b/docs/assets/js/57.6e1d5d7b.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[57],{483:function(e,t,s){"use strict";s.r(t);var a=s(62),r=Object(a.a)({},(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[s("h1",{attrs:{id:"compression-headers"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#compression-headers"}},[e._v("#")]),e._v(" Compression Headers")]),e._v(" "),s("h2",{attrs:{id:"_1-summary"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-summary"}},[e._v("#")]),e._v(" 1. Summary")]),e._v(" "),s("p",[e._v("Send and receive compressed payload, using the "),s("code",[e._v("Accept-Encoding")]),e._v(" and "),s("code",[e._v("Content-Encoding")]),e._v(" HTTP headers.")]),e._v(" "),s("p",[e._v("Meilisearch supports "),s("code",[e._v("gzip")]),e._v(", "),s("code",[e._v("deflate")]),e._v(" and "),s("code",[e._v("brotli")]),e._v(" compression methods.")]),e._v(" "),s("h2",{attrs:{id:"_2-motivation"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-motivation"}},[e._v("#")]),e._v(" 2. Motivation")]),e._v(" "),s("p",[e._v("Compression HTTP headers can be used to improve transfer speed and to reduce bandwidth consumption by sending/receiving compressed, smaller payload.")]),e._v(" "),s("h2",{attrs:{id:"_3-functional-specification"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-functional-specification"}},[e._v("#")]),e._v(" 3. Functional Specification")]),e._v(" "),s("h3",{attrs:{id:"_3-1-supported-compression-algorithms"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-supported-compression-algorithms"}},[e._v("#")]),e._v(" 3.1. Supported Compression Algorithms")]),e._v(" "),s("table",[s("thead",[s("tr",[s("th",[e._v("name")])])]),e._v(" "),s("tbody",[s("tr",[s("td",[s("code",[e._v("gzip")])])]),e._v(" "),s("tr",[s("td",[s("code",[e._v("br")]),e._v(" (refers to brotli)")])]),e._v(" "),s("tr",[s("td",[s("code",[e._v("deflate")])])])])]),e._v(" "),s("h3",{attrs:{id:"_3-2-sending-a-compressed-payload"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-sending-a-compressed-payload"}},[e._v("#")]),e._v(" 3.2. Sending a compressed payload")]),e._v(" "),s("p",[e._v("Specify the algorithm used to compress the payload being sent to Meilisearch within the "),s("code",[e._v("Content-Encoding")]),e._v(" header.")]),e._v(" "),s("p",[e._v("See "),s("a",{attrs:{href:"https://httpwg.org/specs/rfc9110.html#field.content-encoding",target:"_blank",rel:"noopener noreferrer"}},[e._v("RFC9110"),s("OutboundLink")],1),e._v(".")]),e._v(" "),s("h4",{attrs:{id:"_3-2-1-example-with-gzip"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-1-example-with-gzip"}},[e._v("#")]),e._v(" 3.2.1 Example with "),s("code",[e._v("gzip")])]),e._v(" "),s("p",[s("code",[e._v("cat ~/movies.json | gzip | curl -X POST 'http://localhost:7700/indexes/movies/documents' --data-binary @- -H 'Content-Type: application/json' -H 'Content-Encoding: gzip'")])]),e._v(" "),s("h3",{attrs:{id:"_3-3-receiving-a-compressed-response"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-receiving-a-compressed-response"}},[e._v("#")]),e._v(" 3.3. Receiving a compressed response")]),e._v(" "),s("p",[e._v("Specify to Meilisearch the compression methods to use by order of preference when sending a response to a client within the "),s("code",[e._v("Accept-Encoding")]),e._v(" header.")]),e._v(" "),s("p",[e._v("See "),s("a",{attrs:{href:"https://httpwg.org/specs/rfc9110.html#field.accept-encoding",target:"_blank",rel:"noopener noreferrer"}},[e._v("RFC9110"),s("OutboundLink")],1),e._v(".")]),e._v(" "),s("h4",{attrs:{id:"_3-3-1-example-with-gzip"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-1-example-with-gzip"}},[e._v("#")]),e._v(" 3.3.1. Example with "),s("code",[e._v("gzip")])]),e._v(" "),s("p",[s("code",[e._v("curl -sH 'Accept-encoding: gzip' 'http://localhost:7700/indexes/movies/search' | gunzip -")])]),e._v(" "),s("h2",{attrs:{id:"_4-technical-details"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-technical-details"}},[e._v("#")]),e._v(" 4. Technical Details")]),e._v(" "),s("p",[e._v("N/A")]),e._v(" "),s("h2",{attrs:{id:"_5-future-possibilities"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_5-future-possibilities"}},[e._v("#")]),e._v(" 5. Future Possibilities")]),e._v(" "),s("ul",[s("li",[e._v("Support "),s("code",[e._v("zstd")]),e._v(" compression method.")])])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[57],{480:function(e,t,s){"use strict";s.r(t);var a=s(62),r=Object(a.a)({},(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[s("h1",{attrs:{id:"compression-headers"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#compression-headers"}},[e._v("#")]),e._v(" Compression Headers")]),e._v(" "),s("h2",{attrs:{id:"_1-summary"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_1-summary"}},[e._v("#")]),e._v(" 1. Summary")]),e._v(" "),s("p",[e._v("Send and receive compressed payload, using the "),s("code",[e._v("Accept-Encoding")]),e._v(" and "),s("code",[e._v("Content-Encoding")]),e._v(" HTTP headers.")]),e._v(" "),s("p",[e._v("Meilisearch supports "),s("code",[e._v("gzip")]),e._v(", "),s("code",[e._v("deflate")]),e._v(" and "),s("code",[e._v("brotli")]),e._v(" compression methods.")]),e._v(" "),s("h2",{attrs:{id:"_2-motivation"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_2-motivation"}},[e._v("#")]),e._v(" 2. Motivation")]),e._v(" "),s("p",[e._v("Compression HTTP headers can be used to improve transfer speed and to reduce bandwidth consumption by sending/receiving compressed, smaller payload.")]),e._v(" "),s("h2",{attrs:{id:"_3-functional-specification"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-functional-specification"}},[e._v("#")]),e._v(" 3. Functional Specification")]),e._v(" "),s("h3",{attrs:{id:"_3-1-supported-compression-algorithms"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-supported-compression-algorithms"}},[e._v("#")]),e._v(" 3.1. Supported Compression Algorithms")]),e._v(" "),s("table",[s("thead",[s("tr",[s("th",[e._v("name")])])]),e._v(" "),s("tbody",[s("tr",[s("td",[s("code",[e._v("gzip")])])]),e._v(" "),s("tr",[s("td",[s("code",[e._v("br")]),e._v(" (refers to brotli)")])]),e._v(" "),s("tr",[s("td",[s("code",[e._v("deflate")])])])])]),e._v(" "),s("h3",{attrs:{id:"_3-2-sending-a-compressed-payload"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-sending-a-compressed-payload"}},[e._v("#")]),e._v(" 3.2. Sending a compressed payload")]),e._v(" "),s("p",[e._v("Specify the algorithm used to compress the payload being sent to Meilisearch within the "),s("code",[e._v("Content-Encoding")]),e._v(" header.")]),e._v(" "),s("p",[e._v("See "),s("a",{attrs:{href:"https://httpwg.org/specs/rfc9110.html#field.content-encoding",target:"_blank",rel:"noopener noreferrer"}},[e._v("RFC9110"),s("OutboundLink")],1),e._v(".")]),e._v(" "),s("h4",{attrs:{id:"_3-2-1-example-with-gzip"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-1-example-with-gzip"}},[e._v("#")]),e._v(" 3.2.1 Example with "),s("code",[e._v("gzip")])]),e._v(" "),s("p",[s("code",[e._v("cat ~/movies.json | gzip | curl -X POST 'http://localhost:7700/indexes/movies/documents' --data-binary @- -H 'Content-Type: application/json' -H 'Content-Encoding: gzip'")])]),e._v(" "),s("h3",{attrs:{id:"_3-3-receiving-a-compressed-response"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-receiving-a-compressed-response"}},[e._v("#")]),e._v(" 3.3. Receiving a compressed response")]),e._v(" "),s("p",[e._v("Specify to Meilisearch the compression methods to use by order of preference when sending a response to a client within the "),s("code",[e._v("Accept-Encoding")]),e._v(" header.")]),e._v(" "),s("p",[e._v("See "),s("a",{attrs:{href:"https://httpwg.org/specs/rfc9110.html#field.accept-encoding",target:"_blank",rel:"noopener noreferrer"}},[e._v("RFC9110"),s("OutboundLink")],1),e._v(".")]),e._v(" "),s("h4",{attrs:{id:"_3-3-1-example-with-gzip"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-1-example-with-gzip"}},[e._v("#")]),e._v(" 3.3.1. Example with "),s("code",[e._v("gzip")])]),e._v(" "),s("p",[s("code",[e._v("curl -sH 'Accept-encoding: gzip' 'http://localhost:7700/indexes/movies/search' | gunzip -")])]),e._v(" "),s("h2",{attrs:{id:"_4-technical-details"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_4-technical-details"}},[e._v("#")]),e._v(" 4. Technical Details")]),e._v(" "),s("p",[e._v("N/A")]),e._v(" "),s("h2",{attrs:{id:"_5-future-possibilities"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#_5-future-possibilities"}},[e._v("#")]),e._v(" 5. Future Possibilities")]),e._v(" "),s("ul",[s("li",[e._v("Support "),s("code",[e._v("zstd")]),e._v(" compression method.")])])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file diff --git a/docs/assets/js/59.79acfddd.js b/docs/assets/js/59.a3757b9e.js similarity index 99% rename from docs/assets/js/59.79acfddd.js rename to docs/assets/js/59.a3757b9e.js index 317b460a7..2d79f3b8d 100644 --- a/docs/assets/js/59.79acfddd.js +++ b/docs/assets/js/59.a3757b9e.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[59],{482:function(e,t,a){"use strict";a.r(t);var n=a(62),s=Object(n.a)({},(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[a("h1",{attrs:{id:"swap-indexes-api"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#swap-indexes-api"}},[e._v("#")]),e._v(" Swap Indexes API")]),e._v(" "),a("h2",{attrs:{id:"_1-summary"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-summary"}},[e._v("#")]),e._v(" 1. Summary")]),e._v(" "),a("p",[e._v("The swap indexes API allows to atomically deploy several new versions of indexes without any downtime for the search clients.")]),e._v(" "),a("h2",{attrs:{id:"_2-motivation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-motivation"}},[e._v("#")]),e._v(" 2. Motivation")]),e._v(" "),a("p",[e._v("It's critical to deploy a new version of an index without any downtimes to the search clients. This capability improves the development experience by allowing Meilisearch to better fit into their workflow.")]),e._v(" "),a("h2",{attrs:{id:"_3-functional-specification"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-functional-specification"}},[e._v("#")]),e._v(" 3. Functional Specification")]),e._v(" "),a("h3",{attrs:{id:"_3-1-0-downtime-deployment-workflow"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-0-downtime-deployment-workflow"}},[e._v("#")]),e._v(" 3.1. 0 downtime deployment workflow")]),e._v(" "),a("p",[e._v("A 0 downtime deployment looks like this:")]),e._v(" "),a("ol",[a("li",[e._v("Search clients search on "),a("code",[e._v("indexA")]),e._v(".")]),e._v(" "),a("li",[e._v("The developer builds a new index "),a("code",[e._v("indexB")]),e._v(" representing the new index version to deploy to the search clients.")]),e._v(" "),a("li",[e._v("When "),a("code",[e._v("indexB")]),e._v(" is built and ready to be deployed, the developer sends an indexes swap request to Meilisearch for "),a("code",[e._v("indexA")]),e._v(" and "),a("code",[e._v("indexB")]),e._v(".")]),e._v(" "),a("li",[a("code",[e._v("indexB")]),e._v(" documents, settings and tasks are swapped with "),a("code",[e._v("indexA")]),e._v(".")]),e._v(" "),a("li",[e._v("Search clients search on the updated "),a("code",[e._v("indexA")]),e._v(" without experiencing any downtime.")])]),e._v(" "),a("h3",{attrs:{id:"_3-2-deploying-multiple-new-indexes-versions"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-deploying-multiple-new-indexes-versions"}},[e._v("#")]),e._v(" 3.2. Deploying Multiple New Indexes Versions")]),e._v(" "),a("p",[e._v("The swap API supports multiple swap operations in an atomic fashion.")]),e._v(" "),a("p",[e._v("This means that for a search experience built using multiple indexes, Meilisearch is able to deploy all changes at once and thus clients will access the new version of all indexes at once without any downtime.")]),e._v(" "),a("p",[e._v("There is no need to deploy each new version of indexes one by one.")]),e._v(" "),a("h3",{attrs:{id:"_3-3-enqueued-tasks-after-a-swap-operation-creation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-enqueued-tasks-after-a-swap-operation-creation"}},[e._v("#")]),e._v(" 3.3. Enqueued Tasks After A Swap Operation Creation")]),e._v(" "),a("p",[e._v("Tasks enqueued after an "),a("code",[e._v("indexSwap")]),e._v(" task creation date do not have their "),a("code",[e._v("indexUid")]),e._v(" modified when the "),a("code",[e._v("indexSwap")]),e._v(" will succeed. That is, if they are enqueued on "),a("code",[e._v("indexA")]),e._v(", they will run on the new version of "),a("code",[e._v("indexA")]),e._v(".")]),e._v(" "),a("h3",{attrs:{id:"_3-4-api-endpoints-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-4-api-endpoints-definition"}},[e._v("#")]),e._v(" 3.4. API Endpoints Definition")]),e._v(" "),a("h4",{attrs:{id:"_3-4-1-post-swap-indexes"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-4-1-post-swap-indexes"}},[e._v("#")]),e._v(" 3.4.1. "),a("code",[e._v("POST")]),e._v(" - "),a("code",[e._v("/swap-indexes")])]),e._v(" "),a("p",[e._v("Send one or many indexes swap operation at once.")]),e._v(" "),a("h5",{attrs:{id:"_3-4-1-1-payload-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-4-1-1-payload-definition"}},[e._v("#")]),e._v(" 3.4.1.1. Payload definition")]),e._v(" "),a("p",[e._v("The payload body expects an array of JSON objects representing swap operations.")]),e._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"indexes"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"indexA"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"indexA_new"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"indexes"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"indexB"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"indexB_new"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n")])])]),a("p",[e._v("💡 In the given example, two swap operations will occur at the same time and atomically.")]),e._v(" "),a("p",[a("code",[e._v("indexA")]),e._v(" data will be swapped with "),a("code",[e._v("indexA_new")]),e._v(" data while "),a("code",[e._v("indexB")]),e._v(" data will be swapped with "),a("code",[e._v("indexB_new")]),e._v(" data.")]),e._v(" "),a("blockquote",[a("p",[e._v("Sending "),a("code",[e._v("[]")]),e._v(" is considered valid. No swap transactions will be performed.")])]),e._v(" "),a("h6",{attrs:{id:"swap-object-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#swap-object-definition"}},[e._v("#")]),e._v(" Swap Object Definition")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("Field")]),e._v(" "),a("th",[e._v("Type")]),e._v(" "),a("th",[e._v("Required")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[a("a",{attrs:{href:"#33111-indexes"}},[e._v("indexes")])]),e._v(" "),a("td",[e._v("Array of string representing indexUids")]),e._v(" "),a("td",[e._v("True")])])])]),e._v(" "),a("h6",{attrs:{id:"_3-4-1-1-1-indexes"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-4-1-1-1-indexes"}},[e._v("#")]),e._v(" 3.4.1.1.1. "),a("code",[e._v("indexes")])]),e._v(" "),a("ul",[a("li",[e._v("Type: Array of string")]),e._v(" "),a("li",[e._v("Required: True")])]),e._v(" "),a("p",[e._v("Determines which two indexes should exchange their data for their given swap object.")]),e._v(" "),a("h5",{attrs:{id:"_3-4-1-2-response-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-4-1-2-response-definition"}},[e._v("#")]),e._v(" 3.4.1.2. Response Definition")]),e._v(" "),a("p",[e._v("When the request is in a successful state, Meilisearch returns the HTTP code "),a("code",[e._v("202 Accepted")]),e._v(". The response's content is the summarized representation of the received asynchronous task.")]),e._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"taskUid"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"indexUid"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token null keyword"}},[e._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"enqueued"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"indexSwap"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"enqueuedAt"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"2021-08-12T10:00:00.000000Z"')]),e._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),a("blockquote",[a("p",[e._v("An "),a("code",[e._v("indexSwap")]),e._v(" task is considered a global task; thus "),a("code",[e._v("indexUid")]),e._v(" is null.")])]),e._v(" "),a("p",[e._v("See "),a("RouterLink",{attrs:{to:"/specifications/text/0060-tasks-api.html#summarized-task-object-for-202-accepted"}},[e._v("Summarized "),a("code",[e._v("task")]),e._v(" Object for "),a("code",[e._v("202 Accepted")])]),e._v(".")],1),e._v(" "),a("h5",{attrs:{id:"_3-4-1-3-errors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-4-1-3-errors"}},[e._v("#")]),e._v(" 3.4.1.3. Errors")]),e._v(" "),a("h6",{attrs:{id:"_3-4-1-3-1-synchronous-errors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-4-1-3-1-synchronous-errors"}},[e._v("#")]),e._v(" 3.4.1.3.1. Synchronous Errors")]),e._v(" "),a("ul",[a("li",[e._v("🔴 If the instance is secured by a master key, accessing this route without the "),a("code",[e._v("Authorization")]),e._v(" header returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_authorization_header"}},[e._v("missing_authorization_header")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 If the instance is secured by a master key, accessing this route with a key that does not have permissions (missing "),a("code",[e._v("indexes.swap")]),e._v(" action or having a value for the "),a("code",[e._v("indexes")]),e._v(" field of a swap operation not being defined in the API Key "),a("code",[e._v("indexes")]),e._v(" array) (i.e. other than the master key) returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key"}},[e._v("invalid_api_key")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Omitting Content-Type header returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_content_type"}},[e._v("missing_content_type")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending an empty Content-Type returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_content_type"}},[e._v("invalid_content_type")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending a different Content-Type than "),a("code",[e._v("application/json")]),e._v(" returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_content_type"}},[e._v("invalid_content_type")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending an empty payload returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_payload"}},[e._v("missing_payload")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending an invalid JSON payload returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#malformed_payload"}},[e._v("malformed_payload")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Omitting the "),a("code",[e._v("indexes")]),e._v(" array in a swap payload returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_swap_indexes"}},[e._v("missing_swap_indexes")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending an "),a("code",[e._v("indexes")]),e._v(" array containing an invalid index uid format returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_swap_indexes"}},[e._v("invalid_swap_indexes")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending an "),a("code",[e._v("indexes")]),e._v(" array not containing "),a("strong",[e._v("exactly")]),e._v(" 2 indexUids for a swap operation object returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_swap_indexes"}},[e._v("invalid_swap_indexes")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending an indexUid more than once in the request payload returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_swap_duplicate_index_found"}},[e._v("invalid_swap_duplicate_index_found")]),e._v(" error.")],1)]),e._v(" "),a("h6",{attrs:{id:"_3-4-1-3-2-asynchronous-errors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-4-1-3-2-asynchronous-errors"}},[e._v("#")]),e._v(" 3.4.1.3.2. Asynchronous Errors")]),e._v(" "),a("ul",[a("li",[e._v("🔴 Sending indexUids that do not exist within the "),a("code",[e._v("indexes")]),e._v(" field of a swap operation returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_not_found"}},[e._v("index_not_found")]),e._v(" error.")],1)]),e._v(" "),a("h2",{attrs:{id:"_4-technical-details"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-technical-details"}},[e._v("#")]),e._v(" 4. Technical Details")]),e._v(" "),a("h3",{attrs:{id:"_4-1-swapping-data"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-swapping-data"}},[e._v("#")]),e._v(" 4.1. Swapping Data")]),e._v(" "),a("p",[e._v("When indexes are swapped their data is exchanged. It concerns:")]),e._v(" "),a("ul",[a("li",[e._v("The documents")]),e._v(" "),a("li",[e._v("The settings")]),e._v(" "),a("li",[e._v("The tasks history\n"),a("ul",[a("li",[e._v("An index swap between index_a and index_b will also replace every mention of index_a by index_b (and vice-versa) in the task history. Enqueued tasks are left unmodified.")])])])]),e._v(" "),a("h2",{attrs:{id:"_5-future-possibilities"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-future-possibilities"}},[e._v("#")]),e._v(" 5. Future Possibilities")]),e._v(" "),a("ul",[a("li",[e._v("Introduce a way to delete one of the swapped indexes when the swap operation occurs.")])])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[59],{483:function(e,t,a){"use strict";a.r(t);var n=a(62),s=Object(n.a)({},(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[a("h1",{attrs:{id:"swap-indexes-api"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#swap-indexes-api"}},[e._v("#")]),e._v(" Swap Indexes API")]),e._v(" "),a("h2",{attrs:{id:"_1-summary"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-summary"}},[e._v("#")]),e._v(" 1. Summary")]),e._v(" "),a("p",[e._v("The swap indexes API allows to atomically deploy several new versions of indexes without any downtime for the search clients.")]),e._v(" "),a("h2",{attrs:{id:"_2-motivation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-motivation"}},[e._v("#")]),e._v(" 2. Motivation")]),e._v(" "),a("p",[e._v("It's critical to deploy a new version of an index without any downtimes to the search clients. This capability improves the development experience by allowing Meilisearch to better fit into their workflow.")]),e._v(" "),a("h2",{attrs:{id:"_3-functional-specification"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-functional-specification"}},[e._v("#")]),e._v(" 3. Functional Specification")]),e._v(" "),a("h3",{attrs:{id:"_3-1-0-downtime-deployment-workflow"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-0-downtime-deployment-workflow"}},[e._v("#")]),e._v(" 3.1. 0 downtime deployment workflow")]),e._v(" "),a("p",[e._v("A 0 downtime deployment looks like this:")]),e._v(" "),a("ol",[a("li",[e._v("Search clients search on "),a("code",[e._v("indexA")]),e._v(".")]),e._v(" "),a("li",[e._v("The developer builds a new index "),a("code",[e._v("indexB")]),e._v(" representing the new index version to deploy to the search clients.")]),e._v(" "),a("li",[e._v("When "),a("code",[e._v("indexB")]),e._v(" is built and ready to be deployed, the developer sends an indexes swap request to Meilisearch for "),a("code",[e._v("indexA")]),e._v(" and "),a("code",[e._v("indexB")]),e._v(".")]),e._v(" "),a("li",[a("code",[e._v("indexB")]),e._v(" documents, settings and tasks are swapped with "),a("code",[e._v("indexA")]),e._v(".")]),e._v(" "),a("li",[e._v("Search clients search on the updated "),a("code",[e._v("indexA")]),e._v(" without experiencing any downtime.")])]),e._v(" "),a("h3",{attrs:{id:"_3-2-deploying-multiple-new-indexes-versions"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-deploying-multiple-new-indexes-versions"}},[e._v("#")]),e._v(" 3.2. Deploying Multiple New Indexes Versions")]),e._v(" "),a("p",[e._v("The swap API supports multiple swap operations in an atomic fashion.")]),e._v(" "),a("p",[e._v("This means that for a search experience built using multiple indexes, Meilisearch is able to deploy all changes at once and thus clients will access the new version of all indexes at once without any downtime.")]),e._v(" "),a("p",[e._v("There is no need to deploy each new version of indexes one by one.")]),e._v(" "),a("h3",{attrs:{id:"_3-3-enqueued-tasks-after-a-swap-operation-creation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-3-enqueued-tasks-after-a-swap-operation-creation"}},[e._v("#")]),e._v(" 3.3. Enqueued Tasks After A Swap Operation Creation")]),e._v(" "),a("p",[e._v("Tasks enqueued after an "),a("code",[e._v("indexSwap")]),e._v(" task creation date do not have their "),a("code",[e._v("indexUid")]),e._v(" modified when the "),a("code",[e._v("indexSwap")]),e._v(" will succeed. That is, if they are enqueued on "),a("code",[e._v("indexA")]),e._v(", they will run on the new version of "),a("code",[e._v("indexA")]),e._v(".")]),e._v(" "),a("h3",{attrs:{id:"_3-4-api-endpoints-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-4-api-endpoints-definition"}},[e._v("#")]),e._v(" 3.4. API Endpoints Definition")]),e._v(" "),a("h4",{attrs:{id:"_3-4-1-post-swap-indexes"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-4-1-post-swap-indexes"}},[e._v("#")]),e._v(" 3.4.1. "),a("code",[e._v("POST")]),e._v(" - "),a("code",[e._v("/swap-indexes")])]),e._v(" "),a("p",[e._v("Send one or many indexes swap operation at once.")]),e._v(" "),a("h5",{attrs:{id:"_3-4-1-1-payload-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-4-1-1-payload-definition"}},[e._v("#")]),e._v(" 3.4.1.1. Payload definition")]),e._v(" "),a("p",[e._v("The payload body expects an array of JSON objects representing swap operations.")]),e._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"indexes"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"indexA"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"indexA_new"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"indexes"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"indexB"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"indexB_new"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("]")]),e._v("\n")])])]),a("p",[e._v("💡 In the given example, two swap operations will occur at the same time and atomically.")]),e._v(" "),a("p",[a("code",[e._v("indexA")]),e._v(" data will be swapped with "),a("code",[e._v("indexA_new")]),e._v(" data while "),a("code",[e._v("indexB")]),e._v(" data will be swapped with "),a("code",[e._v("indexB_new")]),e._v(" data.")]),e._v(" "),a("blockquote",[a("p",[e._v("Sending "),a("code",[e._v("[]")]),e._v(" is considered valid. No swap transactions will be performed.")])]),e._v(" "),a("h6",{attrs:{id:"swap-object-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#swap-object-definition"}},[e._v("#")]),e._v(" Swap Object Definition")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("Field")]),e._v(" "),a("th",[e._v("Type")]),e._v(" "),a("th",[e._v("Required")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[a("a",{attrs:{href:"#33111-indexes"}},[e._v("indexes")])]),e._v(" "),a("td",[e._v("Array of string representing indexUids")]),e._v(" "),a("td",[e._v("True")])])])]),e._v(" "),a("h6",{attrs:{id:"_3-4-1-1-1-indexes"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-4-1-1-1-indexes"}},[e._v("#")]),e._v(" 3.4.1.1.1. "),a("code",[e._v("indexes")])]),e._v(" "),a("ul",[a("li",[e._v("Type: Array of string")]),e._v(" "),a("li",[e._v("Required: True")])]),e._v(" "),a("p",[e._v("Determines which two indexes should exchange their data for their given swap object.")]),e._v(" "),a("h5",{attrs:{id:"_3-4-1-2-response-definition"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-4-1-2-response-definition"}},[e._v("#")]),e._v(" 3.4.1.2. Response Definition")]),e._v(" "),a("p",[e._v("When the request is in a successful state, Meilisearch returns the HTTP code "),a("code",[e._v("202 Accepted")]),e._v(". The response's content is the summarized representation of the received asynchronous task.")]),e._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"taskUid"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"indexUid"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token null keyword"}},[e._v("null")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"status"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"enqueued"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"type"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"indexSwap"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"enqueuedAt"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"2021-08-12T10:00:00.000000Z"')]),e._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),a("blockquote",[a("p",[e._v("An "),a("code",[e._v("indexSwap")]),e._v(" task is considered a global task; thus "),a("code",[e._v("indexUid")]),e._v(" is null.")])]),e._v(" "),a("p",[e._v("See "),a("RouterLink",{attrs:{to:"/specifications/text/0060-tasks-api.html#summarized-task-object-for-202-accepted"}},[e._v("Summarized "),a("code",[e._v("task")]),e._v(" Object for "),a("code",[e._v("202 Accepted")])]),e._v(".")],1),e._v(" "),a("h5",{attrs:{id:"_3-4-1-3-errors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-4-1-3-errors"}},[e._v("#")]),e._v(" 3.4.1.3. Errors")]),e._v(" "),a("h6",{attrs:{id:"_3-4-1-3-1-synchronous-errors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-4-1-3-1-synchronous-errors"}},[e._v("#")]),e._v(" 3.4.1.3.1. Synchronous Errors")]),e._v(" "),a("ul",[a("li",[e._v("🔴 If the instance is secured by a master key, accessing this route without the "),a("code",[e._v("Authorization")]),e._v(" header returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_authorization_header"}},[e._v("missing_authorization_header")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 If the instance is secured by a master key, accessing this route with a key that does not have permissions (missing "),a("code",[e._v("indexes.swap")]),e._v(" action or having a value for the "),a("code",[e._v("indexes")]),e._v(" field of a swap operation not being defined in the API Key "),a("code",[e._v("indexes")]),e._v(" array) (i.e. other than the master key) returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_api_key"}},[e._v("invalid_api_key")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Omitting Content-Type header returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_content_type"}},[e._v("missing_content_type")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending an empty Content-Type returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_content_type"}},[e._v("invalid_content_type")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending a different Content-Type than "),a("code",[e._v("application/json")]),e._v(" returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_content_type"}},[e._v("invalid_content_type")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending an empty payload returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_payload"}},[e._v("missing_payload")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending an invalid JSON payload returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#malformed_payload"}},[e._v("malformed_payload")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Omitting the "),a("code",[e._v("indexes")]),e._v(" array in a swap payload returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#missing_swap_indexes"}},[e._v("missing_swap_indexes")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending an "),a("code",[e._v("indexes")]),e._v(" array containing an invalid index uid format returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_swap_indexes"}},[e._v("invalid_swap_indexes")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending an "),a("code",[e._v("indexes")]),e._v(" array not containing "),a("strong",[e._v("exactly")]),e._v(" 2 indexUids for a swap operation object returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_swap_indexes"}},[e._v("invalid_swap_indexes")]),e._v(" error.")],1),e._v(" "),a("li",[e._v("🔴 Sending an indexUid more than once in the request payload returns a "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#invalid_swap_duplicate_index_found"}},[e._v("invalid_swap_duplicate_index_found")]),e._v(" error.")],1)]),e._v(" "),a("h6",{attrs:{id:"_3-4-1-3-2-asynchronous-errors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-4-1-3-2-asynchronous-errors"}},[e._v("#")]),e._v(" 3.4.1.3.2. Asynchronous Errors")]),e._v(" "),a("ul",[a("li",[e._v("🔴 Sending indexUids that do not exist within the "),a("code",[e._v("indexes")]),e._v(" field of a swap operation returns an "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#index_not_found"}},[e._v("index_not_found")]),e._v(" error.")],1)]),e._v(" "),a("h2",{attrs:{id:"_4-technical-details"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-technical-details"}},[e._v("#")]),e._v(" 4. Technical Details")]),e._v(" "),a("h3",{attrs:{id:"_4-1-swapping-data"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-swapping-data"}},[e._v("#")]),e._v(" 4.1. Swapping Data")]),e._v(" "),a("p",[e._v("When indexes are swapped their data is exchanged. It concerns:")]),e._v(" "),a("ul",[a("li",[e._v("The documents")]),e._v(" "),a("li",[e._v("The settings")]),e._v(" "),a("li",[e._v("The tasks history\n"),a("ul",[a("li",[e._v("An index swap between index_a and index_b will also replace every mention of index_a by index_b (and vice-versa) in the task history. Enqueued tasks are left unmodified.")])])])]),e._v(" "),a("h2",{attrs:{id:"_5-future-possibilities"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-future-possibilities"}},[e._v("#")]),e._v(" 5. Future Possibilities")]),e._v(" "),a("ul",[a("li",[e._v("Introduce a way to delete one of the swapped indexes when the swap operation occurs.")])])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file diff --git a/docs/assets/js/6.87f02c74.js b/docs/assets/js/6.96405132.js similarity index 87% rename from docs/assets/js/6.87f02c74.js rename to docs/assets/js/6.96405132.js index 444ed6c9c..a53998f87 100644 --- a/docs/assets/js/6.87f02c74.js +++ b/docs/assets/js/6.96405132.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[6],{387:function(e,t,a){},425:function(e,t,a){"use strict";a(387)},431:function(e,t,a){"use strict";a.r(t);a(91),a(43),a(10),a(122),a(123);var o={name:"CodeGroup",data:function(){return{codeTabs:[],activeCodeTabIndex:-1}},watch:{activeCodeTabIndex:function(e){this.activateCodeTab(e)}},mounted:function(){this.loadTabs()},methods:{changeCodeTab:function(e){this.activeCodeTabIndex=e},loadTabs:function(){var e=this;this.codeTabs=(this.$slots.default||[]).filter((function(e){return Boolean(e.componentOptions)})).map((function(t,a){return""===t.componentOptions.propsData.active&&(e.activeCodeTabIndex=a),{title:t.componentOptions.propsData.title,elm:t.elm}})),-1===this.activeCodeTabIndex&&this.codeTabs.length>0&&(this.activeCodeTabIndex=0),this.activateCodeTab(0)},activateCodeTab:function(e){this.codeTabs.forEach((function(e){e.elm&&e.elm.classList.remove("theme-code-block__active")})),this.codeTabs[e].elm&&this.codeTabs[e].elm.classList.add("theme-code-block__active")}}},n=(a(425),a(62)),c=Object(n.a)(o,(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ClientOnly",[a("div",{staticClass:"theme-code-group"},[a("div",{staticClass:"theme-code-group__nav"},[a("ul",{staticClass:"theme-code-group__ul"},e._l(e.codeTabs,(function(t,o){return a("li",{key:t.title,staticClass:"theme-code-group__li"},[a("button",{staticClass:"theme-code-group__nav-tab",class:{"theme-code-group__nav-tab-active":o===e.activeCodeTabIndex},on:{click:function(t){return e.changeCodeTab(o)}}},[e._v("\n "+e._s(t.title)+"\n ")])])})),0)]),e._v(" "),e._t("default"),e._v(" "),e.codeTabs.length<1?a("pre",{staticClass:"pre-blank"},[e._v("// Make sure to add code blocks to your code group")]):e._e()],2)])}),[],!1,null,"deefee04",null);t.default=c.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[6],{386:function(e,t,a){},424:function(e,t,a){"use strict";a(386)},430:function(e,t,a){"use strict";a.r(t);a(91),a(43),a(10),a(122),a(123);var o={name:"CodeGroup",data:function(){return{codeTabs:[],activeCodeTabIndex:-1}},watch:{activeCodeTabIndex:function(e){this.activateCodeTab(e)}},mounted:function(){this.loadTabs()},methods:{changeCodeTab:function(e){this.activeCodeTabIndex=e},loadTabs:function(){var e=this;this.codeTabs=(this.$slots.default||[]).filter((function(e){return Boolean(e.componentOptions)})).map((function(t,a){return""===t.componentOptions.propsData.active&&(e.activeCodeTabIndex=a),{title:t.componentOptions.propsData.title,elm:t.elm}})),-1===this.activeCodeTabIndex&&this.codeTabs.length>0&&(this.activeCodeTabIndex=0),this.activateCodeTab(0)},activateCodeTab:function(e){this.codeTabs.forEach((function(e){e.elm&&e.elm.classList.remove("theme-code-block__active")})),this.codeTabs[e].elm&&this.codeTabs[e].elm.classList.add("theme-code-block__active")}}},n=(a(424),a(62)),c=Object(n.a)(o,(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ClientOnly",[a("div",{staticClass:"theme-code-group"},[a("div",{staticClass:"theme-code-group__nav"},[a("ul",{staticClass:"theme-code-group__ul"},e._l(e.codeTabs,(function(t,o){return a("li",{key:t.title,staticClass:"theme-code-group__li"},[a("button",{staticClass:"theme-code-group__nav-tab",class:{"theme-code-group__nav-tab-active":o===e.activeCodeTabIndex},on:{click:function(t){return e.changeCodeTab(o)}}},[e._v("\n "+e._s(t.title)+"\n ")])])})),0)]),e._v(" "),e._t("default"),e._v(" "),e.codeTabs.length<1?a("pre",{staticClass:"pre-blank"},[e._v("// Make sure to add code blocks to your code group")]):e._e()],2)])}),[],!1,null,"deefee04",null);t.default=c.exports}}]); \ No newline at end of file diff --git a/docs/assets/js/62.057cf3e0.js b/docs/assets/js/62.3ac8f506.js similarity index 98% rename from docs/assets/js/62.057cf3e0.js rename to docs/assets/js/62.3ac8f506.js index 988a6e97f..c787f4275 100644 --- a/docs/assets/js/62.057cf3e0.js +++ b/docs/assets/js/62.3ac8f506.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[62],{487:function(e,t,a){"use strict";a.r(t);var i=a(62),r=Object(i.a)({},(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[a("h1",{attrs:{id:"runtime-experimental-feature-api"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#runtime-experimental-feature-api"}},[e._v("#")]),e._v(" Runtime experimental feature API")]),e._v(" "),a("h2",{attrs:{id:"_1-summary"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-summary"}},[e._v("#")]),e._v(" 1. Summary")]),e._v(" "),a("p",[e._v("The runtime experimental feature API allows toggling the status of some "),a("RouterLink",{attrs:{to:"/specifications/text/0193-experimental-features.html"}},[e._v("experimental features")]),e._v(" at runtime.")],1),e._v(" "),a("p",[e._v("Due to its nature, this route itself is permanently experimental, in that the way of using it is not covered by "),a("a",{attrs:{href:"https://github.com/meilisearch/engine-team/blob/main/resources/versioning-policy.md",target:"_blank",rel:"noopener noreferrer"}},[e._v("Meilisearch's stability guarantee"),a("OutboundLink")],1),e._v(".")]),e._v(" "),a("h2",{attrs:{id:"_2-motivation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-motivation"}},[e._v("#")]),e._v(" 2. Motivation")]),e._v(" "),a("p",[e._v("Historically, experimental features in the engine must be enabled from the CLI or via environment variables.")]),e._v(" "),a("p",[e._v("The problem is that it requires restarting Meilisearch, so:")]),e._v(" "),a("ul",[a("li",[e._v("It induces downtime.")]),e._v(" "),a("li",[e._v("Makes experimental features harder to enable for "),a("a",{attrs:{href:"https://www.meilisearch.com/pricing?utm_campaign=oss&utm_source=engine&utm_medium=specifications",target:"_blank",rel:"noopener noreferrer"}},[e._v("Meilisearch Cloud"),a("OutboundLink")],1),e._v(" instances.")])]),e._v(" "),a("p",[e._v("The motivation of this feature is to remove these issues by allowing enabling and disabling experimental features at runtime.")]),e._v(" "),a("p",[e._v("Due to the nature of some experimental features they might not be in scope for this API. The experimental features in scope for this API are called "),a("RouterLink",{attrs:{to:"/specifications/text/0193-experimental-features.html#32-runtime-experimental-features"}},[a("em",[e._v("runtime")]),e._v(" experimental features")]),e._v(", while the ones not in scope are called "),a("RouterLink",{attrs:{to:"/specifications/text/0193-experimental-features.html#31-instance-experimental-features"}},[a("em",[e._v("instance")]),e._v(" experimental features")]),e._v(".")],1),e._v(" "),a("h2",{attrs:{id:"_3-functional-specification"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-functional-specification"}},[e._v("#")]),e._v(" 3. Functional Specification")]),e._v(" "),a("h3",{attrs:{id:"_3-1-routes"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-routes"}},[e._v("#")]),e._v(" 3.1 Routes")]),e._v(" "),a("p",[e._v("Meilisearch exposes 2 routes to get or set the status of runtime experimental features.")]),e._v(" "),a("ul",[a("li",[e._v("GET "),a("code",[e._v("/experimental-features")]),e._v(": get the status of all the runtime experimental features.")]),e._v(" "),a("li",[e._v("PATCH "),a("code",[e._v("/experimental-features")]),e._v(": set the status of some of the runtime experimental features.")])]),e._v(" "),a("p",[e._v("All routes return the status of the runtime experimental features after calling the route.")]),e._v(" "),a("p",[e._v("This response is a JSON object containing the following fields:")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("Field name")]),e._v(" "),a("th",[e._v("Type")]),e._v(" "),a("th",[e._v("Experimental feature")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[a("code",[e._v("vectorStore")])]),e._v(" "),a("td",[e._v("Boolean")]),e._v(" "),a("td",[a("RouterLink",{attrs:{to:"/specifications/text/0193-experimental-features.html#vector-store"}},[e._v("Vector store")])],1)])])]),e._v(" "),a("p",[e._v("The PATCH routes accept as payload a JSON object containing the same fields as in the response, with the following effects on the corresponding feature:")]),e._v(" "),a("ul",[a("li",[e._v("Setting a field to "),a("code",[e._v("true")]),e._v(" enables the feature.")]),e._v(" "),a("li",[e._v("Setting a field to "),a("code",[e._v("false")]),e._v(" disables the feature.")]),e._v(" "),a("li",[e._v("Setting a field to "),a("code",[e._v("null")]),e._v(" or omitting a field leaves its value unchanged.")])]),e._v(" "),a("h3",{attrs:{id:"_3-2-errors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-errors"}},[e._v("#")]),e._v(" 3.2 Errors")]),e._v(" "),a("ul",[a("li",[e._v("🔴 "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#bad_request"}},[a("code",[e._v("bad_request")])]),e._v(" for unknown fields in the payload or whenever a field is not a boolean.")],1)]),e._v(" "),a("h2",{attrs:{id:"_4-technical-details"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-technical-details"}},[e._v("#")]),e._v(" 4. Technical Details")]),e._v(" "),a("p",[e._v("N/A")]),e._v(" "),a("h2",{attrs:{id:"_5-future-possibilities"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-future-possibilities"}},[e._v("#")]),e._v(" 5. Future Possibilities")]),e._v(" "),a("p",[e._v("N/A")])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[62],{486:function(e,t,a){"use strict";a.r(t);var i=a(62),r=Object(i.a)({},(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[a("h1",{attrs:{id:"runtime-experimental-feature-api"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#runtime-experimental-feature-api"}},[e._v("#")]),e._v(" Runtime experimental feature API")]),e._v(" "),a("h2",{attrs:{id:"_1-summary"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-summary"}},[e._v("#")]),e._v(" 1. Summary")]),e._v(" "),a("p",[e._v("The runtime experimental feature API allows toggling the status of some "),a("RouterLink",{attrs:{to:"/specifications/text/0193-experimental-features.html"}},[e._v("experimental features")]),e._v(" at runtime.")],1),e._v(" "),a("p",[e._v("Due to its nature, this route itself is permanently experimental, in that the way of using it is not covered by "),a("a",{attrs:{href:"https://github.com/meilisearch/engine-team/blob/main/resources/versioning-policy.md",target:"_blank",rel:"noopener noreferrer"}},[e._v("Meilisearch's stability guarantee"),a("OutboundLink")],1),e._v(".")]),e._v(" "),a("h2",{attrs:{id:"_2-motivation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-motivation"}},[e._v("#")]),e._v(" 2. Motivation")]),e._v(" "),a("p",[e._v("Historically, experimental features in the engine must be enabled from the CLI or via environment variables.")]),e._v(" "),a("p",[e._v("The problem is that it requires restarting Meilisearch, so:")]),e._v(" "),a("ul",[a("li",[e._v("It induces downtime.")]),e._v(" "),a("li",[e._v("Makes experimental features harder to enable for "),a("a",{attrs:{href:"https://www.meilisearch.com/pricing?utm_campaign=oss&utm_source=engine&utm_medium=specifications",target:"_blank",rel:"noopener noreferrer"}},[e._v("Meilisearch Cloud"),a("OutboundLink")],1),e._v(" instances.")])]),e._v(" "),a("p",[e._v("The motivation of this feature is to remove these issues by allowing enabling and disabling experimental features at runtime.")]),e._v(" "),a("p",[e._v("Due to the nature of some experimental features they might not be in scope for this API. The experimental features in scope for this API are called "),a("RouterLink",{attrs:{to:"/specifications/text/0193-experimental-features.html#32-runtime-experimental-features"}},[a("em",[e._v("runtime")]),e._v(" experimental features")]),e._v(", while the ones not in scope are called "),a("RouterLink",{attrs:{to:"/specifications/text/0193-experimental-features.html#31-instance-experimental-features"}},[a("em",[e._v("instance")]),e._v(" experimental features")]),e._v(".")],1),e._v(" "),a("h2",{attrs:{id:"_3-functional-specification"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-functional-specification"}},[e._v("#")]),e._v(" 3. Functional Specification")]),e._v(" "),a("h3",{attrs:{id:"_3-1-routes"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-routes"}},[e._v("#")]),e._v(" 3.1 Routes")]),e._v(" "),a("p",[e._v("Meilisearch exposes 2 routes to get or set the status of runtime experimental features.")]),e._v(" "),a("ul",[a("li",[e._v("GET "),a("code",[e._v("/experimental-features")]),e._v(": get the status of all the runtime experimental features.")]),e._v(" "),a("li",[e._v("PATCH "),a("code",[e._v("/experimental-features")]),e._v(": set the status of some of the runtime experimental features.")])]),e._v(" "),a("p",[e._v("All routes return the status of the runtime experimental features after calling the route.")]),e._v(" "),a("p",[e._v("This response is a JSON object containing the following fields:")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("Field name")]),e._v(" "),a("th",[e._v("Type")]),e._v(" "),a("th",[e._v("Experimental feature")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[a("code",[e._v("vectorStore")])]),e._v(" "),a("td",[e._v("Boolean")]),e._v(" "),a("td",[a("RouterLink",{attrs:{to:"/specifications/text/0193-experimental-features.html#vector-store"}},[e._v("Vector store")])],1)])])]),e._v(" "),a("p",[e._v("The PATCH routes accept as payload a JSON object containing the same fields as in the response, with the following effects on the corresponding feature:")]),e._v(" "),a("ul",[a("li",[e._v("Setting a field to "),a("code",[e._v("true")]),e._v(" enables the feature.")]),e._v(" "),a("li",[e._v("Setting a field to "),a("code",[e._v("false")]),e._v(" disables the feature.")]),e._v(" "),a("li",[e._v("Setting a field to "),a("code",[e._v("null")]),e._v(" or omitting a field leaves its value unchanged.")])]),e._v(" "),a("h3",{attrs:{id:"_3-2-errors"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-errors"}},[e._v("#")]),e._v(" 3.2 Errors")]),e._v(" "),a("ul",[a("li",[e._v("🔴 "),a("RouterLink",{attrs:{to:"/specifications/text/0061-error-format-and-definitions.html#bad_request"}},[a("code",[e._v("bad_request")])]),e._v(" for unknown fields in the payload or whenever a field is not a boolean.")],1)]),e._v(" "),a("h2",{attrs:{id:"_4-technical-details"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-technical-details"}},[e._v("#")]),e._v(" 4. Technical Details")]),e._v(" "),a("p",[e._v("N/A")]),e._v(" "),a("h2",{attrs:{id:"_5-future-possibilities"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-future-possibilities"}},[e._v("#")]),e._v(" 5. Future Possibilities")]),e._v(" "),a("p",[e._v("N/A")])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file diff --git a/docs/assets/js/63.d21ecbad.js b/docs/assets/js/63.39c14cc1.js similarity index 99% rename from docs/assets/js/63.d21ecbad.js rename to docs/assets/js/63.39c14cc1.js index 0b9e6554a..144a530d0 100644 --- a/docs/assets/js/63.d21ecbad.js +++ b/docs/assets/js/63.39c14cc1.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[63],{486:function(e,t,a){"use strict";a.r(t);var r=a(62),s=Object(r.a)({},(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[a("h1",{attrs:{id:"ranking-score"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#ranking-score"}},[e._v("#")]),e._v(" Ranking Score")]),e._v(" "),a("h2",{attrs:{id:"_1-summary"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-summary"}},[e._v("#")]),e._v(" 1. Summary")]),e._v(" "),a("p",[e._v("Adds two kinds of scores to documents returned by a "),a("RouterLink",{attrs:{to:"/specifications/text/0118-search-api.html"}},[e._v("search query")]),e._v(".")],1),e._v(" "),a("h2",{attrs:{id:"_2-motivation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-motivation"}},[e._v("#")]),e._v(" 2. Motivation")]),e._v(" "),a("p",[e._v("When configuring the Meilisearch relevancy according to their needs, users cannot know why one document has been favored over another.")]),e._v(" "),a("p",[e._v("Showing how the documents ranked according to Meilisearch’s ranking rules unlocks:")]),e._v(" "),a("ul",[a("li",[e._v("Further customization of the developer workflow, such as fine-tuning settings and improving relevancy for example.")]),e._v(" "),a("li",[e._v("Returning a unified list of results for multi-index search queries")]),e._v(" "),a("li",[e._v("Sharding")]),e._v(" "),a("li",[e._v("Debugging and helping users better understand how ranking works")])]),e._v(" "),a("h2",{attrs:{id:"_3-functional-specification"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-functional-specification"}},[e._v("#")]),e._v(" 3. Functional Specification")]),e._v(" "),a("h3",{attrs:{id:"_3-1-ranking-score"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-ranking-score"}},[e._v("#")]),e._v(" 3.1. Ranking score")]),e._v(" "),a("p",[e._v("A ranking score is a number attached to each document returned by a search when the "),a("RouterLink",{attrs:{to:"/specifications/text/0118-search-api.html#3117-showrankingscore"}},[a("code",[e._v("showRankingScore")])]),e._v(" flag is set to true in the search query.")],1),e._v(" "),a("h4",{attrs:{id:"_3-1-1-scale-and-interpretation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-1-scale-and-interpretation"}},[e._v("#")]),e._v(" 3.1.1. Scale and interpretation")]),e._v(" "),a("p",[e._v("The ranking score is contained between 1.0 and 0.0. A higher score signifies better relevancy, with 1.0 representing a perfect match, and 0.0 indicating that the document does not match the query (Meilisearch should not return documents that do not match the query).")]),e._v(" "),a("p",[e._v("That number rates the relevancy of the document with respect to the specified search query and the current settings of the index.")]),e._v(" "),a("p",[e._v("The score of a document follows its relevancy in the sense of Meilisearch, in that the first few ranking rules have a much higher influence on the score than the next rules. This is consistent with the way that later ranking rules are only used to break ties with earlier ranking rules, when ranking documents.")]),e._v(" "),a("h4",{attrs:{id:"_3-1-2-score-independence"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-2-score-independence"}},[e._v("#")]),e._v(" 3.1.2. Score independence")]),e._v(" "),a("p",[e._v("The score of a document is independent of what other documents are contained in the index but is influenced by the settings of the index. The table below details all the settings that can influence the score. Unlisted settings do not influence the ranking score.")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("Setting name")]),e._v(" "),a("th",[e._v("Influences if")]),e._v(" "),a("th",[e._v("Rationale")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[a("code",[e._v("searchableAttributes")])]),e._v(" "),a("td",[e._v("The "),a("code",[e._v("attribute")]),e._v(" ranking rule is used")]),e._v(" "),a("td",[e._v("The "),a("code",[e._v("attribute")]),e._v(" ranking rule rates the document depending on the attribute in which the query terms show up. The order is determined by "),a("code",[e._v("searchableAttributes")])])]),e._v(" "),a("tr",[a("td",[a("code",[e._v("rankingRules")])]),e._v(" "),a("td",[e._v("Always")]),e._v(" "),a("td",[e._v("The score is computed by computing the subscore of each ranking rule with a weight that depends on their order.")])]),e._v(" "),a("tr",[a("td",[a("code",[e._v("stopWords")])]),e._v(" "),a("td",[e._v("Always")]),e._v(" "),a("td",[e._v("Stop words influence the "),a("code",[e._v("words")]),e._v(" ranking rule, which is almost always used")])]),e._v(" "),a("tr",[a("td",[a("code",[e._v("synonyms")])]),e._v(" "),a("td",[e._v("Always")]),e._v(" "),a("td",[e._v("Synonyms influence the "),a("code",[e._v("words")]),e._v(" ranking rule, which is almost always used")])]),e._v(" "),a("tr",[a("td",[a("code",[e._v("typoTolerance")])]),e._v(" "),a("td",[e._v("The "),a("code",[e._v("typo")]),e._v(" ranking rule is used")]),e._v(" "),a("td",[e._v("Used to compute the maximum number of typos for a query")])])])]),e._v(" "),a("p",[e._v("Additionally, the following can impact score independence:")]),e._v(" "),a("ul",[a("li",[e._v("If the "),a("code",[e._v("attribute")]),e._v(" ranking rule is used, but "),a("code",[e._v("searchableAttributes")]),e._v(" has not been specified, then the score is dependent on all the fields that appear in documents and their precise order, as determined by Meilisearch.\nthe score is dependent on the search query.")])]),e._v(" "),a("p",[e._v("Depending on the use case, it can be meaningful to compare scores coming from indexes with settings that are different:")]),e._v(" "),a("ul",[a("li",[e._v("When comparing two scores produced on two indexes with different settings, possibly on a distinct search query, one is comparing the relevancy of each of the scored documents to their respective search query. This is good to present the most relevant documents first when working with heterogeneous indexes, without taking into account which document best suits one single query.")]),e._v(" "),a("li",[e._v("On the other hand, to find what document best suits one single query against two homogeneous indexes, one must be careful to make sure that the indexes have the settings above set to the same value.")])]),e._v(" "),a("h4",{attrs:{id:"_3-1-3-the-sort-ranking-rules-do-not-impact-the-score"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-3-the-sort-ranking-rules-do-not-impact-the-score"}},[e._v("#")]),e._v(" 3.1.3. The sort ranking rules do not impact the score")]),e._v(" "),a("p",[e._v("Custom "),a("code",[e._v("sort")]),e._v(" and "),a("code",[e._v("geosort")]),e._v(" ranking rules modify the ranking of documents such that they are returned sorted by the value of the target field, rather than by their relevancy to the search query.")]),e._v(" "),a("p",[e._v("As such, these ranking rules have no impact on the score. As a corollary of this, if a "),a("code",[e._v("sort")]),e._v(" ranking rule is not the last ranking rule, then it is possible to see documents returned with ranking scores that are not monotonically decreasing.")]),e._v(" "),a("p",[e._v("Similarly, re-ranking documents by their ranking score will ignore any "),a("code",[e._v("sort")]),e._v(" ranking rule.")]),e._v(" "),a("p",[e._v("If you need to factor sort ranking rules into your score, then use the "),a("a",{attrs:{href:"#32-ranking-score-details"}},[e._v("ranking score details")]),e._v(".")]),e._v(" "),a("h3",{attrs:{id:"_3-2-ranking-score-details"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-ranking-score-details"}},[e._v("#")]),e._v(" 3.2. Ranking score details")]),e._v(" "),a("p",[e._v("The ranking score details are represented as an object attached to each document returned by a search when the "),a("RouterLink",{attrs:{to:"/specifications/text/0118-search-api.html#3118-showrankingscoredetails"}},[a("code",[e._v("showRankingScoreDetails")])]),e._v(" flag is set to true in the search query.")],1),e._v(" "),a("h4",{attrs:{id:"_3-2-1-general-shape"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-1-general-shape"}},[e._v("#")]),e._v(" 3.2.1. General shape")]),e._v(" "),a("p",[e._v("The fields of the object have for key the identifier of the various ranking rules that were applied, and for value an object with at least the following field:")]),e._v(" "),a("ul",[a("li",[a("code",[e._v("order")]),e._v(": the numerical order in which the ranking rule was applied. Starts at 0. Consecutive numbers denote ranking rules consecutively applied.")])]),e._v(" "),a("p",[e._v("Additionally, all ranking rules except the "),a("code",[e._v("sort")]),e._v(" and "),a("code",[e._v("geosort")]),e._v(" ranking rules have the following field:")]),e._v(" "),a("ul",[a("li",[a("code",[e._v("score")]),e._v(": the relevancy score of the document relative to this search query, for this ranking rule. A number between 1.0 and 0.0, with 1.0 meaning a perfect match to the query according to the ranking rule, and 0.0 no match.")])]),e._v(" "),a("h4",{attrs:{id:"_3-2-2-ranking-rule-specific-fields"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-2-ranking-rule-specific-fields"}},[e._v("#")]),e._v(" 3.2.2. Ranking-rule-specific fields")]),e._v(" "),a("p",[e._v("Each ranking rule exposes specific fields meant to provide semantic information about how the ranking rule was applied to the document.")]),e._v(" "),a("p",[e._v("The table below details these rule-specific fields.")]),e._v(" "),a("p",[e._v("​")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"left"}},[e._v("Ranking rule")]),e._v(" "),a("th",{staticStyle:{"text-align":"left"}},[e._v("Field description")])])]),e._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"left"}},[a("code",[e._v("words")])]),e._v(" "),a("td",{staticStyle:{"text-align":"left"}},[a("ul",[a("li",[a("code",[e._v("matchingWords")]),e._v(": Number of words in the query that match in the document. The higher the better")]),a("li",[a("code",[e._v("maxMatchingWords")]),e._v(": Maximum number of words in the query that can match in the document for this iteration of the "),a("code",[e._v("words")]),e._v(" ranking rule. Usually, the query length, but if one of the query terms is set as a stop word, it won’t be counted here.")])])])]),e._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"left"}},[a("code",[e._v("typo")])]),e._v(" "),a("td",{staticStyle:{"text-align":"left"}},[a("ul",[a("li",[a("code",[e._v("typoCount")]),e._v(": Number of typos to correct in the query so that the document matches for this iteration of the "),a("code",[e._v("typo")]),e._v(" ranking rule.")]),a("li",[a("code",[e._v("maxTypoCount")]),e._v(": Maximum number of typos possible in a document for this iteration of the "),a("code",[e._v("typo")]),e._v(" ranking rule.")])])])]),e._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"left"}},[a("code",[e._v("proximity")])]),e._v(" "),a("td",{staticStyle:{"text-align":"left"}},[e._v("No rule-specific field")])]),e._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"left"}},[a("code",[e._v("attribute")])]),e._v(" "),a("td",{staticStyle:{"text-align":"left"}},[a("ul",[a("li",[a("code",[e._v("attributeRankingOrderScore")]),e._v(": Results sorted based on the attribute ranking order")]),a("li",[a("code",[e._v("queryWordDistanceScore")]),e._v(": Documents with attributes containing the query words close to their position in the query will be considered more relevant than documents containing the query words far from their position in the query")])])])]),e._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"left"}},[a("code",[e._v("exactness")])]),e._v(" "),a("td",{staticStyle:{"text-align":"left"}},[a("ul",[a("li",[a("code",[e._v("matchType")]),e._v(": It has one of the following values:"),a("ul",[a("li",[a("code",[e._v("exactMatch")]),e._v(": The query exactly matches the entire value of an attribute")]),a("li",[a("code",[e._v("matchesStart")]),e._v(": The query matches exactly the start of the value of an attribute")]),a("li",[a("code",[e._v("noExactMatch")]),e._v(": The query doesn't exactly match a document ")])])]),a("li",[a("code",[e._v("matchingWords")]),e._v(": for "),a("code",[e._v("matchesStart")]),e._v(", the number of exact words contained in an attribute. The higher the better")]),a("li",[a("code",[e._v("maxMatchingWords")]),e._v(": for "),a("code",[e._v("noExactMatch")]),e._v(", the maximum number of exact words contained in an attribute")])])])])])]),e._v(" "),a("h4",{attrs:{id:"_3-2-3-sort-ranking-rules"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-3-sort-ranking-rules"}},[e._v("#")]),e._v(" 3.2.3. Sort ranking rules")]),e._v(" "),a("p",[a("code",[e._v("Sort")]),e._v(", "),a("code",[e._v("_geosort")]),e._v(" and (EXPERIMENTAL) "),a("code",[e._v("vectorSort")]),e._v(" ranking rules appear as fields in the score details, but with the following difference:")]),e._v(" "),a("ul",[a("li",[e._v("Their key follows the following format: "),a("code",[e._v("{:attribute-sorted-on}:{:sort-direction}")]),e._v(", with the "),a("code",[e._v(":attribute-sorted-on")]),e._v(" the name of the attribute that is being sorted on, and the "),a("code",[e._v(":sort-direction")]),e._v(" either "),a("code",[e._v("asc")]),e._v(" if the sort is in ascending order, or "),a("code",[e._v("desc")]),e._v(" if the sort is in descending order. For the "),a("code",[e._v("geosort")]),e._v(" ranking rule, it is similarly "),a("code",[e._v("_geoPoint({:lat}, {:lng}):{:sort-direction}")]),e._v(", with the "),a("code",[e._v(":lat")]),e._v(" and "),a("code",[e._v(":lng")]),e._v(" being the latitude and respective longitude of the point that serves as base to sort by distance. (EXPERIMENTAL) For the "),a("code",[e._v("vectorSort")]),e._v(" ranking rule, it is similarly "),a("code",[e._v("vectorSort(:targetVector)")]),e._v(" with the "),a("code",[e._v(":targetVector")]),e._v(" being the searched for vector.")]),e._v(" "),a("li",[e._v("They don't have a "),a("code",[e._v("score")]),e._v(" field, but instead they have a "),a("code",[e._v("value")]),e._v(" field, representing the value used to sort the document. It is typically the value of the sorted attribute for the document, but can sometimes be a subvalue (case where the value is an array of values).")]),e._v(" "),a("li",[e._v("For the "),a("code",[e._v("_geosort")]),e._v(", there is an additional "),a("code",[e._v("distance")]),e._v(" field representing the distance between the target point and the point used in the document to sort the document.")]),e._v(" "),a("li",[e._v("(EXPERIMENTAL) for the "),a("code",[e._v("vectorSort")]),e._v(", there is an additional "),a("code",[e._v("similarity")]),e._v(" field representing the similarity between the target vector and the value vector.")])]),e._v(" "),a("h4",{attrs:{id:"_3-2-4-example"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-example"}},[e._v("#")]),e._v(" 3.2.4 Example")]),e._v(" "),a("p",[e._v("The following is an example of a "),a("code",[e._v("_scoreDetails")]),e._v(" returned for a document matching a search query.")]),e._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"_rankingScoreDetails"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"words"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"order"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"matchingWords"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"maxMatchingWords"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"score"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("1")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"typo"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"order"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"typoCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"maxTypoCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"score"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("1")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"proximity"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"order"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"score"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("1")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"attribute"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"order"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("3")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"attributes_ranking_order"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("0.8333333333333334")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"attributes_query_word_order"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"score"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("0.8333333333333334")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"exactness"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"order"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("4")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"matchType"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"exactMatch"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"score"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("1")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"release_date:asc"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"order"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("1165881600")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),a("h2",{attrs:{id:"_4-technical-details"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-technical-details"}},[e._v("#")]),e._v(" 4. Technical Details")]),e._v(" "),a("h3",{attrs:{id:"_4-1-ranking-score-calculation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-ranking-score-calculation"}},[e._v("#")]),e._v(" 4.1. Ranking score calculation")]),e._v(" "),a("p",[e._v("The ranking score calculation in this section is given for informative purposes and is not normative.")]),e._v(" "),a("p",[e._v("The implementation computes the "),a("a",{attrs:{href:"#31-ranking-score"}},[e._v("ranking score")]),e._v(" from each ranking rule (excluding "),a("code",[e._v("sort")]),e._v(" and "),a("code",[e._v("geosort")]),e._v(") with two bits of data per ranking rule. For the "),a("code",[e._v("k")]),e._v("th applied ranking rule:")]),e._v(" "),a("ul",[a("li",[e._v("The maximum rank "),a("code",[e._v("max_rank_k")]),e._v(" that a document can score with the rule, "),a("a",{attrs:{href:"#312-score-independence"}},[e._v("independently from the other documents in the index")])]),e._v(" "),a("li",[e._v("The rank "),a("code",[e._v("rank_k")]),e._v(" of that document for that rule, with the highest rank being equal to the maximum rank, and the lowest rank being equal to 1.")])]),e._v(" "),a("p",[e._v("The score is given by the following formula, assuming "),a("code",[e._v("n")]),e._v(" ranking rules denoted from "),a("code",[e._v("0")]),e._v(" to "),a("code",[e._v("n-1")]),e._v(":")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v("score = sum(i in 0..(n-1), (rank_i - 1) / product(j in 0..=i, max_rank_j)) + (rank_(n-1) / product(i in 0..n, max_rank_i))\n")])])]),a("p",[e._v("The intuition behind this formula is that every document falls in a range for each rule, between "),a("code",[e._v("rank_i / max_rank_i")]),e._v(" and "),a("code",[e._v("(rank_i - 1) / max_rank_i")]),e._v(", and the next ranking rule allows to refine where the document is in this range, with the last ranking rule providing the exact score.")]),e._v(" "),a("h3",{attrs:{id:"_4-2-hidden-ranking-rules"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-hidden-ranking-rules"}},[e._v("#")]),e._v(" 4.2. Hidden ranking rules")]),e._v(" "),a("p",[e._v("If the "),a("RouterLink",{attrs:{to:"/specifications/text/0123-displayed-attributes-setting-api.html"}},[a("code",[e._v("displayedAttributes")])]),e._v(" list is defined, then attributes that are not part of that list, but are used in "),a("code",[e._v("sort")]),e._v(" ranking rules are "),a("strong",[e._v("hidden")]),e._v(".")],1),e._v(" "),a("p",[e._v("Instead of seeing "),a("code",[e._v("{:attribute-sorted-on}:{:sort-direction}")]),e._v(" like described in "),a("a",{attrs:{href:"#323-sort-ranking-rules"}},[e._v("the relevant section")]),e._v(", the name of that field is replaced with "),a("code",[e._v("")]),e._v(", with "),a("code",[e._v("{:number}")]),e._v(" a number that serves to uniquely distinguish between such hidden rules.")]),e._v(" "),a("p",[e._v("Note: that number is not guaranteed to start at 0 nor to be consecutive. The only guarantee is that no hidden ranking rule will have the same number.")]),e._v(" "),a("p",[e._v("Furthermore, the "),a("code",[e._v("value")]),e._v(" that was used to sort the document is also hidden and replaced by "),a("code",[e._v('""')]),e._v(".")]),e._v(" "),a("h3",{attrs:{id:"_4-3-disabled-optimization"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-3-disabled-optimization"}},[e._v("#")]),e._v(" 4.3. Disabled optimization")]),e._v(" "),a("p",[e._v("The engine optimizes search by skipping the application of ranking rules when there's only one remaining document (no tie to break).")]),e._v(" "),a("p",[e._v("To compute an accurate score, however, all ranking rules must be applied, so this optimization is disabled as soon as a score is requested in the search request. When no scores are requested, the optimization is active.")]),e._v(" "),a("h2",{attrs:{id:"_5-future-possibilities"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-future-possibilities"}},[e._v("#")]),e._v(" 5. Future Possibilities")]),e._v(" "),a("ul",[a("li",[e._v("Extend the "),a("RouterLink",{attrs:{to:"/specifications/text/0192-multi-search-api.html"}},[e._v("multi-search API")]),e._v(" to rerank documents according to their score, providing federated search.")],1)])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[63],{487:function(e,t,a){"use strict";a.r(t);var r=a(62),s=Object(r.a)({},(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[a("h1",{attrs:{id:"ranking-score"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#ranking-score"}},[e._v("#")]),e._v(" Ranking Score")]),e._v(" "),a("h2",{attrs:{id:"_1-summary"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_1-summary"}},[e._v("#")]),e._v(" 1. Summary")]),e._v(" "),a("p",[e._v("Adds two kinds of scores to documents returned by a "),a("RouterLink",{attrs:{to:"/specifications/text/0118-search-api.html"}},[e._v("search query")]),e._v(".")],1),e._v(" "),a("h2",{attrs:{id:"_2-motivation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_2-motivation"}},[e._v("#")]),e._v(" 2. Motivation")]),e._v(" "),a("p",[e._v("When configuring the Meilisearch relevancy according to their needs, users cannot know why one document has been favored over another.")]),e._v(" "),a("p",[e._v("Showing how the documents ranked according to Meilisearch’s ranking rules unlocks:")]),e._v(" "),a("ul",[a("li",[e._v("Further customization of the developer workflow, such as fine-tuning settings and improving relevancy for example.")]),e._v(" "),a("li",[e._v("Returning a unified list of results for multi-index search queries")]),e._v(" "),a("li",[e._v("Sharding")]),e._v(" "),a("li",[e._v("Debugging and helping users better understand how ranking works")])]),e._v(" "),a("h2",{attrs:{id:"_3-functional-specification"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-functional-specification"}},[e._v("#")]),e._v(" 3. Functional Specification")]),e._v(" "),a("h3",{attrs:{id:"_3-1-ranking-score"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-ranking-score"}},[e._v("#")]),e._v(" 3.1. Ranking score")]),e._v(" "),a("p",[e._v("A ranking score is a number attached to each document returned by a search when the "),a("RouterLink",{attrs:{to:"/specifications/text/0118-search-api.html#3117-showrankingscore"}},[a("code",[e._v("showRankingScore")])]),e._v(" flag is set to true in the search query.")],1),e._v(" "),a("h4",{attrs:{id:"_3-1-1-scale-and-interpretation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-1-scale-and-interpretation"}},[e._v("#")]),e._v(" 3.1.1. Scale and interpretation")]),e._v(" "),a("p",[e._v("The ranking score is contained between 1.0 and 0.0. A higher score signifies better relevancy, with 1.0 representing a perfect match, and 0.0 indicating that the document does not match the query (Meilisearch should not return documents that do not match the query).")]),e._v(" "),a("p",[e._v("That number rates the relevancy of the document with respect to the specified search query and the current settings of the index.")]),e._v(" "),a("p",[e._v("The score of a document follows its relevancy in the sense of Meilisearch, in that the first few ranking rules have a much higher influence on the score than the next rules. This is consistent with the way that later ranking rules are only used to break ties with earlier ranking rules, when ranking documents.")]),e._v(" "),a("h4",{attrs:{id:"_3-1-2-score-independence"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-2-score-independence"}},[e._v("#")]),e._v(" 3.1.2. Score independence")]),e._v(" "),a("p",[e._v("The score of a document is independent of what other documents are contained in the index but is influenced by the settings of the index. The table below details all the settings that can influence the score. Unlisted settings do not influence the ranking score.")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",[e._v("Setting name")]),e._v(" "),a("th",[e._v("Influences if")]),e._v(" "),a("th",[e._v("Rationale")])])]),e._v(" "),a("tbody",[a("tr",[a("td",[a("code",[e._v("searchableAttributes")])]),e._v(" "),a("td",[e._v("The "),a("code",[e._v("attribute")]),e._v(" ranking rule is used")]),e._v(" "),a("td",[e._v("The "),a("code",[e._v("attribute")]),e._v(" ranking rule rates the document depending on the attribute in which the query terms show up. The order is determined by "),a("code",[e._v("searchableAttributes")])])]),e._v(" "),a("tr",[a("td",[a("code",[e._v("rankingRules")])]),e._v(" "),a("td",[e._v("Always")]),e._v(" "),a("td",[e._v("The score is computed by computing the subscore of each ranking rule with a weight that depends on their order.")])]),e._v(" "),a("tr",[a("td",[a("code",[e._v("stopWords")])]),e._v(" "),a("td",[e._v("Always")]),e._v(" "),a("td",[e._v("Stop words influence the "),a("code",[e._v("words")]),e._v(" ranking rule, which is almost always used")])]),e._v(" "),a("tr",[a("td",[a("code",[e._v("synonyms")])]),e._v(" "),a("td",[e._v("Always")]),e._v(" "),a("td",[e._v("Synonyms influence the "),a("code",[e._v("words")]),e._v(" ranking rule, which is almost always used")])]),e._v(" "),a("tr",[a("td",[a("code",[e._v("typoTolerance")])]),e._v(" "),a("td",[e._v("The "),a("code",[e._v("typo")]),e._v(" ranking rule is used")]),e._v(" "),a("td",[e._v("Used to compute the maximum number of typos for a query")])])])]),e._v(" "),a("p",[e._v("Additionally, the following can impact score independence:")]),e._v(" "),a("ul",[a("li",[e._v("If the "),a("code",[e._v("attribute")]),e._v(" ranking rule is used, but "),a("code",[e._v("searchableAttributes")]),e._v(" has not been specified, then the score is dependent on all the fields that appear in documents and their precise order, as determined by Meilisearch.\nthe score is dependent on the search query.")])]),e._v(" "),a("p",[e._v("Depending on the use case, it can be meaningful to compare scores coming from indexes with settings that are different:")]),e._v(" "),a("ul",[a("li",[e._v("When comparing two scores produced on two indexes with different settings, possibly on a distinct search query, one is comparing the relevancy of each of the scored documents to their respective search query. This is good to present the most relevant documents first when working with heterogeneous indexes, without taking into account which document best suits one single query.")]),e._v(" "),a("li",[e._v("On the other hand, to find what document best suits one single query against two homogeneous indexes, one must be careful to make sure that the indexes have the settings above set to the same value.")])]),e._v(" "),a("h4",{attrs:{id:"_3-1-3-the-sort-ranking-rules-do-not-impact-the-score"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-1-3-the-sort-ranking-rules-do-not-impact-the-score"}},[e._v("#")]),e._v(" 3.1.3. The sort ranking rules do not impact the score")]),e._v(" "),a("p",[e._v("Custom "),a("code",[e._v("sort")]),e._v(" and "),a("code",[e._v("geosort")]),e._v(" ranking rules modify the ranking of documents such that they are returned sorted by the value of the target field, rather than by their relevancy to the search query.")]),e._v(" "),a("p",[e._v("As such, these ranking rules have no impact on the score. As a corollary of this, if a "),a("code",[e._v("sort")]),e._v(" ranking rule is not the last ranking rule, then it is possible to see documents returned with ranking scores that are not monotonically decreasing.")]),e._v(" "),a("p",[e._v("Similarly, re-ranking documents by their ranking score will ignore any "),a("code",[e._v("sort")]),e._v(" ranking rule.")]),e._v(" "),a("p",[e._v("If you need to factor sort ranking rules into your score, then use the "),a("a",{attrs:{href:"#32-ranking-score-details"}},[e._v("ranking score details")]),e._v(".")]),e._v(" "),a("h3",{attrs:{id:"_3-2-ranking-score-details"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-ranking-score-details"}},[e._v("#")]),e._v(" 3.2. Ranking score details")]),e._v(" "),a("p",[e._v("The ranking score details are represented as an object attached to each document returned by a search when the "),a("RouterLink",{attrs:{to:"/specifications/text/0118-search-api.html#3118-showrankingscoredetails"}},[a("code",[e._v("showRankingScoreDetails")])]),e._v(" flag is set to true in the search query.")],1),e._v(" "),a("h4",{attrs:{id:"_3-2-1-general-shape"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-1-general-shape"}},[e._v("#")]),e._v(" 3.2.1. General shape")]),e._v(" "),a("p",[e._v("The fields of the object have for key the identifier of the various ranking rules that were applied, and for value an object with at least the following field:")]),e._v(" "),a("ul",[a("li",[a("code",[e._v("order")]),e._v(": the numerical order in which the ranking rule was applied. Starts at 0. Consecutive numbers denote ranking rules consecutively applied.")])]),e._v(" "),a("p",[e._v("Additionally, all ranking rules except the "),a("code",[e._v("sort")]),e._v(" and "),a("code",[e._v("geosort")]),e._v(" ranking rules have the following field:")]),e._v(" "),a("ul",[a("li",[a("code",[e._v("score")]),e._v(": the relevancy score of the document relative to this search query, for this ranking rule. A number between 1.0 and 0.0, with 1.0 meaning a perfect match to the query according to the ranking rule, and 0.0 no match.")])]),e._v(" "),a("h4",{attrs:{id:"_3-2-2-ranking-rule-specific-fields"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-2-ranking-rule-specific-fields"}},[e._v("#")]),e._v(" 3.2.2. Ranking-rule-specific fields")]),e._v(" "),a("p",[e._v("Each ranking rule exposes specific fields meant to provide semantic information about how the ranking rule was applied to the document.")]),e._v(" "),a("p",[e._v("The table below details these rule-specific fields.")]),e._v(" "),a("p",[e._v("​")]),e._v(" "),a("table",[a("thead",[a("tr",[a("th",{staticStyle:{"text-align":"left"}},[e._v("Ranking rule")]),e._v(" "),a("th",{staticStyle:{"text-align":"left"}},[e._v("Field description")])])]),e._v(" "),a("tbody",[a("tr",[a("td",{staticStyle:{"text-align":"left"}},[a("code",[e._v("words")])]),e._v(" "),a("td",{staticStyle:{"text-align":"left"}},[a("ul",[a("li",[a("code",[e._v("matchingWords")]),e._v(": Number of words in the query that match in the document. The higher the better")]),a("li",[a("code",[e._v("maxMatchingWords")]),e._v(": Maximum number of words in the query that can match in the document for this iteration of the "),a("code",[e._v("words")]),e._v(" ranking rule. Usually, the query length, but if one of the query terms is set as a stop word, it won’t be counted here.")])])])]),e._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"left"}},[a("code",[e._v("typo")])]),e._v(" "),a("td",{staticStyle:{"text-align":"left"}},[a("ul",[a("li",[a("code",[e._v("typoCount")]),e._v(": Number of typos to correct in the query so that the document matches for this iteration of the "),a("code",[e._v("typo")]),e._v(" ranking rule.")]),a("li",[a("code",[e._v("maxTypoCount")]),e._v(": Maximum number of typos possible in a document for this iteration of the "),a("code",[e._v("typo")]),e._v(" ranking rule.")])])])]),e._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"left"}},[a("code",[e._v("proximity")])]),e._v(" "),a("td",{staticStyle:{"text-align":"left"}},[e._v("No rule-specific field")])]),e._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"left"}},[a("code",[e._v("attribute")])]),e._v(" "),a("td",{staticStyle:{"text-align":"left"}},[a("ul",[a("li",[a("code",[e._v("attributeRankingOrderScore")]),e._v(": Results sorted based on the attribute ranking order")]),a("li",[a("code",[e._v("queryWordDistanceScore")]),e._v(": Documents with attributes containing the query words close to their position in the query will be considered more relevant than documents containing the query words far from their position in the query")])])])]),e._v(" "),a("tr",[a("td",{staticStyle:{"text-align":"left"}},[a("code",[e._v("exactness")])]),e._v(" "),a("td",{staticStyle:{"text-align":"left"}},[a("ul",[a("li",[a("code",[e._v("matchType")]),e._v(": It has one of the following values:"),a("ul",[a("li",[a("code",[e._v("exactMatch")]),e._v(": The query exactly matches the entire value of an attribute")]),a("li",[a("code",[e._v("matchesStart")]),e._v(": The query matches exactly the start of the value of an attribute")]),a("li",[a("code",[e._v("noExactMatch")]),e._v(": The query doesn't exactly match a document ")])])]),a("li",[a("code",[e._v("matchingWords")]),e._v(": for "),a("code",[e._v("matchesStart")]),e._v(", the number of exact words contained in an attribute. The higher the better")]),a("li",[a("code",[e._v("maxMatchingWords")]),e._v(": for "),a("code",[e._v("noExactMatch")]),e._v(", the maximum number of exact words contained in an attribute")])])])])])]),e._v(" "),a("h4",{attrs:{id:"_3-2-3-sort-ranking-rules"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-3-sort-ranking-rules"}},[e._v("#")]),e._v(" 3.2.3. Sort ranking rules")]),e._v(" "),a("p",[a("code",[e._v("Sort")]),e._v(", "),a("code",[e._v("_geosort")]),e._v(" and (EXPERIMENTAL) "),a("code",[e._v("vectorSort")]),e._v(" ranking rules appear as fields in the score details, but with the following difference:")]),e._v(" "),a("ul",[a("li",[e._v("Their key follows the following format: "),a("code",[e._v("{:attribute-sorted-on}:{:sort-direction}")]),e._v(", with the "),a("code",[e._v(":attribute-sorted-on")]),e._v(" the name of the attribute that is being sorted on, and the "),a("code",[e._v(":sort-direction")]),e._v(" either "),a("code",[e._v("asc")]),e._v(" if the sort is in ascending order, or "),a("code",[e._v("desc")]),e._v(" if the sort is in descending order. For the "),a("code",[e._v("geosort")]),e._v(" ranking rule, it is similarly "),a("code",[e._v("_geoPoint({:lat}, {:lng}):{:sort-direction}")]),e._v(", with the "),a("code",[e._v(":lat")]),e._v(" and "),a("code",[e._v(":lng")]),e._v(" being the latitude and respective longitude of the point that serves as base to sort by distance. (EXPERIMENTAL) For the "),a("code",[e._v("vectorSort")]),e._v(" ranking rule, it is similarly "),a("code",[e._v("vectorSort(:targetVector)")]),e._v(" with the "),a("code",[e._v(":targetVector")]),e._v(" being the searched for vector.")]),e._v(" "),a("li",[e._v("They don't have a "),a("code",[e._v("score")]),e._v(" field, but instead they have a "),a("code",[e._v("value")]),e._v(" field, representing the value used to sort the document. It is typically the value of the sorted attribute for the document, but can sometimes be a subvalue (case where the value is an array of values).")]),e._v(" "),a("li",[e._v("For the "),a("code",[e._v("_geosort")]),e._v(", there is an additional "),a("code",[e._v("distance")]),e._v(" field representing the distance between the target point and the point used in the document to sort the document.")]),e._v(" "),a("li",[e._v("(EXPERIMENTAL) for the "),a("code",[e._v("vectorSort")]),e._v(", there is an additional "),a("code",[e._v("similarity")]),e._v(" field representing the similarity between the target vector and the value vector.")])]),e._v(" "),a("h4",{attrs:{id:"_3-2-4-example"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_3-2-4-example"}},[e._v("#")]),e._v(" 3.2.4 Example")]),e._v(" "),a("p",[e._v("The following is an example of a "),a("code",[e._v("_scoreDetails")]),e._v(" returned for a document matching a search query.")]),e._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"_rankingScoreDetails"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"words"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"order"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"matchingWords"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"maxMatchingWords"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"score"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("1")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"typo"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"order"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"typoCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("0")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"maxTypoCount"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"score"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("1")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"proximity"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"order"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"score"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("1")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"attribute"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"order"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("3")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"attributes_ranking_order"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("0.8333333333333334")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"attributes_query_word_order"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"score"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("0.8333333333333334")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"exactness"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"order"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("4")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"matchType"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[e._v('"exactMatch"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"score"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("1")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"release_date:asc"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("{")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"order"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v(",")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[e._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[e._v(":")]),e._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[e._v("1165881600")]),e._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[e._v("}")]),e._v("\n")])])]),a("h2",{attrs:{id:"_4-technical-details"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-technical-details"}},[e._v("#")]),e._v(" 4. Technical Details")]),e._v(" "),a("h3",{attrs:{id:"_4-1-ranking-score-calculation"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-1-ranking-score-calculation"}},[e._v("#")]),e._v(" 4.1. Ranking score calculation")]),e._v(" "),a("p",[e._v("The ranking score calculation in this section is given for informative purposes and is not normative.")]),e._v(" "),a("p",[e._v("The implementation computes the "),a("a",{attrs:{href:"#31-ranking-score"}},[e._v("ranking score")]),e._v(" from each ranking rule (excluding "),a("code",[e._v("sort")]),e._v(" and "),a("code",[e._v("geosort")]),e._v(") with two bits of data per ranking rule. For the "),a("code",[e._v("k")]),e._v("th applied ranking rule:")]),e._v(" "),a("ul",[a("li",[e._v("The maximum rank "),a("code",[e._v("max_rank_k")]),e._v(" that a document can score with the rule, "),a("a",{attrs:{href:"#312-score-independence"}},[e._v("independently from the other documents in the index")])]),e._v(" "),a("li",[e._v("The rank "),a("code",[e._v("rank_k")]),e._v(" of that document for that rule, with the highest rank being equal to the maximum rank, and the lowest rank being equal to 1.")])]),e._v(" "),a("p",[e._v("The score is given by the following formula, assuming "),a("code",[e._v("n")]),e._v(" ranking rules denoted from "),a("code",[e._v("0")]),e._v(" to "),a("code",[e._v("n-1")]),e._v(":")]),e._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[e._v("score = sum(i in 0..(n-1), (rank_i - 1) / product(j in 0..=i, max_rank_j)) + (rank_(n-1) / product(i in 0..n, max_rank_i))\n")])])]),a("p",[e._v("The intuition behind this formula is that every document falls in a range for each rule, between "),a("code",[e._v("rank_i / max_rank_i")]),e._v(" and "),a("code",[e._v("(rank_i - 1) / max_rank_i")]),e._v(", and the next ranking rule allows to refine where the document is in this range, with the last ranking rule providing the exact score.")]),e._v(" "),a("h3",{attrs:{id:"_4-2-hidden-ranking-rules"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-2-hidden-ranking-rules"}},[e._v("#")]),e._v(" 4.2. Hidden ranking rules")]),e._v(" "),a("p",[e._v("If the "),a("RouterLink",{attrs:{to:"/specifications/text/0123-displayed-attributes-setting-api.html"}},[a("code",[e._v("displayedAttributes")])]),e._v(" list is defined, then attributes that are not part of that list, but are used in "),a("code",[e._v("sort")]),e._v(" ranking rules are "),a("strong",[e._v("hidden")]),e._v(".")],1),e._v(" "),a("p",[e._v("Instead of seeing "),a("code",[e._v("{:attribute-sorted-on}:{:sort-direction}")]),e._v(" like described in "),a("a",{attrs:{href:"#323-sort-ranking-rules"}},[e._v("the relevant section")]),e._v(", the name of that field is replaced with "),a("code",[e._v("")]),e._v(", with "),a("code",[e._v("{:number}")]),e._v(" a number that serves to uniquely distinguish between such hidden rules.")]),e._v(" "),a("p",[e._v("Note: that number is not guaranteed to start at 0 nor to be consecutive. The only guarantee is that no hidden ranking rule will have the same number.")]),e._v(" "),a("p",[e._v("Furthermore, the "),a("code",[e._v("value")]),e._v(" that was used to sort the document is also hidden and replaced by "),a("code",[e._v('""')]),e._v(".")]),e._v(" "),a("h3",{attrs:{id:"_4-3-disabled-optimization"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_4-3-disabled-optimization"}},[e._v("#")]),e._v(" 4.3. Disabled optimization")]),e._v(" "),a("p",[e._v("The engine optimizes search by skipping the application of ranking rules when there's only one remaining document (no tie to break).")]),e._v(" "),a("p",[e._v("To compute an accurate score, however, all ranking rules must be applied, so this optimization is disabled as soon as a score is requested in the search request. When no scores are requested, the optimization is active.")]),e._v(" "),a("h2",{attrs:{id:"_5-future-possibilities"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#_5-future-possibilities"}},[e._v("#")]),e._v(" 5. Future Possibilities")]),e._v(" "),a("ul",[a("li",[e._v("Extend the "),a("RouterLink",{attrs:{to:"/specifications/text/0192-multi-search-api.html"}},[e._v("multi-search API")]),e._v(" to rerank documents according to their score, providing federated search.")],1)])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file diff --git a/docs/assets/js/9.0c014273.js b/docs/assets/js/9.0238d3e6.js similarity index 93% rename from docs/assets/js/9.0c014273.js rename to docs/assets/js/9.0238d3e6.js index 8747e61ff..4c2802ef6 100644 --- a/docs/assets/js/9.0c014273.js +++ b/docs/assets/js/9.0238d3e6.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[9],{433:function(t,e,o){"use strict";o.r(e);var n=o(62),i=Object(n.a)({},(function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[o("p",[t._v("MIT License")]),t._v(" "),o("p",[t._v("Copyright (c) 2019-2020 Meili SAS")]),t._v(" "),o("p",[t._v('Permission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the "Software"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:')]),t._v(" "),o("p",[t._v("The above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.")]),t._v(" "),o("p",[t._v('THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.')])])}),[],!1,null,null,null);e.default=i.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[9],{434:function(t,e,o){"use strict";o.r(e);var n=o(62),i=Object(n.a)({},(function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[o("p",[t._v("MIT License")]),t._v(" "),o("p",[t._v("Copyright (c) 2019-2020 Meili SAS")]),t._v(" "),o("p",[t._v('Permission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the "Software"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:')]),t._v(" "),o("p",[t._v("The above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.")]),t._v(" "),o("p",[t._v('THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.')])])}),[],!1,null,null,null);e.default=i.exports}}]); \ No newline at end of file diff --git a/docs/assets/js/app.6fb12f44.js b/docs/assets/js/app.dedba9e9.js similarity index 80% rename from docs/assets/js/app.6fb12f44.js rename to docs/assets/js/app.dedba9e9.js index b2017c59a..1b80548ec 100644 --- a/docs/assets/js/app.6fb12f44.js +++ b/docs/assets/js/app.dedba9e9.js @@ -1,4 +1,4 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[0],[]]);!function(t){function e(e){for(var i,a,l=e[0],s=e[1],u=e[2],f=0,p=[];f=n.length?{value:void 0,done:!0}:(t=i(n,r),e.index+=t.length,{value:t,done:!1})}))},function(t,e,n){var i=n(8),r=n(12),o=n(35);t.exports=i?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e){var n=Array.isArray;t.exports=n},function(t,e,n){var i=n(0),r=n(4),o=n(50),a=i.TypeError;t.exports=function(t){if(r(t))return t;throw a(o(t)+" is not a function")}},function(t,e,n){var i=n(168),r="object"==typeof self&&self&&self.Object===Object&&self,o=i||r||Function("return this")();t.exports=o},function(t,e,n){var i=n(3),r=i({}.toString),o=i("".slice);t.exports=function(t){return o(r(t),8,-1)}},function(t,e,n){var i,r=n(11),o=n(126),a=n(101),l=n(51),s=n(136),u=n(68),c=n(73),f=c("IE_PROTO"),p=function(){},v=function(t){return" + diff --git a/docs/specifications/LICENSE.html b/docs/specifications/LICENSE.html index 1eb084695..f5c0a8633 100644 --- a/docs/specifications/LICENSE.html +++ b/docs/specifications/LICENSE.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/index.html b/docs/specifications/index.html index f8ab9f8ab..f03a42f79 100644 --- a/docs/specifications/index.html +++ b/docs/specifications/index.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/pull_request_template.html b/docs/specifications/pull_request_template.html index c1e1fbfdc..a398ee44f 100644 --- a/docs/specifications/pull_request_template.html +++ b/docs/specifications/pull_request_template.html @@ -8,8 +8,8 @@ - - + +

🤖 API Diff Put the link of the GitHub comment generated by bump.sh if generated; Apply the OpenApi label


# Summary

Explain with a few sentences the goal of the specification


# Changes

Explain in a clear way the changes bring by the specification; Bullet points FTW;

# Out Of Scope

Explain in clear way subjects that are out of scope and shouldn't be discussed by the reviewers


# Attention To Reviewers

Explain clearly what reviewers should specifically look for to facilitate the review phase. Also, mention the sections that will not necessarily be taken into account if reviewed.


# Misc

  • [] Update OpenAPI specification file (if needed; Apply the OpenApi label)
  • [] Update telemetry datapoints (if needed; Apply the Telemetry label)
- + diff --git a/docs/specifications/text/0000-specification-template.html b/docs/specifications/text/0000-specification-template.html index 5f244faec..83465b8e9 100644 --- a/docs/specifications/text/0000-specification-template.html +++ b/docs/specifications/text/0000-specification-template.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0001-frontend-disable-prod.html b/docs/specifications/text/0001-frontend-disable-prod.html index 4d5f14754..b45ec24c4 100644 --- a/docs/specifications/text/0001-frontend-disable-prod.html +++ b/docs/specifications/text/0001-frontend-disable-prod.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0001-script-based-tokenizer.html b/docs/specifications/text/0001-script-based-tokenizer.html index f00dcbdf8..1137ca584 100644 --- a/docs/specifications/text/0001-script-based-tokenizer.html +++ b/docs/specifications/text/0001-script-based-tokenizer.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0028-indexing-csv.html b/docs/specifications/text/0028-indexing-csv.html index 50f84d07b..410dfd5ed 100644 --- a/docs/specifications/text/0028-indexing-csv.html +++ b/docs/specifications/text/0028-indexing-csv.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0029-indexing-ndjson.html b/docs/specifications/text/0029-indexing-ndjson.html index 53d1233f8..89714292e 100644 --- a/docs/specifications/text/0029-indexing-ndjson.html +++ b/docs/specifications/text/0029-indexing-ndjson.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0032-distinct-attribute.html b/docs/specifications/text/0032-distinct-attribute.html index a3ca47543..dbfb66db1 100644 --- a/docs/specifications/text/0032-distinct-attribute.html +++ b/docs/specifications/text/0032-distinct-attribute.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0033-logging.html b/docs/specifications/text/0033-logging.html index 6bbd06cd8..e72dd7332 100644 --- a/docs/specifications/text/0033-logging.html +++ b/docs/specifications/text/0033-logging.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0034-telemetry-policies.html b/docs/specifications/text/0034-telemetry-policies.html index 71f81edd7..3c06da0ce 100644 --- a/docs/specifications/text/0034-telemetry-policies.html +++ b/docs/specifications/text/0034-telemetry-policies.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0038-rename-attributes-for-faceting.html b/docs/specifications/text/0038-rename-attributes-for-faceting.html index 5b589f092..4389b5ba1 100644 --- a/docs/specifications/text/0038-rename-attributes-for-faceting.html +++ b/docs/specifications/text/0038-rename-attributes-for-faceting.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0043-phrase-query.html b/docs/specifications/text/0043-phrase-query.html index 361432bec..7d2809284 100644 --- a/docs/specifications/text/0043-phrase-query.html +++ b/docs/specifications/text/0043-phrase-query.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0047-reset-stop-words-synonyms-settings-with-null.html b/docs/specifications/text/0047-reset-stop-words-synonyms-settings-with-null.html index 3cd146738..b6571692d 100644 --- a/docs/specifications/text/0047-reset-stop-words-synonyms-settings-with-null.html +++ b/docs/specifications/text/0047-reset-stop-words-synonyms-settings-with-null.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0048-rename-max-mdb-size-var.html b/docs/specifications/text/0048-rename-max-mdb-size-var.html index 56d571a9c..cd68e8b26 100644 --- a/docs/specifications/text/0048-rename-max-mdb-size-var.html +++ b/docs/specifications/text/0048-rename-max-mdb-size-var.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0055-sort.html b/docs/specifications/text/0055-sort.html index a1d3c1e71..c1410f4ce 100644 --- a/docs/specifications/text/0055-sort.html +++ b/docs/specifications/text/0055-sort.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0059-geo-search.html b/docs/specifications/text/0059-geo-search.html index 79249b403..08d56deba 100644 --- a/docs/specifications/text/0059-geo-search.html +++ b/docs/specifications/text/0059-geo-search.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0060-tasks-api.html b/docs/specifications/text/0060-tasks-api.html index ccabff7f7..b4772fb85 100644 --- a/docs/specifications/text/0060-tasks-api.html +++ b/docs/specifications/text/0060-tasks-api.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0061-error-format-and-definitions.html b/docs/specifications/text/0061-error-format-and-definitions.html index f74884849..e1abbcfc2 100644 --- a/docs/specifications/text/0061-error-format-and-definitions.html +++ b/docs/specifications/text/0061-error-format-and-definitions.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0077-words-position-limit.html b/docs/specifications/text/0077-words-position-limit.html index e4a58965f..e639e8e52 100644 --- a/docs/specifications/text/0077-words-position-limit.html +++ b/docs/specifications/text/0077-words-position-limit.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0085-api-keys.html b/docs/specifications/text/0085-api-keys.html index d251589a4..803de9d13 100644 --- a/docs/specifications/text/0085-api-keys.html +++ b/docs/specifications/text/0085-api-keys.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0089-tenant-tokens.html b/docs/specifications/text/0089-tenant-tokens.html index 89090f6d2..3758919d2 100644 --- a/docs/specifications/text/0089-tenant-tokens.html +++ b/docs/specifications/text/0089-tenant-tokens.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0096-auto-batching.html b/docs/specifications/text/0096-auto-batching.html index d849a43e4..e4ba682eb 100644 --- a/docs/specifications/text/0096-auto-batching.html +++ b/docs/specifications/text/0096-auto-batching.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0105-dumps-api.html b/docs/specifications/text/0105-dumps-api.html index 808909141..363a92f97 100644 --- a/docs/specifications/text/0105-dumps-api.html +++ b/docs/specifications/text/0105-dumps-api.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0117-typo-tolerance-setting-api.html b/docs/specifications/text/0117-typo-tolerance-setting-api.html index ca3d74b91..c02f91a3d 100644 --- a/docs/specifications/text/0117-typo-tolerance-setting-api.html +++ b/docs/specifications/text/0117-typo-tolerance-setting-api.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0118-search-api.html b/docs/specifications/text/0118-search-api.html index 05ddb3cbf..0ef16c326 100644 --- a/docs/specifications/text/0118-search-api.html +++ b/docs/specifications/text/0118-search-api.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0119-instance-options.html b/docs/specifications/text/0119-instance-options.html index 5d27fd80c..856c59a51 100644 --- a/docs/specifications/text/0119-instance-options.html +++ b/docs/specifications/text/0119-instance-options.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0121-data-types.html b/docs/specifications/text/0121-data-types.html index 8d58cd2ba..c6e1ee6eb 100644 --- a/docs/specifications/text/0121-data-types.html +++ b/docs/specifications/text/0121-data-types.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0123-displayed-attributes-setting-api.html b/docs/specifications/text/0123-displayed-attributes-setting-api.html index ad345d735..1e8f67809 100644 --- a/docs/specifications/text/0123-displayed-attributes-setting-api.html +++ b/docs/specifications/text/0123-displayed-attributes-setting-api.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0123-distinct-attribute-setting-api.html b/docs/specifications/text/0123-distinct-attribute-setting-api.html index d4046df50..7429faa54 100644 --- a/docs/specifications/text/0123-distinct-attribute-setting-api.html +++ b/docs/specifications/text/0123-distinct-attribute-setting-api.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0123-filterable-attributes-setting-api.html b/docs/specifications/text/0123-filterable-attributes-setting-api.html index 54ffd5216..6d83adda3 100644 --- a/docs/specifications/text/0123-filterable-attributes-setting-api.html +++ b/docs/specifications/text/0123-filterable-attributes-setting-api.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0123-proximity-precision.html b/docs/specifications/text/0123-proximity-precision.html index e8d8fdaf4..0c96125c7 100644 --- a/docs/specifications/text/0123-proximity-precision.html +++ b/docs/specifications/text/0123-proximity-precision.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0123-ranking-rules-setting-api.html b/docs/specifications/text/0123-ranking-rules-setting-api.html index cb2a6f55a..03e1baa92 100644 --- a/docs/specifications/text/0123-ranking-rules-setting-api.html +++ b/docs/specifications/text/0123-ranking-rules-setting-api.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0123-searchable-attributes-setting-api.html b/docs/specifications/text/0123-searchable-attributes-setting-api.html index 6b13620ef..01e528192 100644 --- a/docs/specifications/text/0123-searchable-attributes-setting-api.html +++ b/docs/specifications/text/0123-searchable-attributes-setting-api.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0123-separators-settings-api.html b/docs/specifications/text/0123-separators-settings-api.html index 881758b6f..6cecb3b5e 100644 --- a/docs/specifications/text/0123-separators-settings-api.html +++ b/docs/specifications/text/0123-separators-settings-api.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0123-settings-api.html b/docs/specifications/text/0123-settings-api.html index 1a5c38ee1..bd2cfe853 100644 --- a/docs/specifications/text/0123-settings-api.html +++ b/docs/specifications/text/0123-settings-api.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0123-sortable-attributes-setting-api.html b/docs/specifications/text/0123-sortable-attributes-setting-api.html index 38b561839..6f45506a6 100644 --- a/docs/specifications/text/0123-sortable-attributes-setting-api.html +++ b/docs/specifications/text/0123-sortable-attributes-setting-api.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0123-stop-words-setting-api.html b/docs/specifications/text/0123-stop-words-setting-api.html index 808502755..cac8b2542 100644 --- a/docs/specifications/text/0123-stop-words-setting-api.html +++ b/docs/specifications/text/0123-stop-words-setting-api.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0123-synonyms-setting-api.html b/docs/specifications/text/0123-synonyms-setting-api.html index 134c20c75..78c2a6dd3 100644 --- a/docs/specifications/text/0123-synonyms-setting-api.html +++ b/docs/specifications/text/0123-synonyms-setting-api.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0123-user-dictionary-settings-api.html b/docs/specifications/text/0123-user-dictionary-settings-api.html index 1f3a2d3e6..1ad55ffca 100644 --- a/docs/specifications/text/0123-user-dictionary-settings-api.html +++ b/docs/specifications/text/0123-user-dictionary-settings-api.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0124-documents-api.html b/docs/specifications/text/0124-documents-api.html index 0b5a99865..a6e0b40b7 100644 --- a/docs/specifications/text/0124-documents-api.html +++ b/docs/specifications/text/0124-documents-api.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0132-indexes-api.html b/docs/specifications/text/0132-indexes-api.html index d163626e3..6d035d04d 100644 --- a/docs/specifications/text/0132-indexes-api.html +++ b/docs/specifications/text/0132-indexes-api.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0134-stats-api.html b/docs/specifications/text/0134-stats-api.html index 07878d940..556c8591e 100644 --- a/docs/specifications/text/0134-stats-api.html +++ b/docs/specifications/text/0134-stats-api.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0135-indexing-json.html b/docs/specifications/text/0135-indexing-json.html index d183012d5..c6f21e47a 100644 --- a/docs/specifications/text/0135-indexing-json.html +++ b/docs/specifications/text/0135-indexing-json.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0136-documents-soft-deletion.html b/docs/specifications/text/0136-documents-soft-deletion.html index ab8f3ab86..6c7224645 100644 --- a/docs/specifications/text/0136-documents-soft-deletion.html +++ b/docs/specifications/text/0136-documents-soft-deletion.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0171-version-api.html b/docs/specifications/text/0171-version-api.html index 3acfb6364..7e362f68a 100644 --- a/docs/specifications/text/0171-version-api.html +++ b/docs/specifications/text/0171-version-api.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0172-health-api.html b/docs/specifications/text/0172-health-api.html index 1df1ccb6e..87a6da456 100644 --- a/docs/specifications/text/0172-health-api.html +++ b/docs/specifications/text/0172-health-api.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0174-metrics-api.html b/docs/specifications/text/0174-metrics-api.html index 1de7ded66..ae595243e 100644 --- a/docs/specifications/text/0174-metrics-api.html +++ b/docs/specifications/text/0174-metrics-api.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0178-compression-headers.html b/docs/specifications/text/0178-compression-headers.html index a4e9b184e..4f81d7075 100644 --- a/docs/specifications/text/0178-compression-headers.html +++ b/docs/specifications/text/0178-compression-headers.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0185-configuration-file.html b/docs/specifications/text/0185-configuration-file.html index b39da21b5..b3b6b9045 100644 --- a/docs/specifications/text/0185-configuration-file.html +++ b/docs/specifications/text/0185-configuration-file.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0191-swap-indexes-api.html b/docs/specifications/text/0191-swap-indexes-api.html index 3644c4962..fdb8d6339 100644 --- a/docs/specifications/text/0191-swap-indexes-api.html +++ b/docs/specifications/text/0191-swap-indexes-api.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0192-multi-search-api.html b/docs/specifications/text/0192-multi-search-api.html index 202f590c5..6e30ec514 100644 --- a/docs/specifications/text/0192-multi-search-api.html +++ b/docs/specifications/text/0192-multi-search-api.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0193-experimental-features.html b/docs/specifications/text/0193-experimental-features.html index dbdf042a1..e4ae32219 100644 --- a/docs/specifications/text/0193-experimental-features.html +++ b/docs/specifications/text/0193-experimental-features.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0194-experimental-feature-api.html b/docs/specifications/text/0194-experimental-feature-api.html index 766428a2b..5b9fff7c6 100644 --- a/docs/specifications/text/0194-experimental-feature-api.html +++ b/docs/specifications/text/0194-experimental-feature-api.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0195-ranking-score.html b/docs/specifications/text/0195-ranking-score.html index de30f31c2..383c7fed8 100644 --- a/docs/specifications/text/0195-ranking-score.html +++ b/docs/specifications/text/0195-ranking-score.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0246-facet-search-api.html b/docs/specifications/text/0246-facet-search-api.html index 37becede1..6baa553ae 100644 --- a/docs/specifications/text/0246-facet-search-api.html +++ b/docs/specifications/text/0246-facet-search-api.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0258-snapshots-api.html b/docs/specifications/text/0258-snapshots-api.html index 05d31fecf..cd86d28aa 100644 --- a/docs/specifications/text/0258-snapshots-api.html +++ b/docs/specifications/text/0258-snapshots-api.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/0262-task-queue-webhook.html b/docs/specifications/text/0262-task-queue-webhook.html index fdacefc08..1f527094b 100644 --- a/docs/specifications/text/0262-task-queue-webhook.html +++ b/docs/specifications/text/0262-task-queue-webhook.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/157-faceting-setting-api.html b/docs/specifications/text/157-faceting-setting-api.html index f555b3d88..d88f010a8 100644 --- a/docs/specifications/text/157-faceting-setting-api.html +++ b/docs/specifications/text/157-faceting-setting-api.html @@ -8,8 +8,8 @@ - - + +
- + diff --git a/docs/specifications/text/157-pagination-setting-api.html b/docs/specifications/text/157-pagination-setting-api.html index 912b7405b..c2c92dafd 100644 --- a/docs/specifications/text/157-pagination-setting-api.html +++ b/docs/specifications/text/157-pagination-setting-api.html @@ -8,8 +8,8 @@ - - + +