如何使用 SQLite FTS3 匹配表中的多列? [英] How do you match multiple column in a table with SQLite FTS3?

查看:29
本文介绍了如何使用 SQLite FTS3 匹配表中的多列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有一个包含 A、B、C、D 列的表格,我想在 A 列和 C 列上进行匹配

Lets say I have a table with columns A , B , C , D and I want to do a match on column A and C

我看到您可以匹配sqlite中的单个列或所有列

I see that you can either match a single column or all column in sqlite ie

- match column A
select * from table where A match 'cat' 

- match all columns
select * from table where table match 'cat'

是否可以只匹配 A 列和 C 列?如果没有,你们如何解决这个问题?

Is it possible to match only columns A and C? If not, how do you guys get around this?

感谢您的建议!

推荐答案

我认为您不能在单个 FTS 查询中使用多个 MATCH 运算符.使用 column_name:target_term 使用一次全文搜索来搜索多列.

I don't think you can use multiple MATCH operators in a single FTS query. Use column_name:target_term to search multiple columns using one full text search.

SELECT * FROM table WHERE table MATCH 'A:cat OR C:cat'

http://www.sqlite.org/fts3.html#termprefix

这篇关于如何使用 SQLite FTS3 匹配表中的多列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆