Delete all documents from index without deleting index

I believe if you combine the delete by query with a match all it should do what you are looking for, something like this (using your example): curl -XDELETE ‘http://localhost:9200/twitter/tweet/_query’ -d ‘{ “query” : { “match_all” : {} } }’ Or you could just delete the type: curl -XDELETE http://localhost:9200/twitter/tweet Note: XDELETE is deprecated for … Read more

Elasticsearch – How to normalize score when combining regular query and function_score?

Recently i am working on a problem like this too. I couldn’t find any formal documentation about this issue but when i investigate the results with “explain api”, it seems like “queryNorm” is not applied to the score directly coming from “functions” field. This means that you can not directly normalize script value. However, i … Read more

Elasticsearch showing received plaintext http traffic on an https channel in console

As @Val has already answered the question above just posting the code new users who wants to disable the SSL. # ——————————————————————————– # Enable security features xpack.security.enabled: false xpack.security.enrollment.enabled: false # Enable encryption for HTTP API client connections, such as Kibana, Logstash, and Agents xpack.security.http.ssl: enabled: false keystore.path: certs/http.p12 # Enable encryption and mutual authentication … Read more

ElasticSearch get offsets of highlighted snippets

The client-side approach is actually standard practice. We have discussed adding the offsets, but are afraid it would lead to more confusion. The offsets provided are specific to Java’s UTF-16 String encoding, which, while they could technically be used to calculate the fragments from $LANG, it’s way more straightforward to parse the response text for … Read more

Direct self-reference leading to cycle exception

In this case you need to annotate the relationships with @JsonManagedReference and @JsonBackReference like this: @ManyToOne @JoinColumn(name = “company_id”, referencedColumnName = “id”) @JsonBackReference private Company company And @OneToMany(mappedBy=”company”) @JsonManagedReference private Set<Employee> employee = new HashSet<Employee>(); There is a nice example here

tech