-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Event search with list of artists as search term #3
Comments
I'm glad you've found it useful so far.
I'd recommend looking at the MusicBrainz search docs and the Lucene documentation:
https://musicbrainz.org/doc/Indexed_Search_Syntax
https://lucene.apache.org/core/7_7_2/queryparser/org/apache/lucene/queryparser/classic/package-summary.html#package.description
Glancing at Lucene docs it seems Field Grouping might help a bit, but frankly I don't know how well eAlvaBrainz supports that (it's been awhile).
I'm guessing a DSL to support a list that builds a field group would not be too difficult to develop.
…------- Original Message -------
On Tuesday, June 6th, 2023 at 05:19, ReIaxo ***@***.***> wrote:
Hi, first thank you for this amazing library. It is very convenient and nearly fulfills all my needs.
But I have on question: Is it possible to search for an event while adding multiple artist search terms?
I tried this, where i have to chain the artist search terms together with or :
musicBrainzService
.
findEvent
(
Limit
(
50
),
Offset
(
0
)) {
event
(
EventName
.
UNKNOWN
)
and
beginDate
{
Year
(
LocalDate
.
now
().
year
)
inclusive
Year
(
LocalDate
.
now
().
year
+
1
)
}
and
type
(
"Festival"
)
and
(
artist
(
ArtistName
(
"Nightwish"
))
or
artist
(
ArtistName
(
"Blind Guartian"
))
}
But I have a generic list of artists which all have to be concatinated with or. Is there a search term where i can pass a list of artist() or artist names and the operator (or/and)?
As an alternative can one requst results with a raw serch query? Do you may have an example for this?
—
Reply to this email directly, [view it on GitHub](#3), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/ABKLTF27RTHZSGFSHGE5ERLXJ3YY7ANCNFSM6AAAAAAY4DWJS4).
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Okay. I do not fully understand all the Term, Field and EventSearch Code, but i think public fun artistIds(operator: String, mbIds: List<ArtistMbid>): Field =
add(ArtistId, CompoundTerm(operator, mbIds.map { Term(it) })) in Created PullRequest, can you review it and tell me if this may work? |
Ok, I think it works. Tested it with Artist Area in you sample application. I am not able to test it with my app, there a lots of dependency errors when i include ealvabrainz directly as project. ArtistSearch.kt public fun areas(operator: String, areaNames: List<AreaName>): Field =
add(Area, CompoundTerm(operator, areaNames.map { Term(it) })) ArtistSearchViewModel: brainz.findArtist {
artist(ArtistName(query)) and areas(
" or ",
listOf(AreaName("Finland"), AreaName("Germany"))
) So i think the clean way is to add such a method to each field in each search right? Or is there a more generic way? Can you estimate how long it takes for you to review and maybe improve it? When the above written is valid, i can do the changes and update the pullrequest. |
I'll try to look at it this evening
…-------- Original Message --------
On Jun 7, 2023, 12:35 PM, ReIaxo wrote:
Ok, I think it works. Tested it with Artist Area in you sample application. I am not able to test it with my app, there a lots of dependency errors when i include ealvabrainz directly as project.
ArtistSearch.kt
public
fun
areas
(
operator
:
String
,
areaNames
:
List
<
AreaName
>):
Field
=
add
(
Area
,
CompoundTerm
(
operator
,
areaNames
.
map
{
Term
(
it
) }))
ArtistSearchViewModel:
brainz
.
findArtist
{
artist
(
ArtistName
(
query
))
and
areas
(
" or "
,
listOf
(
AreaName
(
"Finland"
),
AreaName
(
"Germany"
))
)
So i think the clean way is to add such a method to each field in each search right? Or is there a more generic way?
And maybe a constant string should be added for " or " and " and ".
Can you estimate how long it takes for you to review and maybe improve it? When the above written is valid, i can do the changes and update the pullrequest.
—
Reply to this email directly, [view it on GitHub](#3 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/ABKLTFYJIYHF6FVZNK55QCLXKCUTZANCNFSM6AAAAAAY4DWJS4).
You are receiving this because you commented.Message ID: ***@***.***>
|
Hi, anything new here? I am just asking because this will become a little blocker soon for me. I will do as much as I can by myself, but I need the qestions to be answered.
I don't want to put pressure, it is not that bad if it takes longer, but i would be happy if we can make progress in the next days. |
Ok, I tried another approach which also works but avoids makeing ArtistSearch.kt public fun artistIds(compoundTerm: CompoundTerm): Field = add(ArtistId, compoundTerm) ArtistSearchViewModel: brainz.findArtist {
artist(ArtistName(query)) and areas(OrOp(listOf("Finland".toTerm(), "Germany".toTerm())))
} But this question is still valid:
But I think it can be answered with Yes, we have to add it for each field in each search. |
Hi, first thank you for this amazing library. It is very convenient and nearly fulfills all my needs.
But I have on question: Is it possible to search for an event while adding multiple artist search terms?
I tried this, where i have to chain the artist search terms together with
or
:But I have a generic list of artists which all have to be concatinated with
or
. Is there a search term where i can pass a list of artist() or artist names and the operator (or
/and
)?As an alternative can one requst results with a raw serch query? Do you may have an example for this?
The text was updated successfully, but these errors were encountered: