Iterable values = userOnlineOtpRepository.search(queryBuilder, new PageRequest(0, CommonConstants.ES_PAGINATION_LIMIT, new Sort(new Sort.Order(Sort.Direction.DESC, "requestedTimestamp"))));
This query always throws error , but works if i remove the portion which sorts the data i.e new Sort(new Sort.Order(Sort.Direction.DESC, "requestedTimestamp")).
My Elasticsearch is running on local mac machine with Java 8 Update 66. Is it the Java version which is causing error ?
Failed to execute phase [dfs], all shards failed; shardFailures {[Yb2FXnm2QimOmPqUgbbLJg][otpindex][0]: SearchParseException[[otpindex][0]: query[+userId:5456765189 +requestedTimestamp:[1456992127734 TO *]],from[0],size[1]: Parse Failure [Failed to parse source [{"from":0,"size":1,"query":{"bool":{"must":[{"match":{"userId":{"query":"5456765189","type":"boolean"}}},{"range":{"requestedTimestamp":{"from":1456992127734,"to":null,"include_lower":true,"include_upper":true}}}]}},"sort":[{"requestedTimestamp":{"order":"desc"}}]}]]]; nested: SearchParseException[[otpindex][0]: query[+userId:5456765189 +requestedTimestamp:[1456992127734 TO *]],from[0],size[1]: Parse Failure [No mapping found for [requestedTimestamp] in order to sort on]]; }{[Yb2FXnm2QimOmPqUgbbLJg][otpindex][1]: SearchParseException[[otpindex][1]: query[+userId:5456765189 +requestedTimestamp:[1456992127734 TO *]],from[0],size[1]: Parse Failure [Failed to parse source [{"from":0,"size":1,"query":{"bool":{"must":[{"match":{"userId":{"query":"5456765189","type":"boolean"}}},{"range":{"requestedTimestamp":{"from":1456992127734,"to":null,"include_lower":true,"include_upper":true}}}]}},"sort":[{"requestedTimestamp":{"order":"desc"}}]}]]]; nested: SearchParseException[[otpindex][1]: query[+userId:5456765189 +requestedTimestamp:[1456992127734 TO *]],from[0],size[1]: Parse Failure [No mapping found for [requestedTimestamp] in order to sort on]]; }{[Yb2FXnm2QimOmPqUgbbLJg][otpindex][2]: SearchParseException[[otpindex][2]: query[+userId:5456765189 +requestedTimestamp:[1456992127734 TO *]],from[0],size[1]: Parse Failure [Failed to parse source [{"from":0,"size":1,"query":{"bool":{"must":[{"match":{"userId":{"query":"5456765189","type":"boolean"}}},{"range":{"requestedTimestamp":{"from":1456992127734,"to":null,"include_lower":true,"include_upper":true}}}]}},"sort":[{"requestedTimestamp":{"order":"desc"}}]}]]]; nested: SearchParseException[[otpindex][2]: query[+userId:5456765189 +requestedTimestamp:[1456992127734 TO *]],from[0],size[1]: Parse Failure [No mapping found for [requestedTimestamp] in order to sort on]]; }
Already an entry exist which contains a mapping for requestedTimestamp.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.