简体   繁体   English

是否可以使用不完整的单词和ArangoSearch查找文档?

[英]Is it possible to find documents using incomplete words and ArangoSearch?

For example, let's pretend my document contained the attribute "description" and the value of it was "Quick brown fox". 例如,假设我们的文档包含属性“ description”,其值为“ Quick brown fox”。 Could ArangoSearch use the input, "Quic" and be able to find the document that contains the description, "Quick brown fox"? ArangoSearch可以使用输入“ Quic”来查找包含描述“ Quick brown fox”的文档吗?

As far as I know, ArangoSearch can only find matches if the token/word is completed. 据我所知,ArangoSearch仅在标记/单词完成后才能找到匹配项。 Is this true? 这是真的?

Here's some query code to show what I'm talking about. 这是一些查询代码,以显示我在说什么。 If the binding variable, @searchInputValue , takes the value of "Quic", it won't find the document, but if it takes the value of "Quick", it does find the document. 如果绑定变量@searchInputValue的值为“ Quic”,则不会找到该文档,但是如果值为“ Quick”,则它将找到该文档。

FOR document IN v_test
    SEARCH ANALYZER(
        (
            document.description IN TOKENS('@searchInputValue', 'text_en')
        )
        , 'text_en'
    ) 
    RETURN document

You can use the FULLTEXT function of AQL: https://docs.arangodb.com/3.0/AQL/Functions/Fulltext.html 您可以使用AQL的FULLTEXT函数: https : //docs.arangodb.com/3.0/AQL/Functions/Fulltext.html

However you can't write the prefix syntax directly in AQL when using Input Parameters. 但是,使用输入参数时,不能直接在AQL中编写前缀语法。 You have to foormat the searchInputValue, to pass: 您必须将searchInputValue设置为传递:

Quic,+prefix:Quic

So you can write your query as: 因此,您可以将查询写为:

FOR res IN FULLTEXT(v_test, "description", @searchInputValue)
RETURN res

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM