Gossamer Forum
Home : Products : DBMan : Customization :

display search term plus x words before and after

Quote Reply
display search term plus x words before and after
I've searched the forum plus the unofficial FAQ, but found no clues as to how to address the following task:
Presume the user searches for the keyword "daisy" in the field "book". I would like to display search results with the keyword plus, for each result, two words before and after. If a record has "the daisy in the field has gone" as a value for "book", results should print as "the daisy in the"; if it has "some people are known to call me 'daisy'", then results should print as "call me 'daisy'".

I guess performing this task would require two routines:
1) Code a condition "if the search term is searched for in field XXX"
2) Code the consequence "... pick search term plus two words before & after from each record and print".

Any suggestions?

kellner