我正在尝试从文本中选择最多255个字符,并仅返回包含用户正在查找的匹配单词的子字符串或第一个字符串。
这是我网站中搜索引擎的脚本,其中结果仅预览包含用户正在搜索的单词集的帖子。
Here is an example for a preview:
A user type in search box "manufacturing companies"
...visited the campus to announce the creation of a new public-private **Manufacturing** Innovation Institute that will soon take up residence at NC State. Eighteen **companies** headquartered in North Carolina will partner...
In case there are more coincidences, select only the substring that contains more words matched.
How can I accomplish this within a query?
感谢。