Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

11 changes: 10 additions & 1 deletion apps/labrinth/src/models/v3/projects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -928,8 +928,17 @@ impl VersionType {
}

#[derive(
Serialize, Deserialize, Copy, Clone, Debug, PartialEq, Eq, utoipa::ToSchema,
Serialize,
Deserialize,
Copy,
Clone,
Debug,
PartialEq,
Eq,
sqlx::Type,
utoipa::ToSchema,
)]
#[sqlx(type_name = "varchar", rename_all = "lowercase")]
#[serde(rename_all = "lowercase")]
pub enum DependencyType {
Required,
Expand Down
24 changes: 24 additions & 0 deletions apps/labrinth/src/search/backend/elasticsearch/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,18 @@ impl SearchField {
path: "open_source",
mapping: json!({ "type": "boolean" }),
},
SearchField::RequiredDependencies => ElasticsearchFieldSpec {
path: "required_dependencies",
mapping: json!({ "type": "keyword" }),
},
SearchField::OptionalDependencies => ElasticsearchFieldSpec {
path: "optional_dependencies",
mapping: json!({ "type": "keyword" }),
},
SearchField::Incompatibilities => ElasticsearchFieldSpec {
path: "incompatibilities",
mapping: json!({ "type": "keyword" }),
},
SearchField::Environment => ElasticsearchFieldSpec {
path: "environment",
mapping: json!({ "type": "keyword" }),
Expand Down Expand Up @@ -251,6 +263,18 @@ static ELASTICSEARCH_PROPERTIES: LazyLock<serde_json::Map<String, Value>> =
("license".to_string(), json!({ "type": "keyword" })),
("loaders".to_string(), json!({ "type": "keyword" })),
("color".to_string(), json!({ "type": "long" })),
(
"required_dependencies".to_string(),
json!({ "type": "keyword" }),
),
(
"optional_dependencies".to_string(),
json!({ "type": "keyword" }),
),
(
"incompatibilities".to_string(),
json!({ "type": "keyword" }),
),
("environment".to_string(), json!({ "type": "keyword" })),
("mrpack_loaders".to_string(), json!({ "type": "keyword" })),
(
Expand Down
18 changes: 18 additions & 0 deletions apps/labrinth/src/search/backend/meilisearch/indexing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,18 @@ impl SearchField {
path: "open_source",
filterable: true,
},
SearchField::RequiredDependencies => MeilisearchFieldSpec {
path: "required_dependencies",
filterable: true,
},
SearchField::OptionalDependencies => MeilisearchFieldSpec {
path: "optional_dependencies",
filterable: true,
},
SearchField::Incompatibilities => MeilisearchFieldSpec {
path: "incompatibilities",
filterable: true,
},
SearchField::Environment => MeilisearchFieldSpec {
path: "environment",
filterable: true,
Expand Down Expand Up @@ -657,6 +669,9 @@ const DEFAULT_DISPLAYED_ATTRIBUTES: &[&str] = &[
"gallery",
"featured_gallery",
"color",
"required_dependencies",
"optional_dependencies",
"incompatibilities",
// Note: loader fields are not here, but are added on as they are needed (so they can be dynamically added depending on which exist).
// TODO: remove these- as they should be automatically populated. This is a band-aid fix.
"environment",
Expand Down Expand Up @@ -696,6 +711,9 @@ const DEFAULT_SORTABLE_ATTRIBUTES: &[&str] = &[
"date_created",
"date_modified",
"version_published_timestamp",
"required_dependencies",
"optional_dependencies",
"incompatibilities",
"minecraft_java_server.verified_plays_2w",
"minecraft_java_server.ping.data.players_online",
];
21 changes: 21 additions & 0 deletions apps/labrinth/src/search/backend/typesense/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,27 @@ impl SearchField {
sort: false,
optional: true,
},
SearchField::RequiredDependencies => TypesenseFieldSpec {
path: "required_dependencies",
ty: "string[]",
facet: true,
sort: false,
optional: true,
},
SearchField::OptionalDependencies => TypesenseFieldSpec {
path: "optional_dependencies",
ty: "string[]",
facet: true,
sort: false,
optional: true,
},
SearchField::Incompatibilities => TypesenseFieldSpec {
path: "incompatibilities",
ty: "string[]",
facet: true,
sort: false,
optional: true,
},
SearchField::Environment => TypesenseFieldSpec {
path: "environment",
ty: "string[]",
Expand Down
Loading