Gossamer Forum
Home : Products : DBMan : Customization :

Keyword search on ONLY one field.

Quote Reply
Keyword search on ONLY one field.
Hi if this has been discussed before I apologize. I spent the last couple hours looking and found items close, but nothing that addresses my problem directly.

I want to give my users the ability to use the keyword search, but only on one field. Most of my fields are all numbers except for a field called Notes. This is the field I want all keyword searches to be done on. To make it a little more interesting that field is hidden in the search form.

So in short is it possible to direct a keyword search across only one field instead of all fields? If so what mod would I have to make?

I have uploaded my db.cgi and default.cfg files here:

http://www.newsservers.net/news_servers/db/db.txt
http://www.newsservers.net/news_servers/db/default.txt

Thanks in advance for any help with this.

Aaron

Quote Reply
Re: Keyword search on ONLY one field. In reply to
If you only want to search on one field, then in your search form, you need to make an input box similar to:
<input type="text" name="FIELD_NAME">

You'll also need to take out that hidden field.

- Mark


Astro-Boy!!
http://www.zip.com.au/~astroboy/
Quote Reply
Re: Keyword search on ONLY one field. In reply to
Thanks Mark for pointing me in the right direction. I've managed to get everything working the way I want it to. All except for one thing (you knew that was coming didn't you? :) The last thing I need to be able to do is to embed an email form in the search results.

Basically I want it to work like this:

Person searches for news servers. Then if one of those servers doesn't work I want them to be able to send me a quickie email citing one of the predefined reasons in the form as to why it didn't work. They get redirected to a page thanking them for reporting the down server and then redirected once more back to where they originally started. All of that would be easy if I could make the form work in the html.pl file.

I thought it would be a snap, but the html.pl file didn't like the form at all. I uploaded a copy of my html.pl file here:

http://www.newsservers.net/news_servers/db/html.txt

I also enabled debugging and it literally give me nothing. It tells me to enable debugging which I have checked re-checked and checked again to make sure it is on in the .cfg file.

There is nothing in the resources, mods or faq area that I could find about this. Any ideas would be greatly appreciated.

Aaron

Quote Reply
Re: Keyword search on ONLY one field. In reply to
Hi Aaron, not sure if this is the cause of your problem - do know formmail will balk if the recipient is not a valid email address.

Note the email address in your recipient field:

badserver@newsservers.net.net

Try correcting that and see if that resolves the problem.


Quote Reply
Re: Keyword search on ONLY one field. In reply to
Hi Karen thanks for replying. I tried what you asked, but dbman still says there is an error and I have debugging on and it doesn't give any info.

It seems to me that dbman doesn't like the form being in there at all. If I take out the form then everything works fine, but once I add form elements to html.pl it goes belly up on me.

Is there maybe another way around this? Maybe a seperate subroutine for the form? I don't know. This started as a feature that I could live without now I want more than anything to make it work :)

Aaron

Quote Reply
Re: Keyword search on ONLY one field. In reply to
Hi Aaron, due to all the extra coding going on in there, I'm going to guess that you may be using FrontPage or something like that to create the code you're using here in the file.

It doesn't seem like there is any purpose in having the formmail call above the record display and the location of the call may be causing problems. You might try moving
<form action="http://www.newsservers.net/cgi-bin/formmail.cgi" method="post">
to just above the form fields.

Also, I don't believe you can add the record ID in the submit call (don't believe it serves any purpose there either).
<input type="submit" name="Submit$rec{'ID'}" value="Report It">


Quote Reply
Re: Keyword search on ONLY one field. In reply to
I put the formmail call above the record display because with it inside the table it caused a lot of white space at the bottom of the table which looked bad I thought. I originally had it all together with the form elements, but was experimenting with moving it around to make it more pleasing to the eye.

On the record id in the submit call... you're right I have no idea what I was thinking... it was late I guess :)

Thanks for your responses.

Aaron