Gossamer Forum
Home : Products : DBMan : Installation :

Searching

(Page 1 of 2)
> >
Quote Reply
Searching
   I am trying to make a HTML anchor search for all the records with a few keywords found in a particular field.

For example, there is a database field called Fieldname which people would insert the name of the field they play on. I have a HTML page that has a link that says "View tournaments by field..click on the field name" So when they click on the name of the field it will pull up all the tournaments that field has posted.

Up until now I've used one keyword which is fine. However, I am running into some problems because some of the fields have a couple words that are the same. That doesn't seem like it's a problem, but I can't figure out how to search for a couple keywords. For some reason it will only pull up records if you search for one keyword, but if you try to do more than one, it will only pull it up if you have the exact words in the field.

Richard
Quote Reply
Re: Searching In reply to
   I forgot something.. if you need a visual example the site is http://www.oklahoma-paintball.com/tourny .. thank you.

Richard
Quote Reply
Re: Searching In reply to
Could you give me an example of one that didn't work?


------------------
JPD





Quote Reply
Re: Searching In reply to
Carol,

Ok.. for example, let's say that there was a field called Adventure Zone. I can have it search for "adventure zone" with no problem. But if the field owner happends to put "adventure zone paintball" in the fieldname field for the database, then the search will come up with 0 results. So temporarily I have it searching for "zone" because there is another field called "paintball adventures"..

Richard
Quote Reply
Re: Searching In reply to
I went back to your database and tried to find something that would give me no search results. I didn't come up with anything. Of course, you only have three records right now, so that could be part of it.

I'm still not sure what your question is. You say
Quote:
But if the field owner happends to put
"adventure zone paintball" in the fieldname field for the database, then the search will
come up with 0 results.

Do you mean that, if "Adventure Zone Paintball" is in the database and you search for it, you get nothing? Or do you mean that, if "Adventure Zone" is in the database and you search for "Adventure Zone Paintball" you get nothing?

If it's the latter, you seem to be wanting to search for individual words in an "or" search, instead of being able to search for phrases. Is that what you want?


------------------
JPD





Quote Reply
Re: Searching In reply to
If the entry is "Adventure Zone Paintball" and it searches for "Adventure Zone" (not Adventure Zone Paintball) it will come up with 0 results. In other words, if you search for more than one word it will come up with 0 results if the keywords you're using are not all contained in that field.

Richard
Quote Reply
Re: Searching In reply to
I just did a search on your site.

First I did a "List All" to find out what was there. I picked Wild West Paintball & Supply Inc. as an example.

I searched for
Wild West Paintball & Supply
Wild West Paintball
Wild West
Paintball & Supply
Supply Inc.

Every time, I got Wild West Paintball & Supply Inc. in my search results.

This is all using the search form. You may be having problems, though, if you are trying to create a link to do the search and use more than one word. You need to put +s where the spaces are.

So, if you wanted to make a link to search for Wild West Paintball, you would set it up like

Wild+West+Paintball

There is a little bit of a problem in using characters such as & in links. If you can avoid that, it would be a good idea.


------------------
JPD





Quote Reply
Re: Searching In reply to
Carol,

I'll just tell them to use the same name.. I didn't want to make it harder on the owners, but oh well Smile

Richard
Quote Reply
Re: Searching In reply to
If you could give me an example of something that didn't work for you that I could duplicate, I might be able to help. But I just don't understand what the problem is.


------------------
JPD





Quote Reply
Re: Searching In reply to
Carol,

Okay..here's another example Smile I am not using the date variable built in for my date. I have them use a formula (Month day, year .. ex: September 1, 1999). I have HTML links that want to search for the entries that have dates in the month. However, it's coming close to the year 2000. I don't someone wanting to click on September 1999 to pull up something in September 2000. If I do an URL like

http://www.website.com/cgidir/db/db.cgi?uid=default&view_records=1&date=september+1999

it won't pull up anything even if there is a date september 1, 1999. However, if you take the 1999 out of there, it will find records.

Richard
Quote Reply
Re: Searching In reply to
You want to be able to use "and" so "september 1999" will bring up "september 7 1999"? see:

http://www.gossamer-threads.com/scripts/forum/resources/Forum12/HTML/000539.html

and

http://www.gossamer-threads.com/scripts/forum/resources/Forum12/HTML/000942.html

I hate to keep on about this "and" business but it works and its very important for a good keyword searchable database! Try using the words "zam" "rho" and "law" (one to a box) on my site:

http://www.library.unsw.edu.au/~law/repsrch.html

------------------
JGU



[This message has been edited by jury (edited September 24, 1999).]
Quote Reply
Re: Searching In reply to
Now I see what the problem is.

You have two options that I can think of. One would be to use the DBMan date searching capabilities and do a search for
Date-gt = August 31, 1999
Date-lt = October 1, 1999

The other option would be to have your date elements in separate fields -- Month Day Year -- and then do a search for

Month = September
Year = 1999



------------------
JPD





Quote Reply
Re: Searching In reply to
Jury,

I don't want to use a form.. I have HTML anchor links for people to click on to do the searching..

Richard
Quote Reply
Re: Searching In reply to
Just one point then I'll butt out. You don't need to use a form if it is a fixed search like your september example - do a url like:

http://www.library.unsw.edu.au/~law/cgi-bin/tdb.cgi?view_records=1&db=tester&uid=default&ww=ww&Title=zam&Hide_TitleA=rho&Hide_TitleB=law&Sub mit=Search

------------------
JGU

Quote Reply
Re: Searching In reply to
Sounds good, jury. I just don't understand how your mod works, so I hesitate to suggest it to other people.


------------------
JPD





Quote Reply
Re: Searching In reply to
Is it a mod? As you know one can't do an "and" search and pick up two or more words in the same field unless they are a phrase, but if there were lets say three fields with the same text in each then one could use the advanced search and search for a different word in each field and get the required result. All I did was to hide the two duplicate fields and change the script so the information put into the viewable field is automatically written to the two hidden duplicate fields when adding or editing a record. Then I changed the bold face code so it kept going over the viewable field and "bolded" the keyword for each of the search terms. I just never thought that this little trick was anything like the more complex mods you and others make to the code. Of course one could have all the terms entered into one submit box and make a mod to parse it into a keyword array in the code and do the same to the search function as I did to the bold function (having it recursively search the same field for all keywords) but where does one stop and when is Alex going to come up with a wonderful and/or version...about the same time I've finished all this hacking?

------------------
JGU

Quote Reply
Re: Searching In reply to
Jury,

Hehe.. I have no idea what you guys are saying.

Richard
Quote Reply
Re: Searching In reply to
Richard, I'm not sure what he's saying either. I'll have to look more closely at what he did. Maybe I'll get it.

Did you understand about the "Date-gt" and "Date-lt" search?

Jury, don't ask me when Alex is going to do make this available. I don't know. Smile


------------------
JPD





Quote Reply
Re: Searching In reply to
JPDeni,

From my understanding it's a greater to least search..

Richard
Quote Reply
Re: Searching In reply to
 
Quote:
From my understanding it's a greater to least search.

I don't understand.

Let me go back a few posts and see if we can figure this out.

You want to be able to search for Month and Year and the records have full date in the Date field. Right?

You have two choices. You can set up your Date field as type 'date' and do a search for records where the date is, for example, greater than 31-Aug-1999 and less than 1-Oct-1999.

Or you can divide your date into three fields -- day, month and year and do a search for the month and year.

Either one is equally easy/complicated and I'm happy to help you implement whichever one you want.


------------------
JPD





Quote Reply
Re: Searching In reply to
JPDeni,

I think what I'm going to have to do is just have the month and year two different fields. At first I thought you could have it all one field and search for the month and year, but I guess not. This'll be fun cause I'll have to change all the records and everything Smile

Richard
Quote Reply
Re: Searching In reply to
You can do it without changing your database. You just need to set up a range search for your dates.


------------------
JPD





Quote Reply
Re: Searching In reply to
JPDeni,

By using the date command? I prefer not using that because it doesn't look good visually. I was thinking about using the two different fields for the date.

Richard
Quote Reply
Re: Searching In reply to
If you prefer to use the separate fields, that's fine. You can change the way dates are displayed to match any format you want, though.



------------------
JPD







[This message has been edited by JPDeni (edited September 29, 1999).]
Quote Reply
Re: Searching In reply to
JPDeni,

How would you change the way the dates are displayed?

Richard
> >