Welcome to Working With Rails

 

Discussion Forums

Discuss all things Ruby on Rails with perhaps the web's most vibrant group of Ruby on Rails enthusiasts.
Search working but could use changes
3 Posts
Search working but could use changes

This is the followup from the search discussion in the "kiled the site" thread.

Search seems to be working, both forum search (which I didn't test before) and people/company search. However, I have one slight disagreement on the functionality:

If I put in multiple terms it treats them as "or" rather than "and". I think defaulting to "and" would be more useful. For instance if I people-search on "dave aronson" (sans quotes) I get all the Daves and all the Aronsons, and if I forum-search on "ajax pagination" (ditto) I get all the stuff about AJAX and all the stuff about pagination. That makes it hard to narrow the results down to what the user wants. At least if I use quotes, it looks for the exact phrase, which is good for individual names or phrases, but sometimes one wants a combination that might not be contiguous.

However, since using an explicit AND in the search, it's not that big a deal... especially if you put in a bit of search syntax help so people see that.

Thanks, Dave

Person
Forum Rating: 100
Sign In To Rate Post

Dave, you are officially our feedback superstar!

As you said you can do dave AND aronson (AND must be in uppercase) or put it in quotes to find that exact phrase. Also you can put + before each search term, e.g. +dave +aronson which reads as "MUST include 'dave', MUST include 'aronson'" which is good because it will work when there are other words in between.

You're definitely right about some search syntax help. There are other things you can do too which you might find useful. You can use -term to make sure results don't contain the term, e.g. +aronson will get you two Aronsons, but -dave +aronson will just return the other one. You can use wildcards, so +dav* +aronson will find you regardless of Dave versus David. ? acts as a single character wildcard. You can of course combine all this stuff and do things like dav* AND aronso? AND NOT fairfax which would return nobody as there are none elsewhere.

You can also search on a particular attribute, so whilst london will return loads of things with most of them in London as the location, doing name:london will search for things with London in the name.

Any objections if we cut and paste the above in to the search help?

Last Edited by WWR at 23 Nov 01:17
Screen_shot_2012-10-12_at_22.27.48
WWR
Administrator
Forum Rating: 50
Sign In To Rate Post

Aha! Having the + available will certainly help, and I very much like that you've got wildcards. That will also help find me if someone's unsure whether I'm from the rich side of the family, that can afford an extra A on the front. ;-)

I don't mind if you put whatever you want in your search help; just having search help at all will, well, help. :-)

Person
Forum Rating: 100
Sign In To Rate Post
3 Posts
Login to add your message