Solr:索引短语短于查询时的短语搜索 [英] Solr: Phrase search when indexed phrase is shorter than the query

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

问题描述

如果索引字段是查询短语的一部分,是否可以找到文档?



它很容易找到快速棕色狐狸跳跃搜索棕色狐狸懒狗时,搜索懒惰的狗。但是,如果我需要做到这一点,反之亦然?



以下是我的情况:我在 brown fox 文档中有一个简短字段。或懒狗,我希望通过搜索快速棕色狐狸或<<跳过懒狗



注意:它应该是一个词组匹配,因此在查询中使所有可选项无效。像 brown dog 这样的查询不应该匹配。



您如何在Solr中执行此操作?是否有可能通过调整Solr来实现这一目标,而无需在客户端解析和修改请求的短语? 解决方案

查看 ShingleFilterFactory 。如果您仅将其应用于查询端,则可以实现您要查找的内容。


Is it possible to find a document if the indexed field is a part of the queried phrase?

It it easy to find "Quick brown fox jumps over the lazy dog" when searching for "brown fox" or "lazy dog". But what if I need to do it vice versa?

Here's my situation: I have a short field in a document like "brown fox" or "lazy dog" and I want this document to be found by searching for longer phrases like "Quick brown fox" or "jump over lazy dog".

Note: it should be a phrase match, so making all the terms optional in the query wouldn't work. The query like "brown dog" SHOULD NOT match.

How would you do it in Solr? Is it possible to achieve this goal by only tweaking Solr, without necessity to parse and modify the requested phrase on the client side?

解决方案

look at ShingleFilterFactory. If you apply that to the query side only, you could achieve what you are looking for.

这篇关于Solr:索引短语短于查询时的短语搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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