String length function query in Solr

前端 未结 2 1326
慢半拍i
慢半拍i 2021-01-04 08:30

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 tha

2条回答
  •  爱一瞬间的悲伤
    2021-01-04 09:32

    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}.*/
    

提交回复
热议问题