Welcome, Guest. Please login or register.
Did you miss your activation email?
May 26, 2012, 01:57:41 AM

Login with username, password and session length
Search:     Advanced search
Interested in joining the WebsiteBaker team?
For more Information read here or on our new website.
155533 Posts in 21713 Topics by 7739 Members
Latest Member: audillino
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: The integrated search function display To Many results.  (Read 458 times)
solbu

Offline Offline

Posts: 22


« on: January 10, 2010, 04:00:14 PM »

We cannot figure out how to configure the search function (wb_url/search/) to narrow down search matches.

To give an exsample of what we can't figure out:
If we search for the word "so", we also get hits/results on soon, sofa, soap, soaking, sober, asocial, esophagus if those words exist in any articles.
We get results on any word where the letters "so" appears in a word.

How can the search function be changed to only display the excact word as entered, and not any other word which happens to have the same letters in it?
« Last Edit: January 10, 2010, 04:02:34 PM by solbu » Logged

My posts are licensed under a Creative Commons license
crnogorac081
AddOn Development
*
Offline Offline

Posts: 1706



« Reply #1 on: January 10, 2010, 09:27:43 PM »

I would search for LIKE term in DB calls in /search/ .php files..

That whould be my starting point..
Logged

Wow, I coded something myself: PM Messanger Modul ,Searchbox with suggestions
Argos
Moderator
**
Offline Offline

Posts: 2161


WWW
« Reply #2 on: October 04, 2011, 03:13:37 PM »

I have the same problem. I often get questions from my clients that find the search function rather useless, and I have to agree. Can this be changed so that only complete words are searched instead of parts?

I also would like to be able to use double quotes to indicate phrase search. Visitors don't understand or use the 3 search options available. And the first one is also the one that yields the most (useless) results....
Logged

Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
WB Showcase: http://www.mywebsitebaker.com/pages/showcase.php?v&category_id=1242&count=30
----------------------------------------------------------------
Please don't request personal support, use the forums!
Argos
Moderator
**
Offline Offline

Posts: 2161


WWW
« Reply #3 on: October 04, 2011, 05:12:41 PM »

Well, I managed to (hopefully) improve the default search function without much effort. I wanted to make the Exact Phrase option the default one, to minimize useless search results. I think most people think that a search function actually searches for their exact input (also on Google). So I have changed 3 things:

1. the search template header field in the backend settings. I have changed the order of the radio buttons and put them each on a different line. The new code is:
Code:
<input type="radio" name="match" id="match_exact" value="exact"[EXACT_CHECKED] />
<label for="match_exact"><strong>The exact search phrase</strong> must be present on the page</label><br />
<input type="radio" name="match" id="match_all" value="all"[ALL_CHECKED] />
<label for="match_all"><strong>All search terms</strong> must be present on the page</label><br />
<input type="radio" name="match" id="match_any" value="any"[ANY_CHECKED] />
<label for="match_any"><strong>Some search terms</strong> must be present on the page</label>
2. the default radio button. In the file search.php I have changed the code on lines 172-181 (WB 2.8.2) to:
Code:
// Get the search type
$match = '';
if(isset($_REQUEST['match'])) {
if($_REQUEST['match']=='any') $match = 'any';
elseif($_REQUEST['match']=='all') $match = 'all';
elseif($_REQUEST['match']=='exact') $match = 'exact';
else $match = 'exact';
} else {
$match = 'exact';
}

3. the radio button labels. The default labels are way too technical. Regular site visitors don't understand logical operators and how search functions work. So I have changed the labels to regular language, as can be seen in my first point above. Maybe the labels can be improved, some real live users testing can be done to see if people understand the new labels.
« Last Edit: October 04, 2011, 05:14:53 PM by Argos » Logged

Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
WB Showcase: http://www.mywebsitebaker.com/pages/showcase.php?v&category_id=1242&count=30
----------------------------------------------------------------
Please don't request personal support, use the forums!
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!