mapping found for [sales] in order to sort on

Warnings: [299 Elasticsearch-7.5.1-3ae9ac9a93c95bd0cdc054951cf95d88e1e18d96 "[types removal] Specifying types in search requests is deprecated."]
{"error":{"root_cause":[{"type":"query_shard_exception","reason":"No mapping found for [sales] in order to sort on","index_uuid":"KpTMfPekSZulPtfIMYL4Ng","index":"productso"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"productso","node":"UTNy3bWNQWuDTKjJg9ACjQ","reason":{"type":"query_shard_exception","reason":"No mapping found for [sales] in order to sort on","index_uuid":"KpTMfPekSZulPtfIMYL4Ng","index":"productso"}}]},"status":400}
        at org.elasticsearch.client.RestClient$SyncResponseListener.get(RestClient.java:936) ~[elasticsearch-rest-client-6.8.4.jar:6.8.4]
        at org.elasticsearch.client.RestClient.performRequest(RestClient.java:233) ~[elasticsearch-rest-client-6.8.4.jar:6.8.4]
        at org.elasticsearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1764) ~[elasticsearch-rest-high-level-client-6.8.4.jar:6.8.4]
        ... 70 common frames omitted
    Caused by: org.elasticsearch.client.ResponseException: method [POST], host [http://localhost:9200], URI [/productso/ProductSo/_search?rest_total_hits_as_int=true&typed_keys=true&ignore_unavailable=false&expand_wildcards=open&allow_no_indices=true&ignore_throttled=true&search_type=dfs_query_then_fetch&batched_reduce_size=512], status line [HTTP/1.1 400 Bad Request]
Warnings: [299 Elasticsearch-7.5.1-3ae9ac9a93c95bd0cdc054951cf95d88e1e18d96 "[types removal] Specifying types in search requests is deprecated."]
{"error":{"root_cause":[{"type":"query_shard_exception","reason":"No mapping found for [sales] in order to sort on","index_uuid":"KpTMfPekSZulPtfIMYL4Ng","index":"productso"}],"type":"search_phase_execution_exception","reason":"all shards failed","phase":"query","grouped":true,"failed_shards":[{"shard":0,"index":"productso","node":"UTNy3bWNQWuDTKjJg9ACjQ","reason":{"type":"query_shard_exception","reason":"No mapping found for [sales] in order to sort on","index_uuid":"KpTMfPekSZulPtfIMYL4Ng","index":"productso"}}]},"status":400}
        at org.elasticsearch.client.RestClient$1.completed(RestClient.java:552)
        at org.elasticsearch.client.RestClient$1.completed(RestClient.java:537)
        at org.apache.http.concurrent.BasicFuture.completed(BasicFuture.java:122)
        at org.apache.http.impl.nio.client.DefaultClientExchangeHandlerImpl.responseCompleted(DefaultClientExchangeHandlerImpl.java:181)
        at org.apache.http.nio.protocol.HttpAsyncRequestExecutor.processResponse(HttpAsyncRequestExecutor.java:448)
        at org.apache.http.nio.protocol.HttpAsyncRequestExecutor.inputReady(HttpAsyncRequestExecutor.java:338)
        at org.apache.http.impl.nio.DefaultNHttpClientConnection.consumeInput(DefaultNHttpClientConnection.java:265)
        at org.apache.http.impl.nio.client.InternalIODispatch.onInputReady(InternalIODispatch.java:81)
        at org.apache.http.impl.nio.client.InternalIODispatch.onInputReady(InternalIODispatch.java:39)
        at org.apache.http.impl.nio.reactor.AbstractIODispatch.inputReady(AbstractIODispatch.java:114)
        at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:162)
        at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:337)
        at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:315)
        at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:276)
        at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:104)
        at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:591)
        ... 1 common frames omitted
 

 

在JAVA程序中应该这么设置:

FieldSortBuilder salesSortBuilder = SortBuilders.fieldSort("sales").order(SortOrder.DESC).unmappedType("integer");

环境:

<spring-boot.version>2.2.1.RELEASE</spring-boot.version>
<spring-cloud.version>Hoxton.RELEASE</spring-cloud.version>

elasticsearch-7.5.1

说说股市吧,最近股市看上去挺活跃的,其实暗藏杀机,要说上涨,估计上涨不到哪里去,毕竟中国大妈人物都没有说要炒股,所以,光骗那些北上资金摇旗呐喊,要是哪一天,政策一变,又是一片被割的韭菜呀。

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值