Page 1 of 1
Confused about how searching works

Posted:
Sun Sep 13, 2015 4:51 am
by dln949
Version 5.2.1 (build 4428) – March 4, 2015
Server jetty-6.1.x, java 1.8.0_45-internal, Linux (102.6 MB / 142.0 MB)
desktop computer is running Ubuntu 15.04
I still have 10 days left on my trial.
I don't understand how the search function works. Is it searching the file's tags only, or just the file name, or the file path, or some combination of the three?
Re: Confused about how searching works

Posted:
Mon Sep 14, 2015 7:32 pm
by frnx
It's not working that well for me either, a shame since everything else has absolutely no issues. I've had a case where searching for a specific artist name only yielded artist names like "feat. [artist]", but not the exact artist (that DID exist and was shown in both the ID3 tags and folder names on the left panel!). Well, it had multibyte Unicode characters in it, but that can't be it, right?

Re: Confused about how searching works

Posted:
Mon Sep 14, 2015 8:05 pm
by frnx
This got me to look into how Subsonic handles searching. I didn't dive into the code yet so I am not sure of the specific rules, but had a quick look at the Lucene indexes with
Luke. Here are my guesses :
- There are 5 "categories" in the lucene2 directory: artists, artists_id3, albums, albums_id3, songs.
- At least in my library, top-level directory names appear to be used as artist names, then directories below are used as album names -- see the artists and albums indexes.
- It does seem to handle ID3 tags -- see the artists_id3 and albums_id3 indexes.
- I'm assuming search queries are run against each of them in a specific order then aggregated.
- It doesn't handle non-English languages very well ; Chinese/Japanese artist names, in my case, were split character by character, which explained the incoherent search results I observed.
There you go

Re: Confused about how searching works

Posted:
Mon Sep 14, 2015 8:21 pm
by daneren2005
There are separate API methods to do searches by ID3 Tags so that is probably what the _id3 sets are for.
Re: Confused about how searching works

Posted:
Mon Sep 14, 2015 8:45 pm
by frnx
daneren2005 wrote:There are separate API methods to do searches by ID3 Tags so that is probably what the _id3 sets are for.
Ha, that's what the "Per-folder" checkbox in DSub does?
- Code: Select all
SearchResult artists = searchService.search(criteria, musicFolders, SearchService.IndexType.ARTIST);
command.setArtists(artists.getMediaFiles());
SearchResult albums = searchService.search(criteria, musicFolders, SearchService.IndexType.ALBUM);
command.setAlbums(albums.getMediaFiles());
SearchResult songs = searchService.search(criteria, musicFolders, SearchService.IndexType.SONG);
command.setSongs(songs.getMediaFiles());
The above code is how Subsonic handles searching in the web interface. If I'm guessing correctly, since it's not using
IndexType.ALBUM_ID3 and
IndexType.ARTIST_ID3, it's not searching for ID3 tags but only for path components. If that's true, that's a shame...

Re: Confused about how searching works

Posted:
Mon Sep 14, 2015 9:28 pm
by daneren2005
No, the "Per Folder" checkbox restricts the album lists to just the folder you have selected. I know, not very intuitive, but I couldn't think of a verbose enough label that would fit there. To browse by tags in DSub you do Settings -> Servers -> Your Server -> Browse By Tags. You lose the ability to change folders since it is not supported by the API though.
Re: Confused about how searching works

Posted:
Mon Sep 14, 2015 11:57 pm
by dln949
ok...... So......
For a layman like me, what is the answer to the original question in this thread?
Re: Confused about how searching works

Posted:
Mon Oct 26, 2015 1:03 am
by john_es
Yeah, I am curious too. All of my songs are tagged, however I don't keep them in one giant folder... rather it's broken up by a few top-level ones and then by artist-album. Still, searching is pretty much non-existent.