22,297
社区成员
发帖
与我相关
我的任务
分享
[/quote]
试试2#说的, Lucene好像要在程序里写。[/quote]
.net有吗
看都看不懂
[/quote]楼主说一下表的索引情况create table a_b_match(
mId int identity(1,1) primary key,
aId int not null,
bId int not null,
title nvarchar(200) not null,
[content] nvarchar(max) not null,
[keyword] nvarchar(200) not null
)
insert into a_b(aId,bId,title,[content],[keyword])
select a.id,b.id,a.title,a.[content].b.[keyword]
from a inner join b on CHARINDEX(b.keyword, a.title) > 0
OR CHARINDEX(b.keyword, a.content) > 0
在 a 上创建触发器, 增、删、改时修改 a_b_match 的记录即可。
你想查啥, 直接查 a_b_match 表就可以了, 不用再查别的表。保证你快!
[/quote]
试试2#说的, Lucene好像要在程序里写。
SELECT *
FROM a
JOIN b ON CHARINDEX(b.keyword, a.title) > 0
OR CHARINDEX(b.keyword, a.content) > 0