Solr:索引短语短于查询时的短语搜索

编程入门 行业动态 更新时间:2024-10-18 10:29:51
本文介绍了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:索引短语短于查询时的短语搜索

本文发布于:2023-06-06 00:32:17,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:短语   索引   Solr

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!