我在使用 ArangoSearch 时遇到问题。
这是我在一个名为的集合中的一些虚拟数据things
(为简单起见,我删除了它们的每个“_id”、“_key”和“_rev”属性):
{"text":"eat a cookie"}
{"text":"I like cookies"}
{"text":"Timmy how are u"}
{"text":"I read a book on elves"}
我有一个看起来像这样的视图(我称之为practice
):
{
"writebufferIdle": 64,
"type": "arangosearch",
"primarySortCompression": "lz4",
"links": {
"things": {
"analyzers": [
"text_en",
"identity"
],
"fields": {
"text": {
"analyzers": [
"text_en"
]
}
},
"includeAllFields": true,
"storeValues": "none",
"trackListPositions": false
}
},
"primarySort": [],
"writebufferSizeMax": 33554432,
"consolidationPolicy": {
"type": "tier",
"segmentsBytesFloor": 2097152,
"segmentsBytesMax": 5368709120,
"segmentsMax": 10,
"segmentsMin": 1,
"minScore": 0
},
"cleanupIntervalStep": 2,
"commitIntervalMsec": 1000,
"storedValues": [],
"id": "138993",
"globallyUniqueId": "h23A40B2F96C2/138993",
"writebufferActive": 0,
"consolidationIntervalMsec": 1000
}
当我进行如下 AQL 搜索时,它正确返回 4:
FOR docs IN practice COLLECT WITH COUNT INTO num RETURN num
但是当我进行这样的 AQL 搜索时,我大多会得到空数组:
FOR doc IN practice
SEARCH ANALYZER(doc.text == "cookie", "text_en")
RETURN doc
(奇怪的是,有一两个词可以与上述内容一起使用,但大多数人不会 - 例如,“cookie”返回一个空数组,但“how”返回一个匹配项)
知道我做错了什么吗?
谢谢