advanced query/expression builder doesn work under test in a script

You found a bug or have any issues? Please post them here!
fjb59
Posts: 92
Joined: 23 Jul 2022 09:02
advanced query/expression builder doesn work under test in a script

Post by fjb59 »

when i do a search for a track in the library, i use the espression builder/ advanced query engine to look for tracks based on meta. in the library it works fine
then i noticeed you can add filters into sctipt templates. i sueful feature i would like to use but
example:
in the library, i selct a catagory or prog rock. In the expression builder i set date.year=1971 as search catagory. it returns 33 tracks. all good.

I want to add this to an existing script templet so i open a script templte. there is aleady an entry for grog rock taht's set to randon acone containst *ANYOF* followed by a list of folders. exactly the smae ones as i used in the library quert builder. i click on the query builder in the script window next to the prog rock entries and enter exactly the same expression as i did in the library query builder but it returns no results. at the top thereis a field ow what it's earching for an in what folders. only the first folder in the entire catagory was shown. all the rest were omitted. Why? is this a bug or something i can fix?
User avatar
radio42
Site Admin
Posts: 8350
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: advanced query/expression builder doesn work under test in a script

Post by radio42 »

This is no bug. You probably misunderstood how the ANYOF operation works.
It does not combine all tracks of all media libraries and build a union of all tracks on which then the filter is applied.
Instead, the ANYOF first selects randomly any media lib out of all the libs given, and it then applies the filter only on that selected lib.
fjb59
Posts: 92
Joined: 23 Jul 2022 09:02
Re: advanced query/expression builder doesn work under test in a script

Post by fjb59 »

radio42 wrote: 18 Jul 2023 23:13 This is no bug. You probably misunderstood how the ANYOF operation works.
It does not combine all tracks of all media libraries and build a union of all tracks on which then the filter is applied.
Instead, the ANYOF first selects randomly any media lib out of all the libs given, and it then applies the filter only on that selected lib.
So how is it that exactly the same expression on exactly the same criteria work and how do i make it work in the filter of the template script?
User avatar
radio42
Site Admin
Posts: 8350
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: advanced query/expression builder doesn work under test in a script

Post by radio42 »

I am not sure what you mean!
The filter expression will always work in the same way!

But if you use the ANYOF operation on media libraries, the result might be different on each lib being selected.
fjb59
Posts: 92
Joined: 23 Jul 2022 09:02
Re: advanced query/expression builder doesn work under test in a script

Post by fjb59 »

radio42 wrote: 19 Jul 2023 12:00 I am not sure what you mean!
The filter expression will always work in the same way!

But if you use the ANYOF operation on media libraries, the result might be different on each lib being selected.
clearly it doesn't work the same way as if it did i wouldn't have posted this post.

I use same forms and the same data bot both scenarios. on returns data, the other does not.

you keep telling me i shouldn't use the anyof fuction. i dodn't choose to use it, your seftware put it when a selected the libraries (folders) to search. however you haven't told my what i should be using and how to find it.
User avatar
radio42
Site Admin
Posts: 8350
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: advanced query/expression builder doesn work under test in a script

Post by radio42 »

Maybe I understood your use case incorrectly?! And we are talking about different things?

Can you maybe explain again (or in more detail) the two scenarios which return different results?!

- how and where exactly do you search within a library?
- how and where exactly do you search in a script template?

Maybe a few screenshots help me understand…
fjb59
Posts: 92
Joined: 23 Jul 2022 09:02
Re: advanced query/expression builder doesn work under test in a script

Post by fjb59 »

radio42 wrote: 19 Jul 2023 16:45 Maybe I understood your use case incorrectly?! And we are talking about different things?

Can you maybe explain again (or in more detail) the two scenarios which return different results?!

- how and where exactly do you search within a library?
- how and where exactly do you search in a script template?

Maybe a few screenshots help me understand…
i shall take a video next time i am at the box and post a link on here.
fjb59
Posts: 92
Joined: 23 Jul 2022 09:02
Re: advanced query/expression builder doesn work under test in a script

Post by fjb59 »

fjb59 wrote: 19 Jul 2023 20:44
radio42 wrote: 19 Jul 2023 16:45 Maybe I understood your use case incorrectly?! And we are talking about different things?

Can you maybe explain again (or in more detail) the two scenarios which return different results?!

- how and where exactly do you search within a library?
- how and where exactly do you search in a script template?

Maybe a few screenshots help me understand…
i shall take a video next time i am at the box and post a link on here.
two queries
in the find track search engine, filter applied
and in template tracklist. filter applied. they seem to use the same query engine but the template tracklist query doesn't renturn the same results as the search track despie scaxtly the same data being passed in to both in each instance.

So how do i make the filter in the template rerurn the same as the search track?
video link below

https://youtu.be/reET7hrar2k
User avatar
radio42
Site Admin
Posts: 8350
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: advanced query/expression builder doesn work under test in a script

Post by radio42 »

Yes, this almost exactly of what I already tried to explain.

In your search within the Find Window you selected a 'Category' as media libraries and then performed a search (using a filter criteria).
The search within the Find Window is ALWAYS performed on ALL selected media libraries (when you select a category on ALL libs within that category; when you don't select a media library it even uses ALL libs). I.e. the search is performed on each lib sequentially. As such, the result contains ALL tracks found in ANY/ALL libs.
You can also display the 'Media Library' column from the column chooser in the Find Window to validate this.

When you are using a Filter Expression in a script-line using the ANYOF mode for a category of media-libs, this search works DIFFERENTLY!
As already explained above: It does NOT combine all tracks of all media libraries and build a union of all tracks on which then the filter is applied (like in the Find Window). Instead, the ANYOF first selects randomly ONE media lib out of all the libs given, and it then applies the filter only on that selected lib.
You can even see this in the 'Test...' function you are using, that the selected media library is display on to of the Test Results! I.e. when you click on the 'Test...' button multiple times, you will see, that a different media lib is selected each time and as such, the Test Result is different each time.
This behavior is consistent, as a script-line on returns one result and not all tracks!

I.e. the final result is correct and as designed - as the ANYOF (of a script-line) also returns any track out of the result of ALL tracks (exactly like in the Find Window) - BUT the result is just displayed differently and according to the logic of the script-processing!

So you assumption, that both functions should/must deliver the same result is not correct.
fjb59
Posts: 92
Joined: 23 Jul 2022 09:02
Re: advanced query/expression builder doesn work under test in a script

Post by fjb59 »

radio42 wrote: 21 Jul 2023 12:18 Yes, this almost exactly of what I already tried to explain.

In your search within the Find Window you selected a 'Category' as media libraries and then performed a search (using a filter criteria).
The search within the Find Window is ALWAYS performed on ALL selected media libraries (when you select a category on ALL libs within that category; when you don't select a media library it even uses ALL libs). I.e. the search is performed on each lib sequentially. As such, the result contains ALL tracks found in ANY/ALL libs.
You can also display the 'Media Library' column from the column chooser in the Find Window to validate this.

When you are using a Filter Expression in a script-line using the ANYOF mode for a category of media-libs, this search works DIFFERENTLY!
As already explained above: It does NOT combine all tracks of all media libraries and build a union of all tracks on which then the filter is applied (like in the Find Window). Instead, the ANYOF first selects randomly ONE media lib out of all the libs given, and it then applies the filter only on that selected lib.
You can even see this in the 'Test...' function you are using, that the selected media library is display on to of the Test Results! I.e. when you click on the 'Test...' button multiple times, you will see, that a different media lib is selected each time and as such, the Test Result is different each time.
This behavior is consistent, as a script-line on returns one result and not all tracks!

I.e. the final result is correct and as designed - as the ANYOF (of a script-line) also returns any track out of the result of ALL tracks (exactly like in the Find Window) - BUT the result is just displayed differently and according to the logic of the script-processing!

So you assumption, that both functions should/must deliver the same result is not correct.
you're just repeating yourself, esxplaining something that you do not need to explain as i already get it. what you haven't done is answer the question whcih is
HOW DO I FIX IT SO I GET THE SAME RESULTS IN THE TEMPLATE AS I DID IN THE SEARCH WINDOW.
how many times do i need to repeat myself before you asnwer the question i asked in the first place?

Post Reply