Solr中的字符串长度函数查询 [英] String length function query in Solr
本文介绍了Solr中的字符串长度函数查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要找到我的集合中某个字段的长度超过某个限制的所有文档.字段的类型为字符串.是否有一个函数查询返回Solr中字符串字段的长度?
I need to find all the documents in my collection for which the length of a certain field exceeds a certain limit. The field's type is string. Is there a function query that returns the length of a string field in Solr?
推荐答案
解决方案是使用Solr的正则表达式功能.例如,以下查询检索title
字段至少为42的所有文档:
The solution is to use Solr's regex capabilities. For example, the following query retrieves all the documents for which the title
field is at least 42:
title:/.{42}.*/
这篇关于Solr中的字符串长度函数查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文