Skip to content

Commit 17d6127

Browse files
committed
Bump meilisearch version
1 parent bb3de4b commit 17d6127

File tree

5 files changed

+55
-138
lines changed

5 files changed

+55
-138
lines changed

Cargo.lock

Lines changed: 44 additions & 128 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/labrinth/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ async-trait = "0.1.70"
3030
dashmap = "5.4.0"
3131
lazy_static = "1.4.0"
3232

33-
meilisearch-sdk = "0.24.3"
33+
meilisearch-sdk = "0.27.1"
3434
rust-s3 = "0.33.0"
3535
reqwest = { version = "0.11.18", features = ["json", "multipart"] }
3636
hyper = { version = "0.14", features = ["full"] }

apps/labrinth/src/search/indexing/mod.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@ use crate::models::ids::base62_impl::to_base62;
66
use crate::search::{SearchConfig, UploadSearchProject};
77
use local_import::index_local;
88
use log::info;
9-
use meilisearch_sdk::client::Client;
9+
use meilisearch_sdk::client::{Client, SwapIndexes};
1010
use meilisearch_sdk::indexes::Index;
1111
use meilisearch_sdk::settings::{PaginationSetting, Settings};
12-
use meilisearch_sdk::SwapIndexes;
1312
use sqlx::postgres::PgPool;
1413
use thiserror::Error;
1514
#[derive(Error, Debug)]
@@ -100,7 +99,7 @@ pub async fn swap_index(
10099
config: &SearchConfig,
101100
index_name: &str,
102101
) -> Result<(), IndexingError> {
103-
let client = config.make_client();
102+
let client = config.make_client()?;
104103
let index_name_next = config.get_index_name(index_name, true);
105104
let index_name = config.get_index_name(index_name, false);
106105
let swap_indices = SwapIndexes {
@@ -119,7 +118,7 @@ pub async fn get_indexes_for_indexing(
119118
config: &SearchConfig,
120119
next: bool, // Get the 'next' one
121120
) -> Result<Vec<Index>, meilisearch_sdk::errors::Error> {
122-
let client = config.make_client();
121+
let client = config.make_client()?;
123122
let project_name = config.get_index_name("projects", next);
124123
let project_filtered_name =
125124
config.get_index_name("projects_filtered", next);
@@ -285,7 +284,7 @@ pub async fn add_projects(
285284
additional_fields: Vec<String>,
286285
config: &SearchConfig,
287286
) -> Result<(), IndexingError> {
288-
let client = config.make_client();
287+
let client = config.make_client()?;
289288
for index in indices {
290289
update_and_add_to_index(&client, index, &projects, &additional_fields)
291290
.await?;
@@ -296,7 +295,7 @@ pub async fn add_projects(
296295

297296
fn default_settings() -> Settings {
298297
Settings::new()
299-
.with_distinct_attribute("project_id")
298+
.with_distinct_attribute(Some("project_id"))
300299
.with_displayed_attributes(DEFAULT_DISPLAYED_ATTRIBUTES)
301300
.with_searchable_attributes(DEFAULT_SEARCHABLE_ATTRIBUTES)
302301
.with_sortable_attributes(DEFAULT_SORTABLE_ATTRIBUTES)

apps/labrinth/src/search/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ impl SearchConfig {
8080
}
8181
}
8282

83-
pub fn make_client(&self) -> Client {
83+
pub fn make_client(
84+
&self,
85+
) -> Result<Client, meilisearch_sdk::errors::Error> {
8486
Client::new(self.address.as_str(), Some(self.key.as_str()))
8587
}
8688

@@ -190,7 +192,7 @@ pub async fn search_for_project(
190192
info: &SearchRequest,
191193
config: &SearchConfig,
192194
) -> Result<SearchResults, SearchError> {
193-
let client = Client::new(&*config.address, Some(&*config.key));
195+
let client = Client::new(&*config.address, Some(&*config.key))?;
194196

195197
let offset: usize = info.offset.as_deref().unwrap_or("0").parse()?;
196198
let index = info.index.as_deref().unwrap_or("relevance");

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ services:
1212
POSTGRES_PASSWORD: labrinth
1313
POSTGRES_HOST_AUTH_METHOD: trust
1414
meilisearch:
15-
image: getmeili/meilisearch:v1.5.0
15+
image: getmeili/meilisearch:v1.12.0
1616
restart: on-failure
1717
ports:
1818
- '7700:7700'

0 commit comments

Comments
 (0)