Does search function only match whole words?

General discussions.

Moderator: moderators

Does search function only match whole words?

Postby hakko » Fri Aug 31, 2012 7:26 pm

I was playing with the Subsonic 4.7 beta3 on the demo site. Does the search mechanism only match whole words?

I searched for "pilot" and expected it to match artist "Binaerpilot".
I searched for "pyromantik" and expected it to match album "Pyromantikk".
I search for "unite" and expected it to match song "L'Unité".

But it doesn't? Has it always been like that? I thought it was smarter, using Lucene and everything. I really thought it matched even misspelled words. Thanks if you can help me refresh my memory.
MusicCabinet developer
hakko
 
Posts: 1416
Joined: Tue Apr 17, 2012 7:05 pm
Location: Sweden

Re: Does search function only match whole words?

Postby hakko » Sat Sep 01, 2012 9:33 am

I found the answer to my own question: it seems that you can search for pyro*, but not *pilot (using * as a wildcard). Searching for just pyro doesn't match anything.

I guess I'm just used to the iTunes interface where you can type any search string, like "beatles yellow sub", and have everything that matches returned. Searching for "beatles yellow sub*" seems very unnatural to me.
MusicCabinet developer
hakko
 
Posts: 1416
Joined: Tue Apr 17, 2012 7:05 pm
Location: Sweden

AW: Does search function only match whole words?

Postby MadEvil » Sat Sep 01, 2012 10:02 pm

Hi Hakko,

Found out it can be done with:

queryParser.setAllowLeadingWildcard(true);

I will test this in the next days.

Best regards
Madsonic Developer
User avatar
MadEvil
 
Posts: 354
Joined: Wed Nov 09, 2011 8:35 pm
Location: Vienna

Re: Does search function only match whole words?

Postby hakko » Sun Sep 02, 2012 9:03 am

Nice! I guess people search in different ways, but I really think that the wildcard should be implicit. Why should all users have to learn that "yellow sub beatles" should have been typed in as "yellow sub* beatles" to give any match?

Anyway, I've switched to having PostgreSQL do the search/match, it seems smarter as I can then combine different database queries and for example search for "recently added albums called something X" or "recently played songs called Y".
MusicCabinet developer
hakko
 
Posts: 1416
Joined: Tue Apr 17, 2012 7:05 pm
Location: Sweden

Re: Does search function only match whole words?

Postby MadEvil » Mon Sep 03, 2012 9:35 pm

Hi Hakko,

I test it and worked very well! I get more and better results with this addition with the default Query-parser!

best regards
Madsonic Developer
User avatar
MadEvil
 
Posts: 354
Joined: Wed Nov 09, 2011 8:35 pm
Location: Vienna


Return to General

Who is online

Users browsing this forum: No registered users and 10 guests