You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The QueryBuilder derive macro we use for lucene query does not fit with some of the search queries :
For instance release-groups search accept the following fields :
artist : (part of) the combined credited artist name for the release group, including join phrases (e.g. "Artist X feat.")
artistname : (part of) the name of any of the release group artists
creditname : (part of) the credited name of any of the release group artists on this particular release group
While top level fields of the ReleaseGroup entity (on musicbrainz_rs side) only refers to artists via artist_credit.
We end up with a single query parameter artist_credit in the release group generated builder. We can rename it with the current implementation but we still lacks two artists related fields.
In my opinion the best approach would be to implement this manually and get rid of the query builder macro.
The text was updated successfully, but these errors were encountered:
I see. If this is the case, would it be a good idea to create a different struct for each entity made specifically for search purpose?
I mean ReleaseGroup has all the searchable fields on the api defined here. So we'd create a new struct containing all these searchable fields:
use lucene_query_builder::QueryBuilder;usecrate::entity::alias::Alias;
...#[derive(Debug,Serialize,Deserialize,PartialEq,Clone,QueryBuilder,Default)]structReleaseGroupSearch{alias:Alias,arid:String,artist:String,
...
}
and then we could make use of these structs when making searches:
use musicbrainz_rs::entity::release_group::ReleaseGroupSearch;let query = ReleaseGroupSearch::query_builder().arid("3377f3bb-60fc-4403-aea9-7e800612e060").and().artist("the chainsmokers").build();
The
QueryBuilder
derive macro we use for lucene query does not fit with some of the search queries :For instance release-groups search accept the following fields :
artist
: (part of) the combined credited artist name for the release group, including join phrases (e.g. "Artist X feat.")artistname
: (part of) the name of any of the release group artistscreditname
: (part of) the credited name of any of the release group artists on this particular release groupWhile top level fields of the
ReleaseGroup
entity (on musicbrainz_rs side) only refers to artists viaartist_credit
.We end up with a single query parameter
artist_credit
in the release group generated builder. We can rename it with the current implementation but we still lacks two artists related fields.In my opinion the best approach would be to implement this manually and get rid of the query builder macro.
The text was updated successfully, but these errors were encountered: