AIMP Forum

AIMP for Android => Предложения / Suggestions => Topic started by: Tenbob on February 03, 2023, 16:04:05

Title: Improved search function
Post by: Tenbob on February 03, 2023, 16:04:05
Hi. I'd like to suggest an improvement to make it easier to search for songs. At present everything you type in the search box is treated as a single literal string. It would be be easier to use if each word was treated as a separate search term linked by the AND function.

For example. I want to search for a song by the Beatles with Love in the title. If I put "Beatles Love" into the search box I get no results. With this enhancement it would search separately for each word and give hits for the following ...


This type of search is the default on several other music players. I hope you will consider implementing it, as I really like using AIMP on Android.
Title: Re: Improved search function
Post by: Auré on July 22, 2023, 22:50:09
+1
If you don't mind, I repost it here :

the algorithm is pretty simple :

Code: [Select]
words = explode the search string with space delimiter " " ; it returns array/list of words

foreach (songs_indexed as song) {
  matchedWords = 0;

  foreach (words as word) {
    if (word exist in song) { // regex test or whatever
      matchedWords++;
    }
  }

  if (matchedWords === words.length) {
    push song or songs[i] in search results array
  }

}
Title: Re: Improved search function
Post by: Artem on July 24, 2023, 13:36:59
Ok, I will improve the search soon