带标量过滤条件的向量检索
更新时间:2024-07-11
什么是Filter过滤条件
在向量检索中,VectorDB支持指定一个表达式形式的Filter参数,用来确保后端数据库在执行检索时,仅检索满足Filter表达式条件的数据记录。通过支持带Filter过滤条件,VectorDB能够实现精细的标量/向量混合检索,支持各类业务的多样性检索需求。
在VectorDB的HTTP API中,Filter条件表示为如下类似形式:"filter": "FieldA == 'Aa'"
;在Python SDK中,Filter条件作为一个检索参数存在,参数取值表示为如下类似形式:filter = "FieldA == 'Aa'"
。
Filter过滤条件的语法
本小节详细介绍VectorDB Filter表达式语法的详情。
Filter条件表达式的语法遵循SQL的WHERE子句表达式语法,是其语法的子集,非常直观易懂。
Filter表达式语法格式为<$field_name><$operator><$value>
,也支持表达式的组合,多个子表达式之间支持通过AND
(与)、OR
(或)以及NOT
(非)进行组合来构建更加复杂的表达式。。
表达各个部分的语法说明如下:
<$field_name>
:表示目标字段名称。<$operator>
:表示表达式运算符,支持相等(=
、==
)、不等于(!=
、<>
)、大于(>
)、大于等于(>=
)、小于(<
),小于等于(<=
)和IN
操作符。-
<$value>
:表示目标字段的取值。根据字段类型的不同,值的表示方法也有所不同:- 整型值:常规表示,例如
100
、-123
- 字符串类型:头尾使用英文单引号括起来,例如
'HelloWord'
- 日期/时间:同字符串类型,例如
'2024-03-20T16:30:00Z'
- 布尔值:也表示为字符串,但是仅支持
'True'
、'true'
、'False'
、'false'
四种形式,其中'True'
等价于'true'
,'False'
等价于'false'
- 二进制类型:同字符串类型,但是必须采用base64编码
- 整型值:常规表示,例如
IN
操作符语法说明如下:
- 语法:
<$field_name> IN ($value1, $value2, ...)
,表示该字段取值只要是后面数组中的任意一个值即可。
组合操作符的语法说明如下:
AND
:与操作,例如<$expr1> AND <$expr2>
,表示同时满足expr1和expr2的条件。OR
:或操作,例如<$expr1> OR <$expr2>
,表示expr1和expr2这两个条件只需满足其一即可。NOT
:非操作,例如NOT <$expr1>
,表示将expr1的结果进行取反,要求满足取反之后的条件。
通过合理使用括号,可以支持带运算符优先级的复杂表达式,例如:
FieldA == 'Aa' AND FieldB >= 100
(FieldA == 'Aa' OR FieldC == 'Cc') AND FieldB != 0
((FieldA == 'Aa' OR FieldC != 'Cc') AND FieldX == 'true')) OR FieldY >= '2024-01-01T00:00:00Z'
fieldA IN ('男', '女') AND fieldB > 35
Filter表达式的使用限制
Filter条件表达式在使用中仍然存在一些限制,说明如下:
IN
操作符右侧的值数组不可以为空:若值数组为空,则意味着目标字段不能取任何值,说明这是一个无意义的条件,VectorDB会直接报错。IN
操作符当前仅适用于>=1.2版本的内核:若发现您的实例不支持IN
操作符,说明当前实例版本过低,请联系我们,我们来对该实例进行升级。
带Filter过滤条件的向量检索示例
我们通过Python SDK来展示一系列带Filter过滤条件表达式的向量检索的使用方法。
- 创建一个莫愁客户端对象。
import time
import json
import random
import pymochow
import logging
from pymochow.configuration import Configuration
from pymochow.auth.bce_credentials import BceCredentials
from pymochow.exception import ClientError, ServerError
from pymochow.model.schema import Schema, Field, SecondaryIndex, VectorIndex, HNSWParams
from pymochow.model.enum import FieldType, IndexType, MetricType, ServerErrCode
from pymochow.model.enum import TableState, IndexState
from pymochow.model.table import Partition, Row, AnnSearch, HNSWSearchParams
logging.basicConfig(filename='documentinsight.log', level=logging.DEBUG,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
logger = logging.getLogger(__name__)
if __name__ == "__main__":
account = '$您的账户名称'
api_key = '$您的账户API密钥'
endpoint = '$您的实例访问端点' # 例如:'http://127.0.0.1:5287'
db_name = 'DocumentInsight'
table_name = 'FilterSearchTable'
# 根据配置创建一个MochowClient对象
config = Configuration(credentials=BceCredentials(account, api_key), endpoint=endpoint)
mochow_client = pymochow.MochowClient(config)
- 建库建表,建立一个有着各种不同类型字段的表。
# 建库
db = mochow_client.create_database(db_name);
# 若库已存在,则直接使用下述代码获取一个库对象
# db = mochow_client.database(db_name)
# 建表,该表有2个分区
fields = []
fields.append(Field("DocId", FieldType.UINT64, primary_key=True, partition_key=True, not_null=True))
fields.append(Field("Title", FieldType.STRING, not_null=True))
fields.append(Field("Author", FieldType.STRING, not_null=True))
fields.append(Field("Extension", FieldType.STRING, not_null=True))
fields.append(Field("SizeInBytes", FieldType.UINT64, not_null=True))
fields.append(Field("LastEditTime", FieldType.DATETIME, not_null=True))
fields.append(Field("Published", FieldType.BOOL, not_null=True))
fields.append(Field("Vector", FieldType.FLOAT_VECTOR, dimension=2, not_null=True))
indexes = []
indexes.append(VectorIndex(index_name="Vector_Idx", index_type=IndexType.HNSW,
field="Vector", metric_type=MetricType.L2,
params=HNSWParams(m=32, efconstruction=200)))
table = db.create_table(
table_name=table_name,
replication=1,
partition=Partition(partition_num=2), # 2个分区
schema=Schema(fields=fields, indexes=indexes)
)
while True:
time.sleep(1)
table = db.describe_table(table_name)
if table.state == TableState.NORMAL:
break
- 插入数条记录,仔细设计这些记录的各个字段的取值,便于我们后续展示各种带Filter条件表达式的查询。
# 插入数条数据,为了方便展示带过滤检索的用法,我们让这些数据具备非常接近的向量
rows = [
Row(DocId=1, Title="LLM技术详解", Author='Alice', Extension='pdf', SizeInBytes=100000,
LastEditTime="2024-01-28T12:55:28Z", Published=True, Vector=[0.111111, 0.222222]),
Row(DocId=2, Title="深入浅出大语言模型技术", Author='Bob', Extension='pdf', SizeInBytes=110000,
LastEditTime="2024-02-29T18:00:00Z", Published=True, Vector=[0.1111112, 0.222222]),
Row(DocId=3, Title="基于大模型的RAG应用开发实践", Author='Bob', Extension='docx', SizeInBytes=120000,
LastEditTime="2023-11-09T11:00:00Z", Published=True, Vector=[0.111113, 0.222222]),
Row(DocId=4, Title="揭秘AI原生应用开发——原理与实战", Author='Curry', Extension='docx', SizeInBytes=120000,
LastEditTime="2023-12-12T09:40:30Z", Published=False, Vector=[0.111114, 0.222222]),
Row(DocId=5, Title="向量数据库在RAG开发中的应用与实践", Author='Curry', Extension='pptx', SizeInBytes=90000,
LastEditTime="2024-02-29T18:00:00Z", Published=False, Vector=[0.111115, 0.222222])
]
table.insert(rows=rows)
- 构建向量索引。
# 构建向量索引
index_name = "Vector_Idx"
table.rebuild_index(index_name)
while True:
time.sleep(1)
index = table.describe_index(index_name)
if index.state == IndexState.NORMAL:
break
- 执行各类带Filter过滤条件表达式的向量检索,在所有检索示例中,我们都检索非常接近上述数据向量值的同一个向量值。
- Filter为单一表达式
vectorFloats = [0.1, 0.2]
# 仅在“Author为Bob”的数据记录中进行检索
anns = AnnSearch(vector_field="Vector", vector_floats=vectorFloats,
filter="Author == 'Bob'",
params=HNSWSearchParams(ef=200, limit=10))
result = table.search(anns=anns, retrieve_vector=True)
print("Search result with filter \"Author == 'Bob'\": {}\n".format(result))
# 仅在“Published为True”的数据记录中进行检索
anns = AnnSearch(vector_field="Vector", vector_floats=vectorFloats,
filter="Published = 'true'",
params=HNSWSearchParams(ef=200, limit=10))
result = table.search(anns=anns, retrieve_vector=True)
print("Search result with filter \"Published = 'true'\": {}\n".format(result))
# 仅在“DocID大于等于3”的数据记录中进行检索
anns = AnnSearch(vector_field="Vector", vector_floats=vectorFloats,
filter="DocId >= 3",
params=HNSWSearchParams(ef=200, limit=10))
result = table.search(anns=anns, retrieve_vector=True)
print("Search result with filter \"DocId >= 3\": {}\n".format(result))
# 仅在“LastEditTime小于UTC时间2024年1月1日0点0分0秒(即为2024年之前)”的数据记录中进行检索
anns = AnnSearch(vector_field="Vector", vector_floats=vectorFloats,
filter="LastEditTime < '2024-01-01T00:00:00Z'",
params=HNSWSearchParams(ef=200, limit=10))
result = table.search(anns=anns, retrieve_vector=True)
print("Search result with filter \"LastEditTime < '2024-01-01T00:00:00Z'\": {}\n".format(result))
# 仅在“Extension不是pptx”的数据记录中进行检索
anns = AnnSearch(vector_field="Vector", vector_floats=vectorFloats,
filter="Extension != 'pptx'",
params=HNSWSearchParams(ef=200, limit=10))
result = table.search(anns=anns, retrieve_vector=True)
print("Search result with filter \"Extension != 'pptx'\": {}\n".format(result))
# 仅在“Extension是pptx这个条件为假”的数据记录中进行检索,该条件等价于上一个条件,即“Extension不是pptx”
anns = AnnSearch(vector_field="Vector", vector_floats=vectorFloats,
filter="NOT Extension == 'pptx'",
params=HNSWSearchParams(ef=200, limit=10))
result = table.search(anns=anns, retrieve_vector=True)
print("Search result with filter \"NOT Extension == 'pptx'\": {}\n".format(result))
- Filter为简单组合表达式
vectorFloats = [0.1, 0.2]
# 仅在“Author为Curry 且 LastEditTime大于UTC时间2024年1月1日0点0分0秒(即为2024年)”的数据记录中进行检索
anns = AnnSearch(vector_field="Vector", vector_floats=vectorFloats,
filter="Author == 'Curry' AND LastEditTime > '2024-01-01T00:00:00Z'",
params=HNSWSearchParams(ef=200, limit=10))
result = table.search(anns=anns, retrieve_vector=True)
print("Search result with filter \"Author == 'Curry' AND LastEditTime > '2024-01-01T00:00:00Z'\": {}\n".format(result))
# 仅在“Extension为pdf 或 SizeInBytes等于120000”的数据记录中进行检索
anns = AnnSearch(vector_field="Vector", vector_floats=vectorFloats,
filter="Extension == 'pdf' OR SizeInBytes == 120000",
params=HNSWSearchParams(ef=200, limit=10))
result = table.search(anns=anns, retrieve_vector=True)
print("Search result with filter \"Extension == 'pdf' OR SizeInBytes == 120000\": {}\n".format(result))
# 仅在“Extension为docx 或 Extension为pptx”的数据记录中进行检索
anns = AnnSearch(vector_field="Vector", vector_floats=vectorFloats,
filter="Extension == 'docx' OR Extension = 'pptx'",
params=HNSWSearchParams(ef=200, limit=10))
result = table.search(anns=anns, retrieve_vector=True)
print("Search result with filter \"Extension == 'docx' OR Extension = 'pptx'\": {}\n".format(result))
- Filter为复杂组合表达式
vectorFloats = [0.1, 0.2]
# 仅在“Extension为pdf或docx,并且Author为Curry”的数据记录中进行检索
anns = AnnSearch(vector_field="Vector", vector_floats=vectorFloats,
filter="(Extension == 'pdf' OR Extension = 'docx') AND Author == 'Curry'",
params=HNSWSearchParams(ef=200, limit=10))
result = table.search(anns=anns, retrieve_vector=True)
print("Search result with filter \"(Extension == 'pdf' OR Extension = 'docx') AND Author == 'Curry'\": {}\n".format(result))
# Filter条件过于复杂,此处不在用中文进行描述
anns = AnnSearch(vector_field="Vector", vector_floats=vectorFloats,
filter="((Extension == 'pdf' OR LastEditTime < '2024-01-01T00:00:00Z') AND Author == 'Curry') OR Title == 'LLM技术详解'",
params=HNSWSearchParams(ef=200, limit=10))
result = table.search(anns=anns, retrieve_vector=True)
print("Search result with filter \"((Extension == 'pdf' OR LastEditTime < '2024-01-01T00:00:00Z') AND Author == 'Curry') OR Title == 'LLM技术详解'\": {}\n".format(result))
- 上述所有检索请求的全部输出结果,如下所示:
Search result with filter "Author == 'Bob'": {metadata:{content__length:u'644',content__type:u'application/json',request_id:u'b2b91133-13a4-4ce6-8533-0a73e9f8f782'},rows:[{'row': {'DocId': 2, 'Vector': [0.11111120134592056, 0.2222220003604889], 'Title': '深入浅出大语言模型技术', 'Author': 'Bob', 'Extension': 'pdf', 'SizeInBytes': 110000, 'LastEditTime': '2024-02-29T18:00:00Z', 'Published': True}, 'distance': 0.0006172759458422661, 'score': 1.0}, {'row': {'DocId': 3, 'Vector': [0.11111299693584442, 0.2222220003604889], 'Title': '基于大模型的RAG应用开发实践', 'Author': 'Bob', 'Extension': 'docx', 'SizeInBytes': 120000, 'LastEditTime': '2023-11-09T11:00:00Z', 'Published': True}, 'distance': 0.0006173158180899918, 'score': 1.0}],code:0,msg:u'Success'}
Search result with filter "Published = 'true'": {metadata:{content__length:u'929',content__type:u'application/json',request_id:u'accff13e-c19b-4356-9181-da6fac2bdebb'},rows:[{'row': {'DocId': 1, 'Vector': [0.11111100018024445, 0.2222220003604889], 'Title': 'LLM技术详解', 'Author': 'Alice', 'Extension': 'pdf', 'SizeInBytes': 100000, 'LastEditTime': '2024-01-28T12:55:28Z', 'Published': True}, 'distance': 0.0006172714056447148, 'score': 1.0}, {'row': {'DocId': 2, 'Vector': [0.11111120134592056, 0.2222220003604889], 'Title': '深入浅出大语言模型技术', 'Author': 'Bob', 'Extension': 'pdf', 'SizeInBytes': 110000, 'LastEditTime': '2024-02-29T18:00:00Z', 'Published': True}, 'distance': 0.0006172759458422661, 'score': 1.0}, {'row': {'DocId': 3, 'Vector': [0.11111299693584442, 0.2222220003604889], 'Title': '基于大模型的RAG应用开发实践', 'Author': 'Bob', 'Extension': 'docx', 'SizeInBytes': 120000, 'LastEditTime': '2023-11-09T11:00:00Z', 'Published': True}, 'distance': 0.0006173158180899918, 'score': 1.0}],code:0,msg:u'Success'}
Search result with filter "DocId >= 3": {metadata:{content__length:u'977',content__type:u'application/json',request_id:u'c3a6fb0b-3ea2-4bb3-8897-654541eb91bf'},rows:[{'row': {'DocId': 3, 'Vector': [0.11111299693584442, 0.2222220003604889], 'Title': '基于大模型的RAG应用开发实践', 'Author': 'Bob', 'Extension': 'docx', 'SizeInBytes': 120000, 'LastEditTime': '2023-11-09T11:00:00Z', 'Published': True}, 'distance': 0.0006173158180899918, 'score': 1.0}, {'row': {'DocId': 4, 'Vector': [0.111114002764225, 0.2222220003604889], 'Title': '揭秘AI原生应用开发——原理与实战', 'Author': 'Curry', 'Extension': 'docx', 'SizeInBytes': 120000, 'LastEditTime': '2023-12-12T09:40:30Z', 'Published': False}, 'distance': 0.0006173381698317826, 'score': 1.0}, {'row': {'DocId': 5, 'Vector': [0.111115001142025, 0.2222220003604889], 'Title': '向量数据库在RAG开发中的应用与实践', 'Author': 'Curry', 'Extension': 'pptx', 'SizeInBytes': 90000, 'LastEditTime': '2024-02-29T18:00:00Z', 'Published': False}, 'distance': 0.0006173603469505906, 'score': 1.0}],code:0,msg:u'Success'}
Search result with filter "LastEditTime < '2024-01-01T00:00:00Z'": {metadata:{content__length:u'660',content__type:u'application/json',request_id:u'bc716bae-6b70-4faf-b1ba-d434ff2c85dd'},rows:[{'row': {'DocId': 3, 'Vector': [0.11111299693584442, 0.2222220003604889], 'Title': '基于大模型的RAG应用开发实践', 'Author': 'Bob', 'Extension': 'docx', 'SizeInBytes': 120000, 'LastEditTime': '2023-11-09T11:00:00Z', 'Published': True}, 'distance': 0.0006173158180899918, 'score': 1.0}, {'row': {'DocId': 4, 'Vector': [0.111114002764225, 0.2222220003604889], 'Title': '揭秘AI原生应用开发——原理与实战', 'Author': 'Curry', 'Extension': 'docx', 'SizeInBytes': 120000, 'LastEditTime': '2023-12-12T09:40:30Z', 'Published': False}, 'distance': 0.0006173381698317826, 'score': 1.0}],code:0,msg:u'Success'}
Search result with filter "Extension != 'pptx'": {metadata:{content__length:u'1246',content__type:u'application/json',request_id:u'282f60ff-6f4c-4b5e-b533-f3aadb518c02'},rows:[{'row': {'DocId': 1, 'Vector': [0.11111100018024445, 0.2222220003604889], 'Title': 'LLM技术详解', 'Author': 'Alice', 'Extension': 'pdf', 'SizeInBytes': 100000, 'LastEditTime': '2024-01-28T12:55:28Z', 'Published': True}, 'distance': 0.0006172714056447148, 'score': 1.0}, {'row': {'DocId': 2, 'Vector': [0.11111120134592056, 0.2222220003604889], 'Title': '深入浅出大语言模型技术', 'Author': 'Bob', 'Extension': 'pdf', 'SizeInBytes': 110000, 'LastEditTime': '2024-02-29T18:00:00Z', 'Published': True}, 'distance': 0.0006172759458422661, 'score': 1.0}, {'row': {'DocId': 3, 'Vector': [0.11111299693584442, 0.2222220003604889], 'Title': '基于大模型的RAG应用开发实践', 'Author': 'Bob', 'Extension': 'docx', 'SizeInBytes': 120000, 'LastEditTime': '2023-11-09T11:00:00Z', 'Published': True}, 'distance': 0.0006173158180899918, 'score': 1.0}, {'row': {'DocId': 4, 'Vector': [0.111114002764225, 0.2222220003604889], 'Title': '揭秘AI原生应用开发——原理与实战', 'Author': 'Curry', 'Extension': 'docx', 'SizeInBytes': 120000, 'LastEditTime': '2023-12-12T09:40:30Z', 'Published': False}, 'distance': 0.0006173381698317826, 'score': 1.0}],code:0,msg:u'Success'}
Search result with filter "NOT Extension == 'pptx'": {metadata:{content__length:u'1246',content__type:u'application/json',request_id:u'8ac05714-af05-4d53-9c25-740e3acf73b8'},rows:[{'row': {'DocId': 1, 'Vector': [0.11111100018024445, 0.2222220003604889], 'Title': 'LLM技术详解', 'Author': 'Alice', 'Extension': 'pdf', 'SizeInBytes': 100000, 'LastEditTime': '2024-01-28T12:55:28Z', 'Published': True}, 'distance': 0.0006172714056447148, 'score': 1.0}, {'row': {'DocId': 2, 'Vector': [0.11111120134592056, 0.2222220003604889], 'Title': '深入浅出大语言模型技术', 'Author': 'Bob', 'Extension': 'pdf', 'SizeInBytes': 110000, 'LastEditTime': '2024-02-29T18:00:00Z', 'Published': True}, 'distance': 0.0006172759458422661, 'score': 1.0}, {'row': {'DocId': 3, 'Vector': [0.11111299693584442, 0.2222220003604889], 'Title': '基于大模型的RAG应用开发实践', 'Author': 'Bob', 'Extension': 'docx', 'SizeInBytes': 120000, 'LastEditTime': '2023-11-09T11:00:00Z', 'Published': True}, 'distance': 0.0006173158180899918, 'score': 1.0}, {'row': {'DocId': 4, 'Vector': [0.111114002764225, 0.2222220003604889], 'Title': '揭秘AI原生应用开发——原理与实战', 'Author': 'Curry', 'Extension': 'docx', 'SizeInBytes': 120000, 'LastEditTime': '2023-12-12T09:40:30Z', 'Published': False}, 'distance': 0.0006173381698317826, 'score': 1.0}],code:0,msg:u'Success'}
Search result with filter "Author == 'Curry' AND LastEditTime > '2024-01-01T00:00:00Z'": {metadata:{content__length:u'352',content__type:u'application/json',request_id:u'c05d60b4-12a3-449a-962a-db545794c67f'},rows:[{'row': {'DocId': 5, 'Vector': [0.111115001142025, 0.2222220003604889], 'Title': '向量数据库在RAG开发中的应用与实践', 'Author': 'Curry', 'Extension': 'pptx', 'SizeInBytes': 90000, 'LastEditTime': '2024-02-29T18:00:00Z', 'Published': False}, 'distance': 0.0006173603469505906, 'score': 1.0}],code:0,msg:u'Success'}
Search result with filter "Extension == 'pdf' OR SizeInBytes == 120000": {metadata:{content__length:u'1246',content__type:u'application/json',request_id:u'0a360057-da65-4a05-957d-c486bc2f97f6'},rows:[{'row': {'DocId': 1, 'Vector': [0.11111100018024445, 0.2222220003604889], 'Title': 'LLM技术详解', 'Author': 'Alice', 'Extension': 'pdf', 'SizeInBytes': 100000, 'LastEditTime': '2024-01-28T12:55:28Z', 'Published': True}, 'distance': 0.0006172714056447148, 'score': 1.0}, {'row': {'DocId': 2, 'Vector': [0.11111120134592056, 0.2222220003604889], 'Title': '深入浅出大语言模型技术', 'Author': 'Bob', 'Extension': 'pdf', 'SizeInBytes': 110000, 'LastEditTime': '2024-02-29T18:00:00Z', 'Published': True}, 'distance': 0.0006172759458422661, 'score': 1.0}, {'row': {'DocId': 3, 'Vector': [0.11111299693584442, 0.2222220003604889], 'Title': '基于大模型的RAG应用开发实践', 'Author': 'Bob', 'Extension': 'docx', 'SizeInBytes': 120000, 'LastEditTime': '2023-11-09T11:00:00Z', 'Published': True}, 'distance': 0.0006173158180899918, 'score': 1.0}, {'row': {'DocId': 4, 'Vector': [0.111114002764225, 0.2222220003604889], 'Title': '揭秘AI原生应用开发——原理与实战', 'Author': 'Curry', 'Extension': 'docx', 'SizeInBytes': 120000, 'LastEditTime': '2023-12-12T09:40:30Z', 'Published': False}, 'distance': 0.0006173381698317826, 'score': 1.0}],code:0,msg:u'Success'}
Search result with filter "Extension == 'docx' OR Extension = 'pptx'": {metadata:{content__length:u'977',content__type:u'application/json',request_id:u'e3111372-ffb7-4f74-af59-ce961fc3ff90'},rows:[{'row': {'DocId': 3, 'Vector': [0.11111299693584442, 0.2222220003604889], 'Title': '基于大模型的RAG应用开发实践', 'Author': 'Bob', 'Extension': 'docx', 'SizeInBytes': 120000, 'LastEditTime': '2023-11-09T11:00:00Z', 'Published': True}, 'distance': 0.0006173158180899918, 'score': 1.0}, {'row': {'DocId': 4, 'Vector': [0.111114002764225, 0.2222220003604889], 'Title': '揭秘AI原生应用开发——原理与实战', 'Author': 'Curry', 'Extension': 'docx', 'SizeInBytes': 120000, 'LastEditTime': '2023-12-12T09:40:30Z', 'Published': False}, 'distance': 0.0006173381698317826, 'score': 1.0}, {'row': {'DocId': 5, 'Vector': [0.111115001142025, 0.2222220003604889], 'Title': '向量数据库在RAG开发中的应用与实践', 'Author': 'Curry', 'Extension': 'pptx', 'SizeInBytes': 90000, 'LastEditTime': '2024-02-29T18:00:00Z', 'Published': False}, 'distance': 0.0006173603469505906, 'score': 1.0}],code:0,msg:u'Success'}
Search result with filter "(Extension == 'pdf' OR Extension = 'docx') AND Author == 'Curry'": {metadata:{content__length:u'352',content__type:u'application/json',request_id:u'2604c2af-83a6-43f1-9c4a-9e843d69a544'},rows:[{'row': {'DocId': 4, 'Vector': [0.111114002764225, 0.2222220003604889], 'Title': '揭秘AI原生应用开发——原理与实战', 'Author': 'Curry', 'Extension': 'docx', 'SizeInBytes': 120000, 'LastEditTime': '2023-12-12T09:40:30Z', 'Published': False}, 'distance': 0.0006173381698317826, 'score': 1.0}],code:0,msg:u'Success'}
Search result with filter "((Extension == 'pdf' OR LastEditTime < '2024-01-01T00:00:00Z') AND Author == 'Curry') OR Title == 'LLM技术详解'": {metadata:{content__length:u'637',content__type:u'application/json',request_id:u'5f0ae352-5c44-4193-a74d-ef2494a76038'},rows:[{'row': {'DocId': 1, 'Vector': [0.11111100018024445, 0.2222220003604889], 'Title': 'LLM技术详解', 'Author': 'Alice', 'Extension': 'pdf', 'SizeInBytes': 100000, 'LastEditTime': '2024-01-28T12:55:28Z', 'Published': True}, 'distance': 0.0006172714056447148, 'score': 1.0}, {'row': {'DocId': 4, 'Vector': [0.111114002764225, 0.2222220003604889], 'Title': '揭秘AI原生应用开发——原理与实战', 'Author': 'Curry', 'Extension': 'docx', 'SizeInBytes': 120000, 'LastEditTime': '2023-12-12T09:40:30Z', 'Published': False}, 'distance': 0.0006173381698317826, 'score': 1.0}],code:0,msg:u'Success'}