Skip to content
Snippets Groups Projects
Commit 33b608db authored by G. K. Wang's avatar G. K. Wang
Browse files

[elasticsearch] Fix rangeQuery in elasticsearchclient

parent 54d443c4
No related branches found
No related tags found
No related merge requests found
......@@ -33,6 +33,8 @@ LICENSE file.
</properties>
<dependencies>
<dependency>
<!-- jna is supported in ES and will be used when provided
otherwise a fallback is used -->
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>4.1.0</version>
......
......@@ -20,7 +20,6 @@ package com.yahoo.ycsb.db;
import static org.elasticsearch.common.settings.Settings.Builder;
import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
import static org.elasticsearch.index.query.QueryBuilders.rangeQuery;
import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery;
import static org.elasticsearch.node.NodeBuilder.nodeBuilder;
......@@ -333,10 +332,10 @@ public class ElasticSearchClient extends DB {
public Status scan(String table, String startkey, int recordcount,
Set<String> fields, Vector<HashMap<String, ByteIterator>> result) {
try {
final RangeQueryBuilder filter = rangeQuery("_id").gte(startkey);
final RangeQueryBuilder rangeQuery = rangeQuery("_id").gte(startkey);
final SearchResponse response = client.prepareSearch(indexKey)
.setTypes(table)
.setQuery(matchAllQuery())
.setQuery(rangeQuery)
.setSize(recordcount)
.execute()
.actionGet();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment