I agree with John's assessment that a search engine is the way to go. 

But if you really want to do it in Witango, here's one possibility:

1) tokenize the input string on space, comma, sq, dq, period, and any
other punctuation characters. This gives you a [1,x] array of the words.
Transpose it into a [x,1] array

2) filter the array to eliminate values < 3 characters long.

3) loop through the array to build a sql statement to do your search. 

Something like:
select id, count(id), max(txt) 
from table
where txt like '%Jim%' or 
txt like '%Bonnie%' or
txt like '%Resort%'
group by id
order by count(id) desc

this will give you an array of the rows that contain the any of the
words, sorted by the number of times the words appear


To give users the ability to quote strings and get an exact match, check
to see if the first and last characters are sq or dq. If so, strip them
off and skip the tokenize step.

I haven't actually tried this methodology, but it should work. It may be
slow though depending on your database server, amount of data and
indexing.

Another methodology I've worked with many years ago at CBC news was to
take all the distinct words from every article and insert them into a
table. Then build a many<->many relationship with the articles to show
which words appeared in what article. That made for a couple of huge
tables, but it was well indexed and running on a mainframe so it
resulted in some fast searches.

Dave

-----Original Message-----
From: John McGowan [mailto:[EMAIL PROTECTED] 
Sent: April 27, 2004 9:53 AM
To: [EMAIL PROTECTED]
Subject: Re: Witango-Talk: Search Engine Format Type

if the content you want to search can be "spidered" just install a 
search engine.  I and others on the list have had great success 
integrating the swish-e search engine into our Witango apps.

/John

[EMAIL PROTECTED] wrote:

> I have a hobby site that I work on in my spare time. It has a forum, 
> chat room, ya da ya da ya da. In it I have created 3 different search 
> like engines that list resorts, fishing guides and bait and tackle 
> shops. (you can check it out if you like, just a few months old, but 
> growing  http://MyFishingPals.com   )
>
> Anyway, I was wondering if anyone has used Witango to create a search 
> engine somewhat like google. I have been trying to figure a way to do 
> this. The big thing is how to search for certain terms. In other 
> words, a "contains" search does exactly as expected, but how does one 
> do partial phrase searches and the like. I am not worried about 
> stemming (related keywords), just trying to figure out how to do this.
>
> example if searching for "jim" returns "Jim and Bonny's Resort" good 
> so far... But
> searching for jim's returns nothing.
>
> And is there a way to use quotes for exact phrase? More like a search 
> engine?
>
> Anyway, just wondering if anyone has done this or pondered this at 
> all. Any suggestions would be great.
>
> Thanks
>

________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf

________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf

Reply via email to