一词短语搜索,避免在Solr中词干 [英] One word phrase search to avoid stemming in Solr

查看:82
本文介绍了一词短语搜索,避免在Solr中词干的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Solr实例中启用了词干分析,我假设为了在不禁用词干的情况下执行精确的词搜索,就像将词放入引号一样简单.但是,事实似乎并非如此吗?

I have stemming enabled in my Solr instance, I had assumed that in order to perform an exact word search without disabling stemming, it would be as simple as putting the word into quotes. This however does not appear to be the case?

有没有简单的方法可以实现这一目标?

Is there a simple way to achieve this?

推荐答案

有一种简单的方法,如果您要指的是模糊搜索中的倾斜"(要求相似)(请参见 Lucene查询语法此处).

There is a simple way, if what you're referring to is the "slop" (required similarity) as part of a fuzzy search (see the Lucene Query Syntax here).

例如,如果我执行此搜索:

For example, if I perform this search:

 q=field_name:determine

我看到包含确定",确定",确定"等的结果.如果我随后按如下方式修改查询:

I see results that contain "determine", "determining", "determined", etc.. If I then modify the query like so:

 q=field_name:determine~1

我只看到包含单词"determine"的结果.这是因为我将必需的相似度指定为1,这意味着完全匹配".我可以在0到1之间的任何位置指定该值.

I only see results that contain the word "determine". This is because I'm specifying a required similarity of 1, which means "exact match". I can specify this value anywhere from 0 to 1.

这篇关于一词短语搜索,避免在Solr中词干的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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