可以实现这样的全文搜索吗?

jackietsen 2005-09-03 11:23:53
在整个数据库进行全文搜索
搜索的多个关键字用空格隔开
然后把结果按照关键字的出现频率排序
并把关键字的出现频率显示出来。
...全文
175 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
maplescloud 2005-10-14
  • 打赏
  • 举报
回复
从这点上看,DOMINO内置的这种搜索功能(相比关系数据库)多少让人感到一丝满意。
maplescloud 2005-10-14
  • 打赏
  • 举报
回复
db.FTSearch
Defined in
Database
Syntax
public DocumentCollection FTSearch(String query)
throws NotesException
public DocumentCollection FTSearch(String query, int max)
throws NotesException
public DocumentCollection FTSearch(String query, int max, int sortopt, int otheropt)
throws NotesException
Parameters
String query
The full-text query. See the section "Query Syntax" that follows.
int max
The maximum number of documents you want returned from the query. Set this parameter to 0 to receive all matching documents (up to 5,000. See Usage section below).
sortopt
Integer. Use one of the following constants to specify a sorting option:
Database.FT_SCORES (default) sorts by relevance score. When the collection is sorted by relevance, the highest relevance appears first. To access the relevance score of each document in the collection, use the FTSearchScore property in Document.
Database.FT_DATECREATED_DES sorts by document creation date in descending order.
Database.FT_DATECREATED_ASC sorts by document creation date in ascending order.
Database.FT_DATE_DES sorts by document date in descending order.
Database.FT_DATE_ASC sorts by document date in ascending order

可见搜索结果本身可以依据关键字的出现频率排序,访问每条搜索出来的文档的FTSearchScore属性
可以获得得分。
另外,多关键字用 &(与) |(或)分隔开。

2. This code fragment collects all documents containing both the words "red" and "blue."
DocumentCollection dc = db.FTSearch("red & blue", 100);
3. This code fragment collects all documents containing either the word "red" or "blue" in descending order by creation date.
DocumentCollection dc = db.FTSearch("red | blue", 100, Database.FT_DATE_DES, 0);
4. This code fragment collects all documents that do not contain the word "red" or "blue" in descending order by creation date.
DocumentCollection dc = db.FTSearch("not (red | blue)", 100,Database.FT_DATE_DES, 0);
tina09 2005-10-13
  • 打赏
  • 举报
回复
同问,能否具体的说一下。 是说用db.search ,然后把关键字记录下来,根据搜索条件的变化来搜索吗?
anonliu 2005-10-12
  • 打赏
  • 举报
回复
你要多次搜索。计算每次关键字的值!

535

社区成员

发帖
与我相关
我的任务
社区描述
企业开发 Exchange Server
社区管理员
  • 消息协作社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧