简体   繁体   English

Solr:如何在文本字段中搜索完整匹配? 是否有隐藏的equal()运算符?

[英]Solr: How to search for a full match on a text field? Is there a hidden equal() operator?

it is too simple to describe: 描述太简单了:

q=mydynamicfield_txt:"video" Q = mydynamicfield_txt: “视频”

I want only hits when mydynamicfield is exact "video. Other way round, how to supress hits, where "video" is only part of the field (like "home video"). 当mydynamicfield 完全是“视频”时,我只希望点击。其他方式,如何压制点击,“视频”只是该领域的一部分(如“家庭视频”)。

Is this supported with Solr3.1 out of the box, or do I have to add my own special brackets like "SOLRSTARTSOLR video SOLRENDSOLR" in my index, to retrieve later my term between "START" and "END". 这是开箱即用的Solr3.1支持,还是我必须在我的索引中添加我自己的特殊括号,如“SOLRSTARTSOLR视频SOLRENDSOLR”,以便在“START”和“END”之间检索我的术语。 Kind of manual regex anchoring. 一种手动正则表达式锚定。

This is PITA cause it needs special handling in index/gui and breaks highlighting. 这是PITA因为它需要在index / gui中进行特殊处理并打破突出显示。

Where is the way to go? 要走的路在哪里?

regards 问候

Peter (=PA=) 彼得(= PA =)

One solution to create untokenized(KeywordAnalyzed) field and search within it - all your text will be distinct token in Solr index. 创建未加密(KeywordAnalyzed)字段并在其中搜索的一种解决方案 - 所有文本都将是Solr索引中的不同标记。 Other solution is to write filter which will read token count from index and compare to query tokens ie filter entities where doc_tokens > query_tokens assuming that all query tokens are matched. 其他解决方案是编写过滤器,该过滤器将从索引读取令牌计数并与查询令牌进行比较,即过滤实体,其中doc_tokens> query_tokens假设所有查询令牌都匹配。

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

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