|
32 | 32 | LocalizedAttributes,
|
33 | 33 | OpenAiEmbedder,
|
34 | 34 | Pagination,
|
| 35 | + PrefixSearch, |
35 | 36 | ProximityPrecision,
|
36 | 37 | TypoTolerance,
|
37 | 38 | UserProvidedEmbedder,
|
@@ -2056,6 +2057,58 @@ def reset_search_cutoff_ms(self) -> TaskInfo:
|
2056 | 2057 |
|
2057 | 2058 | return TaskInfo(**task)
|
2058 | 2059 |
|
| 2060 | + # PREFIX SEARCH |
| 2061 | + |
| 2062 | + def get_prefix_search(self) -> PrefixSearch: |
| 2063 | + """Get the prefix search settings of an index. |
| 2064 | +
|
| 2065 | + Returns |
| 2066 | + ------- |
| 2067 | + settings: |
| 2068 | + The prefix search settings of the index. |
| 2069 | +
|
| 2070 | + Raises |
| 2071 | + ------ |
| 2072 | + MeilisearchApiError |
| 2073 | + An error containing details about why Meilisearch can't process your request. Meilisearch error codes are described here: https://www.meilisearch.com/docs/reference/errors/error_codes#meilisearch-errors |
| 2074 | + """ |
| 2075 | + prefix_search = self.http.get(self.__settings_url_for(self.config.paths.prefix_search)) |
| 2076 | + |
| 2077 | + return PrefixSearch[to_snake(prefix_search).upper()] |
| 2078 | + |
| 2079 | + def update_prefix_search(self, body: Union[PrefixSearch, None]) -> TaskInfo: |
| 2080 | + """Update the prefix search settings of the index. |
| 2081 | +
|
| 2082 | + Parameters |
| 2083 | + ---------- |
| 2084 | + body: |
| 2085 | + Prefix search settings |
| 2086 | +
|
| 2087 | + Returns |
| 2088 | + ------- |
| 2089 | + task_info: |
| 2090 | + TaskInfo instance containing information about a task to track the progress of an asynchronous process. |
| 2091 | + https://www.meilisearch.com/docs/reference/api/tasks |
| 2092 | + """ |
| 2093 | + task = self.http.put(self.__settings_url_for(self.config.paths.prefix_search), body) |
| 2094 | + |
| 2095 | + return TaskInfo(**task) |
| 2096 | + |
| 2097 | + def reset_prefix_search(self) -> TaskInfo: |
| 2098 | + """Reset the prefix search settings of the index |
| 2099 | +
|
| 2100 | + Returns |
| 2101 | + ------- |
| 2102 | + task_info: |
| 2103 | + TaskInfo instance containing information about a task to track the progress of an asynchronous process. |
| 2104 | + https://www.meilisearch.com/docs/reference/api/tasks |
| 2105 | + """ |
| 2106 | + task = self.http.delete( |
| 2107 | + self.__settings_url_for(self.config.paths.prefix_search), |
| 2108 | + ) |
| 2109 | + |
| 2110 | + return TaskInfo(**task) |
| 2111 | + |
2059 | 2112 | # PROXIMITY PRECISION SETTINGS
|
2060 | 2113 |
|
2061 | 2114 | def get_proximity_precision(self) -> ProximityPrecision:
|
|
0 commit comments