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

      1. <tfoot id='Fh1Ri'></tfoot>
      2. <legend id='Fh1Ri'><style id='Fh1Ri'><dir id='Fh1Ri'><q id='Fh1Ri'></q></dir></style></legend>

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

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

        时间:2023-09-30
            <tbody id='mhoIN'></tbody>

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

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

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

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

                  问题描述

                  我想知道如何使用 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.

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

                  上一篇:如何从 Lucene 中的文档术语向量中获取位置? 下一篇:KeywordAnalyzer 和 LowerCaseFilter/LowerCaseTokenizer

                  相关文章

                  最新文章

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

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

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

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