来自两个单独字段的Solr多值日期范围作为子实体 [英] Solr Multivalued date range from two separate field as sub entity

查看:185
本文介绍了来自两个单独字段的Solr多值日期范围作为子实体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Apache Solr的初学者. 我的data-config.xml包含以下代码

I am a Apache Solr beginner. My data-config.xml contains this code

<entity name="event">                        
<field column="event_id" name="id" />
...
<entity name="request_history" query="select request_date, request_expiry_date from request_history where id=event.id">
   <field column="request_date" name="start_date" />
   <field column="request_expiry_date" name="expire_date" />
</entity>

然后是这些字段的shcema.xml文件中的内容

AND following is what in shcema.xml file against those fields

<field name="start_date" type="tdate" indexed="true" stored="true" multiValued="true"/>
<field name="expire_date" type="tdate" indexed="true" stored="true" multiValued="true"/>

因此,对于单个事件,可能会有多个请求,因此会有多个"start_date"和"expire_date".现在,我需要查找某个日期范围内的所有请求,而不是查找给定日期范围内的所有请求,但是找不到任何方式.

So, for a single event, there can be multiple requests hence multiple "start_date" and "expire_date". Now I need to find all requests within a date range and all requests not within a given date range, but not getting any way.

推荐答案

我发现了一种非常简单的解决问题的方法,alhamdulillah.它是一个简单的查询模式-

I have found a very easy way to solve the problem, alhamdulillah. Its a simple query pattern-

-(start_date: [2013-07-01T0:00:00Z TO 2013-07-18T0:00:00Z] AND end_date: [2013-07-01T0:00:00Z TO 2013-07-18T0:00:00Z]) 

这是我真正需要的.

这篇关于来自两个单独字段的Solr多值日期范围作为子实体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆