Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/search/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
<img src="//i.stack.imgur.com/RUiNP.png" height="16" width="18" alt="" class="sponsor tag img">elasticsearch Elasticsearch-使用';搜索后';在我的初始查询中,只要我使用正确的开始时间?_<img Src="//i.stack.imgur.com/RUiNP.png" Height="16" Width="18" Alt="" Class="sponsor Tag Img">elasticsearch_Search_Term - Fatal编程技术网 elasticsearch Elasticsearch-使用';搜索后';在我的初始查询中,只要我使用正确的开始时间?,elasticsearch,search,term,elasticsearch,Search,Term" /> elasticsearch Elasticsearch-使用';搜索后';在我的初始查询中,只要我使用正确的开始时间?,elasticsearch,search,term,elasticsearch,Search,Term" />

elasticsearch Elasticsearch-使用';搜索后';在我的初始查询中,只要我使用正确的开始时间?

elasticsearch Elasticsearch-使用';搜索后';在我的初始查询中,只要我使用正确的开始时间?,elasticsearch,search,term,elasticsearch,Search,Term,根据文档,对elastic进行初始查询,从中检索排序时间戳。 然后,我使用“searchafter”进行后续查询,每次都更改排序时间戳以检索所需的记录 例如: `{"query":{"bool":{"must":[{"bool":{"must":[{"bool":{"must":[{"range":{"Timestamp&

根据文档,对elastic进行初始查询,从中检索排序时间戳。 然后,我使用“searchafter”进行后续查询,每次都更改排序时间戳以检索所需的记录

例如:

   `{"query":{"bool":{"must":[{"bool":{"must":[{"bool":{"must":[{"range":{"Timestamp":{"gte":${stUnix},"format": "epoch_millis"}}},{"range":{"Timestamp":{"lte":${endUnix},"format": "epoch_millis"}}}]}}]}}]}},"sort":{"Timestamp": {"order":"asc"}},"size":${dateRadio}, "script_fields" : {
      "test1" : {
          "script" : {
              "lang": "painless",
              "source": "doc['InitiatorBytes'].value + doc['ResponderBytes'].value"
          }
      }
  },"_source":{"includes":["*"],"excludes":[]},"from":0}\n`;
在运行这个初始查询之后,我使用响应中的排序时间戳来运行后续查询

`{"query":{"bool":{"must":[{"bool":{"must":[{"bool":{"must":[{"range":{"Timestamp":{"gte":${stUnix},"format": "epoch_millis"}}},{"range":{"Timestamp":{"lte":${endUnix},"format": "epoch_millis"}}}]}}]}}]}},"search_after":[${sortUnix}],"sort":{"Timestamp": {"order":"asc"}},"size":${dateRadio},"_source":{"includes":["*"],"excludes":[]},"from":0}\n`
在上面,我将sortunix变量设置为从初始查询中检索到的排序时间戳。在这两个查询中,我在gte中设置了相同的初始开始时间:“stUnix”

我的问题是,是否可以放弃第一个查询,将初始searchafter'sortunix'变量设置为等于'stunix'变量

我尝试过这样做,但似乎效果不错,但我不确定这是否会影响数据的完整性