Bump meilisearch version (#799)

This commit is contained in:
Geometrically
2023-12-12 21:04:40 -07:00
committed by GitHub
parent abbeed394e
commit c0c5978028
6 changed files with 27 additions and 49 deletions

56
Cargo.lock generated
View File

@@ -427,12 +427,6 @@ dependencies = [
"password-hash 0.5.0",
]
[[package]]
name = "arrayvec"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b"
[[package]]
name = "arrayvec"
version = "0.7.4"
@@ -2208,12 +2202,12 @@ dependencies = [
]
[[package]]
name = "iso8601-duration"
version = "0.1.0"
name = "iso8601"
version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "60b51dd97fa24074214b9eb14da518957573f4dec3189112610ae1ccec9ac464"
checksum = "924e5d73ea28f59011fec52a0d12185d496a9b075d360657aed2a5707f701153"
dependencies = [
"nom 5.1.3",
"nom",
]
[[package]]
@@ -2404,26 +2398,13 @@ dependencies = [
"idna 0.3.0",
"mime",
"native-tls",
"nom 7.1.3",
"nom",
"once_cell",
"quoted_printable",
"socket2 0.4.10",
"tokio",
]
[[package]]
name = "lexical-core"
version = "0.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6607c62aa161d23d17a9072cc5da0be67cdfc89d3afb1e8d9c842bebc2525ffe"
dependencies = [
"arrayvec 0.5.2",
"bitflags 1.3.2",
"cfg-if",
"ryu",
"static_assertions",
]
[[package]]
name = "libc"
version = "0.2.150"
@@ -2601,9 +2582,9 @@ checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771"
[[package]]
name = "meilisearch-index-setting-macro"
version = "0.22.1"
version = "0.24.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c9fedd7e2fabfbcc91679f3d76f6d648ea7fc9ea87c841b10d26c2a258f408da"
checksum = "b1f2124b55b9cb28e6a08b28854f4e834a51333cbdc2f72935f401efa686c13c"
dependencies = [
"convert_case 0.6.0",
"proc-macro2",
@@ -2613,16 +2594,16 @@ dependencies = [
[[package]]
name = "meilisearch-sdk"
version = "0.22.1"
version = "0.24.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e6be928c91e1b23689725586b56f3284f394d93185accfa2771caec3e10015d"
checksum = "2257ea8ed24b079c21570f473e58cccc3de23b46cee331fc513fccdc3f1ae5a1"
dependencies = [
"async-trait",
"either",
"futures",
"futures-io",
"isahc",
"iso8601-duration",
"iso8601",
"js-sys",
"jsonwebtoken",
"log",
@@ -2724,17 +2705,6 @@ dependencies = [
"tempfile",
]
[[package]]
name = "nom"
version = "5.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08959a387a676302eebf4ddbcbc611da04285579f76f88ee0506c63b1a61dd4b"
dependencies = [
"lexical-core",
"memchr",
"version_check",
]
[[package]]
name = "nom"
version = "7.1.3"
@@ -3060,7 +3030,7 @@ dependencies = [
"fnv",
"itertools 0.11.0",
"lazy_static",
"nom 7.1.3",
"nom",
"quick-xml 0.28.2",
"regex",
"regex-cache",
@@ -3660,7 +3630,7 @@ version = "1.32.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4c4216490d5a413bc6d10fa4742bd7d4955941d062c0ef873141d6b0e7b30fd"
dependencies = [
"arrayvec 0.7.4",
"arrayvec",
"borsh",
"bytes",
"num-traits",
@@ -4246,7 +4216,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6b7b278788e7be4d0d29c0f39497a0eef3fba6bbc8e70d8bf7fde46edeaa9e85"
dependencies = [
"itertools 0.11.0",
"nom 7.1.3",
"nom",
"unicode_categories",
]

View File

@@ -29,7 +29,7 @@ async-trait = "0.1.70"
dashmap = "5.4.0"
lazy_static = "1.4.0"
meilisearch-sdk = "0.22.0"
meilisearch-sdk = "0.24.3"
rust-s3 = "0.33.0"
reqwest = { version = "0.11.18", features = ["json", "multipart"] }
hyper = { version = "0.14", features = ["full"] }

View File

@@ -12,12 +12,12 @@ services:
POSTGRES_PASSWORD: labrinth
POSTGRES_HOST_AUTH_METHOD: trust
meilisearch:
image: getmeili/meilisearch:v1.0.1
image: getmeili/meilisearch:v1.5.0
restart: on-failure
ports:
- "7700:7700"
volumes:
- meilisearch-data:/meili_data
- meilisearch-data:/data.ms
environment:
MEILI_MASTER_KEY: modrinth
redis:

View File

@@ -68,7 +68,11 @@ pub async fn loader_list(
name: l.name,
// Add generic 'project' type to all loaders, which is the v2 representation of
// a project type before any versions are set.
supported_project_types: l.supported_project_types.into_iter().chain(std::iter::once("project".to_string())).collect(),
supported_project_types: l
.supported_project_types
.into_iter()
.chain(std::iter::once("project".to_string()))
.collect(),
})
.collect::<Vec<_>>();
Ok(HttpResponse::Ok().json(loaders))

View File

@@ -204,6 +204,8 @@ async fn create_or_update_index(
} else {
old_settings.faceting
},
typo_tolerance: None, // We don't use typo tolerance right now
dictionary: None, // We don't use dictionary right now
};
if old_settings.synonyms != settings.synonyms
@@ -216,6 +218,8 @@ async fn create_or_update_index(
|| old_settings.displayed_attributes != settings.displayed_attributes
|| old_settings.pagination != settings.pagination
|| old_settings.faceting != settings.faceting
|| old_settings.typo_tolerance != settings.typo_tolerance
|| old_settings.dictionary != settings.dictionary
{
info!("Performing index settings set.");
index

View File

@@ -67,7 +67,7 @@ pub struct SearchConfig {
impl SearchConfig {
pub fn make_client(&self) -> Client {
Client::new(self.address.as_str(), self.key.as_str())
Client::new(self.address.as_str(), Some(self.key.as_str()))
}
}
@@ -187,7 +187,7 @@ pub async fn search_for_project(
info: &SearchRequest,
config: &SearchConfig,
) -> Result<SearchResults, SearchError> {
let client = Client::new(&*config.address, &*config.key);
let client = Client::new(&*config.address, Some(&*config.key));
let offset = info.offset.as_deref().unwrap_or("0").parse()?;
let index = info.index.as_deref().unwrap_or("relevance");