我想知道是否有可能(比如通过嵌套的sql查询)对使用IN BOOLEAN MODE的FULLTEXT INDEX搜索运行结果执行WITH QUERY EXPANSION。
这不起作用,但也许它有助于解释我在寻找什么:
SELECT * FROM (SELECT * FROM indexed_table AS x WHERE MATCH(x.ind_col)
AGAINST('(+word1 +word2 +word3) (+word1 +word4) (+word2 +word4)' IN BOOLEAN MODE))x
WHERE MATCH(ind_col) AGAINST('word1 word2' WITH QUERY EXPANSION);
澄清:我正在尝试对第一个MATCH..AGAINST(“IN BOOLEAN MODE”)的结果使用第二个MATCH..AGAINST(“WITH QUERY EXPANSION”)。
答案 0 :(得分:1)
当然,您可以在单个WHERE子句中使用多个MATCH语句,如果满足您的要求,只需将它们组合在一起。
这对你有用吗?
SELECT *
FROM indexed_table
WHERE MATCH(ind_col) AGAINST('(+word1 +word2 +word3) (+word1 +word4) (+word2 +word4)' IN BOOLEAN MODE)
AND MATCH(ind_col) AGAINST('word1 word2' WITH QUERY EXPANSION);
答案 1 :(得分:0)
您应该能够通过以下方式做到这一点:
SELECT * FROM (
SELECT * FROM `indexed_table` WHERE MATCH(ind_col) against ('(+word1 +word2 +word3) (+word1 +word4) (+word2 +word4)' IN BOOLEAN MODE)
) AS x WHERE MATCH(ind_col) against ('word1 word2' WITH QUERY EXPANSION)