manticoresearch/models/autocomplete_request.rs
1/*
2 * Manticore Search Client
3 *
4 * Сlient for Manticore Search.
5 *
6 * The version of the OpenAPI document: 5.0.0
7 * Contact: info@manticoresearch.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// AutocompleteRequest : Object containing the data for performing an autocomplete search.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct AutocompleteRequest {
17 /// The table to perform the search on
18 #[serde(rename = "table")]
19 pub table: String,
20 /// The beginning of the string to autocomplete
21 #[serde(rename = "query")]
22 pub query: String,
23 /// Autocomplete options - layouts: A comma-separated string of keyboard layout codes to validate and check for spell correction. Available options - us, ru, ua, se, pt, no, it, gr, uk, fr, es, dk, de, ch, br, bg, be. By default, all are enabled. - fuzziness: (0,1 or 2) Maximum Levenshtein distance for finding typos. Set to 0 to disable fuzzy matching. Default is 2 - prepend: true/false If true, adds an asterisk before the last word for prefix expansion (e.g., *word ) - append: true/false If true, adds an asterisk after the last word for prefix expansion (e.g., word* ) - expansion_len: Number of characters to expand in the last word. Default is 10.
24 #[serde(rename = "options", skip_serializing_if = "Option::is_none")]
25 pub options: Option<serde_json::Value>,
26}
27
28impl AutocompleteRequest {
29 /// Object containing the data for performing an autocomplete search.
30 pub fn new(table: String, query: String) -> AutocompleteRequest {
31 AutocompleteRequest {
32 table,
33 query,
34 options: None,
35 }
36 }
37}
38