<bdo id='CxGTC'></bdo><ul id='CxGTC'></ul>

    1. <legend id='CxGTC'><style id='CxGTC'><dir id='CxGTC'><q id='CxGTC'></q></dir></style></legend>

      <small id='CxGTC'></small><noframes id='CxGTC'>

        <i id='CxGTC'><tr id='CxGTC'><dt id='CxGTC'><q id='CxGTC'><span id='CxGTC'><b id='CxGTC'><form id='CxGTC'><ins id='CxGTC'></ins><ul id='CxGTC'></ul><sub id='CxGTC'></sub></form><legend id='CxGTC'></legend><bdo id='CxGTC'><pre id='CxGTC'><center id='CxGTC'></center></pre></bdo></b><th id='CxGTC'></th></span></q></dt></tr></i><div id='CxGTC'><tfoot id='CxGTC'></tfoot><dl id='CxGTC'><fieldset id='CxGTC'></fieldset></dl></div>
        <tfoot id='CxGTC'></tfoot>

        如何在日期之间搜索(休眠搜索)?

        How to search between dates (Hibernate Search)?(如何在日期之间搜索(休眠搜索)?)

        <small id='nN1g1'></small><noframes id='nN1g1'>

        <legend id='nN1g1'><style id='nN1g1'><dir id='nN1g1'><q id='nN1g1'></q></dir></style></legend>

          <i id='nN1g1'><tr id='nN1g1'><dt id='nN1g1'><q id='nN1g1'><span id='nN1g1'><b id='nN1g1'><form id='nN1g1'><ins id='nN1g1'></ins><ul id='nN1g1'></ul><sub id='nN1g1'></sub></form><legend id='nN1g1'></legend><bdo id='nN1g1'><pre id='nN1g1'><center id='nN1g1'></center></pre></bdo></b><th id='nN1g1'></th></span></q></dt></tr></i><div id='nN1g1'><tfoot id='nN1g1'></tfoot><dl id='nN1g1'><fieldset id='nN1g1'></fieldset></dl></div>

            • <bdo id='nN1g1'></bdo><ul id='nN1g1'></ul>

                <tfoot id='nN1g1'></tfoot>
                    <tbody id='nN1g1'></tbody>

                  本文介绍了如何在日期之间搜索(休眠搜索)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我想知道如何使用 Range-Query 在 Hibernate Search 中按日期搜索,或者是否有任何过滤器我必须实现.以下是我在记录实体中的字段

                  I am wondering how I can search between by dates in Hibernate Search using Range-Query or is there any filter I have to implement.Following is my field in Record Entity

                      /**
                       * When the analysis started.
                       */
                      @Temporal(TemporalType.TIMESTAMP)
                      @Field(index = Index.UN_TOKENIZED)
                      @DateBridge(resolution = Resolution.MILLISECOND)
                      private Date startTS;
                  

                  我的要求是找到两个日期之间分析的记录,例如.2011 年 11 月 11 日到 2012 年 11 月 11 日.我很困惑如何做到这一点.

                  My requirment is to find the records analysed between a two dates eg. 11/11/2011 to 11/11/2012.I am confused how to do this.

                  推荐答案

                  您应该使用使用 fromto 的范围查询.

                  You should use a range query using from and to.

                  query = monthQb
                          .range()
                              .onField( "startTS" ).ignoreFieldBridge()
                              .from( DateTools.dateToString( from, DateTools.Resolution.MILLISECOND ) )
                              .to( DateTools.dateToString( to, DateTools.Resolution.MILLISECOND ) ).excludeLimit()
                              .createQuery();
                  

                  ignoreFieldBridge 是必需的,因为您自己使用 DateTools 创建了基于字符串的搜索字符串.

                  The ignoreFieldBridge is needed since you create the string based search string yourself using DateTools.

                  这篇关于如何在日期之间搜索(休眠搜索)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  How to send data to COM PORT using JAVA?(如何使用 JAVA 向 COM PORT 发送数据?)
                  How to make a report page direction to change to quot;rtlquot;?(如何使报表页面方向更改为“rtl?)
                  Use cyrillic .properties file in eclipse project(在 Eclipse 项目中使用西里尔文 .properties 文件)
                  Is there any way to detect an RTL language in Java?(有没有办法在 Java 中检测 RTL 语言?)
                  How to load resource bundle messages from DB in Java?(如何在 Java 中从 DB 加载资源包消息?)
                  How do I change the default locale settings in Java to make them consistent?(如何更改 Java 中的默认语言环境设置以使其保持一致?)
                  <legend id='rlvu7'><style id='rlvu7'><dir id='rlvu7'><q id='rlvu7'></q></dir></style></legend>
                          <tbody id='rlvu7'></tbody>

                          <tfoot id='rlvu7'></tfoot>
                        • <i id='rlvu7'><tr id='rlvu7'><dt id='rlvu7'><q id='rlvu7'><span id='rlvu7'><b id='rlvu7'><form id='rlvu7'><ins id='rlvu7'></ins><ul id='rlvu7'></ul><sub id='rlvu7'></sub></form><legend id='rlvu7'></legend><bdo id='rlvu7'><pre id='rlvu7'><center id='rlvu7'></center></pre></bdo></b><th id='rlvu7'></th></span></q></dt></tr></i><div id='rlvu7'><tfoot id='rlvu7'></tfoot><dl id='rlvu7'><fieldset id='rlvu7'></fieldset></dl></div>
                            <bdo id='rlvu7'></bdo><ul id='rlvu7'></ul>

                          • <small id='rlvu7'></small><noframes id='rlvu7'>