GET idx_test/_search
{
"size": 0,
"aggs": {
"Lorem-ipsum-dolor-sit-amet--consectetur-adipiscing-elit--Fusce-lacinia-lacus-dignissim--sollicitudin-est-a--rhoncus-velit--Nulla-ut-tortor-at-diam-suscipit-vestibulum--Praesent-dignissim--tellus-sed-tempus-scelerisque--velit-ligula-vestibulum-ante--non-sodales-risus-elit-at-orci--Morbi-at-lectus-quam--Vivamus-mattis--enim-eget-congue-viverra--nulla-dui-fermentum-tortor--nec-scelerisque-libero-tortor-luctus-nisl--Pellentesque-vel-metus-venenatis--gravida-libero-feugiat--tincidunt-ligula-pharetra-Lorem-ipsum-dolor-sit-amet--consectetur-adipiscing-elit--Fusce-lacinia-lacus-dignissim--sollicitudin-est-a--rhoncus-velit--Nulla-ut-tortor-at-diam-suscipit-vestibulum--Praesent-dignissim--tellus-sed-tempus-scelerisque--velit-ligula-vestibulum-ante--non-sodales-risus-elit-at-orci--Morbi-at-lectus-quam--Vivamus-mattis--enim-eget-congue-viverra--nulla-dui-fermentum-tortor--nec-scelerisque-libero-tortor-luctus-nisl--Pellentesque-vel-metus-venenatis--gravida-libero-fe
View 01.md
View nginx-kibana.conf
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
upstream elasticsearch_upstream { | |
server 10.10.10.10:9200; | |
keepalive 15; | |
} | |
upstream kibana_upstream { | |
server 127.0.0.1:5601; | |
} | |
# Kibana, public access, RO operations |
View test.rs
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
pub fn run() { | |
// Correct One | |
let hello1 = "Hello"; | |
let mut hello2 = String::from("Hello"); | |
hello2.push('\u{1f600}'); | |
println!("{}", hello1.len()); | |
println!("{}", hello2.len()); | |
println!("{:?}", (hello1, hello2)); | |
} |
View percentiles_aggregation.md
POST test_index/_bulk
{"index": {"_id": 1}}
{"price": 68}
{"index": {"_id": 2}}
{"price": 74}
{"index": {"_id": 3}}
{"price": 74}
{"index": {"_id": 4}}
{"price": 118}
View sample-data-for-stackoverflow.md
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"}
View elastic_bulk-import-settings.sh
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 |
View 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
PUT jobs | |
{ | |
"mappings": { | |
"properties": { | |
"title": { | |
"type": "search_as_you_type" | |
} | |
} | |
} | |
} |
View 0-README.md
Sample Usage For the PHP Turkish Stemmer Project
You can download the gist as zip and open it. After open it, run the below command:
composer install
Then our environment ready. Just run the file :
View php7.0-fpm-pool-www.conf
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' |
View size.md
# images field type is nested
GET products/_search
{
"track_total_hits": true,
"size": 0,
"aggs": {
"counts": {
"terms": {
"script": "params['_source']['images'].size()",
NewerOlder