使用 elasticsearch 6.7 时,
GET /indexName/_search
Run Code Online (Sandbox Code Playgroud)
返回索引的确切总数:
"hits" : {
"total" : 1527325,
"max_score" : 1.0,
...}
Run Code Online (Sandbox Code Playgroud)
但是在elasticsearch 7.0
GET /indexName/_search
Run Code Online (Sandbox Code Playgroud)
得到:
"hits" : {
"total" : {
"value" : 10000,
"relation" : "gte"
},
Run Code Online (Sandbox Code Playgroud)
这意味着总数大于 10000,那么如何获得 7.0 中索引的确切总数?
当我在线程对象上调用wait()方法时,同步线程完成运行后,等待的线程将被唤醒,为什么线程对象的行为不同于其中wait()的普通对象的行为?
Thread thread1 = new Thread(()-> {
System.out.println("thread 1 start");
try {
Thread.sleep(3000);
System.out.println("thread over");
} catch (InterruptedException e) {
e.printStackTrace();
}});
thread1.start();
synchronized (thread1) {
try {
thread1.wait();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
System.out.println("main thread wake up");
Run Code Online (Sandbox Code Playgroud)
我希望3s之后主线程不会唤醒,但是不会。