Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Improving the indexed search options...

Quote Reply
Improving the indexed search options...
Right,

being a bit of a Perl hacker, I really fancy getting some more options into that indexed search, basically so I can do -

+"men behaving badly" -Gary +Martin Brit*

Which will get all documents containing "men behaving badly" with "Martin", but exclude those which have the word "Gary" in them. Also get any words which have Brit at the start of them (only 3/4 letters more mind you)

Anyway, I'll have to start out small, so I'd like to get +keyword, -keyword and keyword* working firstly.

What I need is a bit of assistance in hacking this into search.pm. Apart from a complete rewrite which is just a little out of my league, it could be a pretty cool hack. I'm thinking the best way to approach this is to return some extra data from sub _tokenize. This information would be all the words which we don't want and those which have a star after them. It would mean parsing the string a little differently to categorise those words with "-" in front and a * at the end of them. In the appropriate subs (currently) _get_by_intersection and _get_by_union we then parse those terms a little further.

For the "-" operator we need to add, - NOT LIKE % $variable % - and if it has a * on the end, it gets - NOT LIKE % $variable % % - obviously the appropriate negation if it is exact matching we're going for.


So anyway, there are some initial ideas, I'll have a hack away to see if I get it, and it would be great if others could take a look and maybe make comment on the above.


cheers,


tom

Subject Author Views Date
Thread Improving the indexed search options... tom_lee 4794 Aug 4, 2001, 1:49 AM
Thread Re: Improving the indexed search options...
Alex 4743 Aug 4, 2001, 10:04 AM
Thread Re: Improving the indexed search options...
tom_lee 4709 Aug 5, 2001, 7:30 AM
Thread Re: Improving the indexed search options...
Paul 4705 Aug 5, 2001, 7:44 AM
Thread Re: Improving the indexed search options...
tom_lee 4708 Aug 5, 2001, 7:45 AM
Post Re: Improving the indexed search options...
Paul 4708 Aug 5, 2001, 7:48 AM
Post Re: Improving the indexed search options...
Paul 4722 Aug 5, 2001, 7:55 AM
Post Re: Improving the indexed search options...
Alex 4696 Aug 5, 2001, 10:50 AM