PUT transactions
POST transactions/_bulk
{"index": {"_id": 1}}
{"id": 1, "user_id": 5, "transaction_date": "2022-05-04T11:18:00Z"}
{"index": {"_id": 2}}
{"id": 2, "user_id": 5, "transaction_date": "2022-05-04T10:36:00Z"}
{"index": {"_id": 3}}
{"id": 3, "user_id": 3, "transaction_date": "2022-05-04T10:23:00Z"}
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
# Temporary Speed-up configuration for fast import | |
# references: https://www.elastic.co/blog/performance-considerations-elasticsearch-indexing | |
# p.s. If you do not want to restart your node/cluster - don't perform 1 and 2 points | |
## | |
# 1. Change "ES_HEAP_SIZE" from 50% of memory (default and recommended) to something like 80% | |
mem=`free -m | grep Mem | awk '{ print $2 }'` && heap=$[ ($mem/1024)*80/100 ]g && \ | |
sudo sed -i "s/ES_HEAP_SIZE=.*/ES_HEAP_SIZE=$heap/" /etc/init.d/elasticsearch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PUT jobs | |
{ | |
"mappings": { | |
"properties": { | |
"title": { | |
"type": "search_as_you_type" | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Choose how the process manager will control the number of child processes. | |
; Possible Values: | |
; static - a fixed number (pm.max_children) of child processes; | |
; dynamic - the number of child processes are set dynamically based on the | |
; following directives. With this process management, there will be | |
; always at least 1 children. | |
; pm.max_children - the maximum number of children that can | |
; be alive at the same time. | |
; pm.start_servers - the number of children created on startup. | |
; pm.min_spare_servers - the minimum number of children in 'idle' |
# images field type is nested
GET products/_search
{
"track_total_hits": true,
"size": 0,
"aggs": {
"counts": {
"terms": {
"script": "params['_source']['images'].size()",
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//******************************************************************* | |
// Welcome to CompileJava! | |
// If you experience any issues, please contact us ('More Info') --> | |
// Sorry that the "Paste" feature no longer works! GitHub broke it. | |
//******************************************************************* | |
import java.lang.Math; // headers MUST be above the first class | |
/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
trait A { | |
public static function dispatch() | |
{ | |
var_dump(func_get_args()); | |
return new static(...func_get_args()); | |
} | |
} |
DELETE demodata
PUT demodata
{
"mappings": {
"document": {
"properties": {
"documentName": {
########
GET _analyze
{
"text": ["document.txt"],
"analyzer": "standard"
}
{