简体   繁体   English

如何仅从facet.fields中获取年份,而Solr JSON中包含完整的日期字段?

[英]How to get only year from facet.fields contains full date field in Solr JSON?

How to get only year from facet.fields date field in Solr JSON ? 如何从Solr JSON中的facet.fields日期字段获取仅年份? Help me if you have solution. 如果您有解决方案,请帮助我。

As far as I know you will have to loop through the results and extract the year. 据我所知,您将不得不遍历结果并提取年份。

If extracting year from date is regular query to solr then it is preferable to index 如果从日期中提取年份是对查询的常规查询,则最好进行索引

year separately. 一年。

Hope this helps. 希望这可以帮助。 In case you find a better solution do let me know. 如果您找到更好的解决方案,请告诉我。

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

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