diff --git a/duniter4j-es-assembly/src/test/misc/movementByRange.sh b/duniter4j-es-assembly/src/test/misc/movementByRange.sh new file mode 100755 index 0000000000000000000000000000000000000000..679019927b2dac6f6787cd8501e3d4601c3db004 --- /dev/null +++ b/duniter4j-es-assembly/src/test/misc/movementByRange.sh @@ -0,0 +1,36 @@ +#!/bin/sh +curl -XPOST 'http://localhost:9200/gtest/movement/_search?pretty' -d ' + { + "size": 1000, + "query": { + "bool": { + "filter": [ + {"term": {"recipient" : "5ocqzyDMMWf1V8bsoNhWb1iNwax1e9M7VTUN6navs8of" }}, + {"terms": {"code" : ["MEMBER_JOIN","MEMBER_ACTIVE","MEMBER_LEAVE","MEMBER_EXCLUDE","MEMBER_REVOKE"] }} + ] + } + }, + "aggs": { + "tx": { + "range": { + "field" : "medianTime", + "ranges" : [ + { "from" : 0, "to" : 1492041600 } + ] + }, + "aggs" : { + "received" : { + "filter": {"term": {"recipient": "5ocqzyDMMWf1V8bsoNhWb1iNwax1e9M7VTUN6navs8of"}}, + "aggs": { + "received_stats": { + "stats": { + "field": "amount" + } + } + } + } + } + } + } + }' + diff --git a/duniter4j-es-assembly/src/test/misc/test_queries_graph.sh b/duniter4j-es-assembly/src/test/misc/test_queries_graph.sh new file mode 100755 index 0000000000000000000000000000000000000000..257c5976f75ab10ed73b0246cfce2ff1bfb25ad9 --- /dev/null +++ b/duniter4j-es-assembly/src/test/misc/test_queries_graph.sh @@ -0,0 +1,18 @@ +#!/bin/sh +curl -XPOST 'http://gtest.data.duniter.fr:80/user/event/_search?pretty' -d ' + { + "size": 1000, + "query": { + "bool": { + "filter": [ + {"term": {"recipient" : "5ocqzyDMMWf1V8bsoNhWb1iNwax1e9M7VTUN6navs8of" }}, + {"terms": {"code" : ["MEMBER_JOIN","MEMBER_ACTIVE","MEMBER_LEAVE","MEMBER_EXCLUDE","MEMBER_REVOKE"] }} + ] + } + }, + "sort" : [ + { "time" : {"order" : "desc"}} + ], + _source: ["code", "time"] + }' + diff --git a/duniter4j-es-core/src/main/java/org/duniter/elasticsearch/dao/impl/PeerDaoImpl.java b/duniter4j-es-core/src/main/java/org/duniter/elasticsearch/dao/impl/PeerDaoImpl.java index a05e877127011d6532d7595340eadfdd7e5a8dfd..61475a4b04f5db974f08d110eae3dea95b2f6d3f 100644 --- a/duniter4j-es-core/src/main/java/org/duniter/elasticsearch/dao/impl/PeerDaoImpl.java +++ b/duniter4j-es-core/src/main/java/org/duniter/elasticsearch/dao/impl/PeerDaoImpl.java @@ -57,7 +57,7 @@ public class PeerDaoImpl extends AbstractDao implements PeerDao { Preconditions.checkNotNull(peer); Preconditions.checkArgument(StringUtils.isNotBlank(peer.getId())); Preconditions.checkArgument(StringUtils.isNotBlank(peer.getCurrency())); - Preconditions.checkNotNull(peer.getHash()); + //Preconditions.checkNotNull(peer.getHash()); Preconditions.checkNotNull(peer.getHost()); Preconditions.checkNotNull(peer.getApi());