Skip to content

Instantly share code, notes, and snippets.

View JTaurus19's full-sized avatar

Ivan Tim JTaurus19

View GitHub Profile
@JTaurus19
JTaurus19 / java_14_switch_2.java
Created May 3, 2020 09:22
Java 14 New Features
public class Switch {
public static void main(String[] args) {
String animal = "Fox";
switch (animal) {
case "Dog":
case "Cat":
System.out.println("Pets");
break;
case "Tiger":
case "Fox":
@JTaurus19
JTaurus19 / java_14_switch_3.java
Created May 3, 2020 09:24
Java 14 New Features
public class Switch {
public static void main(String[] args) {
String animal = "Fox";
switch (animal) {
case "Dog", "Cat" -> System.out.println("Pets");
case "Tiger","Fox" -> System.out.println("Wild Animals");
case "Parrot","Pigeon","Sparrow" -> System.out.println("Birds");
}
}
}
@JTaurus19
JTaurus19 / java_14_block_text.java
Last active May 3, 2020 09:34
Java 14 New Features
public class BlockTest {
public static void main(String[] args) {
String htmlBlock = """
<html>
<body>\
<p>Hello, '\s' World</p>\
</body>
</html>""";

07.07-20 (Wednesday)

  • fix the issue with version for FE locally run;
  • SHRD-129: autoscaling setting up;
  • bugs fixing:
    • SHRD-127: files downloading endpoints;
    • SHRD-184: users deletion endpoints.

Time: 8h

06.07-20 (Tuesday)

"_shards": {
"total": 10,
"successful": 5,
"failed": 0
}
{
"index.number_of_shards": 4,
"index.number_of_replicas": 2,
}
curl --request PUT 'http://HOST:PORT/index_name/_settings' \
--header 'Content-Type: application/json' \
--data-raw '{
"max_result_window": 1000000
}'
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-elasticsearch</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-elasticsearch</artifactId>
</dependency>
<dependency>
<groupId>com.github.vanroy</groupId>
import org.springframework.data.domain.Sort;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder;
import org.elasticsearch.index.query.BoolQueryBuilder;
import com.github.vanroy.springdata.jest.JestElasticsearchTemplate;
...
import org.springframework.data.elasticsearch.core.ScrolledPage;
import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder;
...
@Autowired
private JestElasticsearchTemplate jestTemplate;
//how long Elasticsearch should retain the search context for the request
private static final int SCROLL_TIMEOUT = 100;