请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

es问题程序都能正常运行,但是es报了一个异常

es是安装在cenos7.0上的 es版本2.4.4

--------------------------------------------------------------

@Test

public void testFindDistinctEsBlogByTitleContainingOrSummaryContainingOrContentContaining() {

Pageable pageable = new PageRequest(0, 20);

String title = "思";

String summary = "相思";

String content = "相思";

Page<EsBlog> page = esBlogRepository.findDistinctEsBlogByTitleContainingOrSummaryContainingOrContentContaining(title, summary, content, pageable);

assertThat(page.getTotalElements()).isEqualTo(2);

System.out.println("...............start");

for (EsBlog esBlog : page.getContent()) {

System.out.println(esBlog.toString());

}

System.out.println("...............end");

}


--------------结果能正常显示

...............start

EsBlog[id='AWCs5uiA58QWs6Mq5-HS',title='相思',summary='王维的相思',content='红豆生南国,春来发几枝。愿君多采撷,此物最相思。']

EsBlog[id='AWCs5uig58QWs6Mq5-HT',title='静夜思',summary='李白的静夜思',content='床前明月光,疑是地上霜,举头望明月,低头思故乡。']

...............end

------------es可以正常使用显示结果,但是Centos上的es会报下面这个异常------------

[2017-12-31 18:27:39,192][DEBUG][action.search ] [Human Cannonball] [2] Failed to execute query phase

RemoteTransportException[[Human Cannonball][192.168.0.103:9300][indices:data/read/search[phase/scan/scroll]]]; nested: SearchContextMissingException[No search context found for id [2]];

Caused by: SearchContextMissingException[No search context found for id [2]]

        at org.elasticsearch.search.SearchService.findContext(SearchService.java:626)

        at org.elasticsearch.search.SearchService.executeScan(SearchService.java:318)

        at org.elasticsearch.search.action.SearchServiceTransportAction$SearchScanScrollTransportHandler.messageReceived(SearchServiceTransportAction.java:433)

        at org.elasticsearch.search.action.SearchServiceTransportAction$SearchScanScrollTransportHandler.messageReceived(SearchServiceTransportAction.java:430)

        at org.elasticsearch.transport.TransportRequestHandler.messageReceived(TransportRequestHandler.java:33)

        at org.elasticsearch.transport.RequestHandlerRegistry.processMessageReceived(RequestHandlerRegistry.java:77)

        at org.elasticsearch.transport.TransportService$4.doRun(TransportService.java:378)

        at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37)

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

        at java.lang.Thread.run(Thread.java:748)


正在回答 回答被采纳积分+3

1回答

老卫 2018-01-01 22:13:56

可能是你操作系统的字符设置问题。建议你把中文改为英文再测试下、~

0 回复 有任何疑惑可以回复我~
  • 提问者 慕仙4974986 #1
    就是英文版的操作系统,怎么设置
    回复 有任何疑惑可以回复我~ 2018-01-01 22:16:05
  • 老卫 回复 提问者 慕仙4974986 #2
    现在我不常用这个了。、,你自己上网查下吧~
    或者,你把代码里面的中文改为英文试下
    回复 有任何疑惑可以回复我~ 2018-01-01 23:13:06
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信