Gossamer Forum
Home : Products : DBMan : Customization :

Exact Search Match Mod

Quote Reply
Exact Search Match Mod
One of my clients requested additional information from the Gossamer techis about modifying the search functions of DBMAN in terms of "Exact Word Matches" within and between fields. Here is the solution that he received and it works.

1) Replace the following line in the sub query routine in db.cgi file:

Code:
($in{'ww'}) and ($tmpreg = "\\b$tmpreg\\b");

with the following codes:

Code:
($in{'ww'}) and ($tmpreg = "^$tmpreg\$");

2) In the sub-routine where you have your search form (like your sub view_search routine) in your html.pl file, you can either add a hidden field or checkbox for users to choose "Exact Word Match".

Here is how you add a hidden field:

Code:
<input type=hidden name="ww" value="on">

Here is how you add a checkbox for this search option:

Code:
<input type=checkbox name="ww" value="on"> Exact Word Match

This should solve the problems that some users are having in terms of matching exact data/values in fields.

I have tested this mod on three different DBMAN projects and it works very nice.

To see this mod in action, go to the following URL:

www.coco.cc.az.us/cgi-bin/schedules/index.cgi?&uid=default

To see how this works, choose the following search criteria:

Subject: Computer Information Systems (CIS)
Days: Monday

If you do not choose a Day first, you will see a complete listing of CIS courses. You will notice that there are some classes that meet on MONDAY only (M) and some that meet Monday and Wednesday (M,F). But when you choose the day, Monday, in the drop-down menu, you will notice that classes that ONLY meet on MONDAY will appear.

Credit goes to Sun at Gossamer for providing the codes.

Thanks, Sun.

Hope this helps.

Regards,



------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: Exact Search Match Mod In reply to
The codes are used for DBMAN...And Domenic, as I mentioned before, the Exact Word Match codes are located in the Links Modification Forum...not the Relevancy Search option.

Since you have been UNABLE to find the Thread, I will link the Thread to one of the redundant Threads you have posted in the Links Discussion Forum...when I get around to it.

Wink

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
* Be sure to visit the Resource Center for FAQ's, Modifications and Extra Goodies!!
* Search Forums!
* Say NO to Duplicate Threads. :)
----------------------









Quote Reply
Re: Exact Search Match Mod In reply to
Hi,

I've been trying to solve this problem with links, but haven't had any luck! Does anyone know what I would need to change in LINKS to do the exact same thing?

Thank You
Quote Reply
Re: Exact Search Match Mod In reply to
Is this actually "AND"-ing several fields?

like:
Make|Model
Dodge|Intreprid

make=Dodge&Model=Intreprid?

If so, thank God someone has finally come up with this~! thanks people.
Quote Reply
Re: Exact Search Match Mod In reply to
No...it is not...It only searches for exact words within individual fields...Think of it as a high powered phrase search or whole words search with some spice.

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
* Be sure to visit the Resource Center for FAQ's, Modifications and Extra Goodies!!
* Search Forums!
* Say NO to Duplicate Threads. :)
----------------------









Quote Reply
Re: Exact Search Match Mod In reply to
Hi,

Thanks for your prompt response~!

Sorry for being a bit dumb, so what exactly it cannot do, and what exactly is it doing?
Quote Reply
Re: Exact Search Match Mod In reply to
Did you even try the example and read my explanation in the FIRST POST???

IT explicitly explains what the Mod does!

I do not have the time nor energy to re-explain the MOD!

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
* Be sure to visit the Resource Center for FAQ's, Modifications and Extra Goodies!!
* Search Forums!
* Say NO to Duplicate Threads. :)
----------------------









Quote Reply
Re: Exact Search Match Mod In reply to
And to make this more clear....

It may look like an AND search, however, it is not the Boolean AND search that you might be thinking of.

You cannot type in words in the keywords fields like the following:

cars and parts

and get cars parts in results.

It only narrows searches by specific fields....

Do you get it now??? I sure hope so.

Regards,

------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
* Be sure to visit the Resource Center for FAQ's, Modifications and Extra Goodies!!
* Search Forums!
* Say NO to Duplicate Threads. :)
----------------------









Quote Reply
Re: Exact Search Match Mod In reply to
Yeah, it seems like you are having course=CIS AND Days=Monday but when i gave my example you said it's not like that.
Quote Reply
Re: Exact Search Match Mod In reply to
Listen it will search between fields, but the important KEY to this MOD is that in the site I gave you, our original problem was that we used the Fancy Select Mod to designate days...like the following:

Monday = M
Monday, Wednesday = M, W
Monday, Wednesday, Friday = M, W, F

Originally, if we chose Monday, all the records with M in the Day field would show up.

With this EXACT WORD MATCH SEARCH MOD, if you choose Monday ONLY, you will ONLY get results with M or MONDAY in it!

So, you see it is actually WITHIN specific fields that this MOD WORKS! IT does NOT work for keywords! IT IS NOT A BOOLEAN TYPE OF AND/OR CONNECTOR MOD!

Get it? Got it? GOOD!

Regards,



------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
* Be sure to visit the Resource Center for FAQ's, Modifications and Extra Goodies!!
* Search Forums!
* Say NO to Duplicate Threads. Smile
----------------------











[This message has been edited by Eliot (edited February 15, 2000).]

[This message has been edited by Eliot (edited February 15, 2000).]
Quote Reply
Re: [Eliot] Exact Search Match Mod In reply to
SmileI just wanted to say for the sake of anyone looking for the same thing as me that this mod works very well when you want a search to find an exact match, not a longer word including the part you are searching for.

I used it for searching Post Codes (Zip codes) when the user wants to find for example the Postcode BA1 but not bring up the records for BA11, BA12, BA13 etc. It works like a charm!

Thanks for this mod guys, and for all your work recently on www.thegrapevine.co.uk - much appreciated!