Search result is not stable

tpytpy Member
edited July 2023 in Bugs

Hi, I'm having an issue that search result is not stable.

For example, when I tried to search the following query

@artist "Arcadia Q"

on my environment several times, sometimes the search results are correct (Albums: 7, Artists: 1, Songs: 25) but sometimes an empty result is returned.

Is this an expected behavior? Are there any API options for workaround?

Comments

  • gravelldgravelld Administrator

    It's not expected behaviour.

    Is it either the same result set, or an empty result set?

    The latter may be some sort of temporary problem, e.g. too many requests already running at that time.

    Are there any API options for workaround?

    Where are you running your searches from - the Web app? How would an API help, unless you're happy dealing with data meant for programmatic use? Anyway, you could try https://asti.ga/developers/#searching

  • tpytpy Member
    edited July 2023

    I noticed the issue since my app which was using Astiga API occasionally failed to find a song.

    So I tried the query from the Astiga Web app and I confirmed the same issue happened.

    Search result could be the correct result set or an empty result set. Each search returns either.

    (I tried to run the query at every 3 sec from the Web app now, the results were empty -> correct -> correct -> empty -> empty -> empty.)

    e.g. too many requests already running at that time.

    I suspected it too, and now I'm using the API at 1req / 1sec at most, but I'm still having the issue.

  • gravelldgravelld Administrator

    Ok, give me a while and I'll try to replicate and find out what's going on.

    Out of interest, let me know about your app, sounds like a fun project!

  • tpytpy Member

    Thanks!

    I'm developing a MPD client called Sola MPD which supports playlist sync between MPD <> Astiga as a plugin.

  • gravelldgravelld Administrator

    Oh, very cool! I've starred that to keep an eye on developments! I'll tweet/post it out if it's alright with you.

  • tpytpy Member

    Sure, I appriciate it!

  • gravelldgravelld Administrator

    Sorry - ran out of time to replicate this - I'll try next week.

  • gravelldgravelld Administrator

    I managed to replicate this once but no more - could you send the query you're attempting via email? info@asti.ga .

  • tpytpy Member

    hmm, I still see the issue on the Web app with the following query in the original post:

    @artist "Arcadia Q"

    Does this query always return the same result set for you?

  • gravelldgravelld Administrator
    edited July 2023

    Ah, I wasn't using the artist operator. I'll try that.

  • gravelldgravelld Administrator

    Can I ask where you got the idea to add the syntax @artist ? The reason I ask is that the app already does that when searching for artists. It's probably safest to just send the artist name - remember that you can specify you're looking for an artist in the API by passing artist : https://asti.ga/developers/#searching

    It appears to be the "Q" bit that causes the issue. If you just search for "Arcadia" the result shows, and most reliably without the quotes.

    I've created a thread on the search software here: https://forum.manticoresearch.com/t/unstable-search-results/1519

  • tpytpy Member
    edited July 2023

    Thanks for your investigation.


    This is how I decided to use the syntax:

    • Read the API reference and found

    Please use search2 instead.

    • In the search2 section, I found query parameter but there was no description about the syntax.
    • I searched `search syntax` in this community and found the following comment


    For my usecase, I need exact match rather than fuzzy search to identify a song.

    Actually I have a lot of edge cases that fuzzy search doesn't work. For examle:

    • #5 returns empty (@album "#5" works)
    • 4 returns empty (@title "4" works)
    • Sym:No.5 returns empty (@album "Sym:No.5" works)

    So currently my own best practice is using the field operator with certain number of retry.

    If search is more appricable, I will use it then.

  • gravelldgravelld Administrator

    Thanks.

    Although I linked to that documentation I didn't necessarily mean users of search should adopt it. Whether using search2 or search we still mangle the query string ourselves, and adding the @ syntax ends up being placed inside the query match text, so probably will not help.

    Ok, it appears search is deprecated - I forgot that. Probably best to avoid it then.

    Regarding the exact match/fuzzy searching - there might be something I'm not understanding about how the searches work; it surprises me it does work with the @ switches. I need to read up on the use of quotes too, I think.

    I'll wait on the reply to the Manticore thread.

  • gravelldgravelld Administrator

    Reviewing this a bit more - the "Arcadia" album is not in your library any more - is this expected?

Sign In or Register to comment.