【问题标题】:How compute lucene FuzzyQuery on top GraphDB lucene index?如何在顶级 GraphDB lucene 索引上计算 lucene FuzzyQuery?
【发布时间】:2019-05-18 12:42:20
【问题描述】:

GraphDB 支持 FTS Lucene 插件来构建 RDF '分子' 来有效地索引文本。但是,当您正在搜索的单词中有错字(拼写错误)时,Lucene 不会检索结果。我想知道是否有可能在 GraphDB for FTS 中的 Lucene 索引之上实现基于 Damerau-Levenshtein 算法的 FuzzyQuery。这样,即使单词拼写不正确,您也可以根据编辑距离相似性获得更多“封闭”单词的列表。

这是我为在 WordNet RDF 中索引 NounSynset 标签创建的索引。

PREFIX wn20schema: <http://www.w3.org/2006/03/wn/wn20/schema/>
INSERT DATA {
    luc:index luc:setParam "uris" .
    luc:include luc:setParam "literals" .
    luc:moleculeSize luc:setParam "1" .
    luc:includePredicates luc:setParam "http://www.w3.org/2000/01/rdf-schema#label" .
    luc:includeEntities luc:setParam wn20schema:NounSynset.
    luc:nounIndex luc:createIndex "true".
}

运行查询时

select * where {
    {?id luc:nounIndex "credict"}
    ?id luc:score ?score.  
}

结果是空的,我想至少得到“credit”这个词,因为编辑距离是 1。

谢谢!!!

【问题讨论】:

    标签: lucene graphdb


    【解决方案1】:

    如果您使用~,它应该会给您一个模糊匹配。

    【讨论】:

    • 为了得到有用的答案,这个反应需要扩展。解释为什么这是问题的答案。
    猜你喜欢
    • 1970-01-01
    • 2015-07-30
    • 1970-01-01
    • 1970-01-01
    • 2013-08-08
    • 2019-06-11
    • 2016-06-29
    • 1970-01-01
    • 2013-08-21
    相关资源
    最近更新 更多