|
Posted by Andrew Poulos on 09/29/05 14:33
I have a db with table that contains a field that I've called
'mykeywords' which contains one of more comma separated words. The table
has 1,000s of rows.
The user can set up to five keywords to search through 'mykeywords' for
any matches. If the no match is found then a new search is started using
one less keyword. If that fails a different combination of keywords is
tried before dropping another keyword. For example, say if the table had
only one row and the 'mykeywords' field contained:
"house,apple,banana,chair,table,arena,ball,shelf,book"
and a search was started with:
"house,floor,mat"
the search should try (in loose order):
house,floor,mat
house,floor
floor,mat
house,mat
house
floor
mat
My problem is that I'm having trouble finding a way to do a "greedy"
search (greedy in the sense that I want the largest number of user
keywords matched) without having to iterate a factorial number of times.
Andrew Poulos
Navigation:
[Reply to this message]
|