Skip to content

Instantly share code, notes, and snippets.

View sanikolaev's full-sized avatar

Sergey Nikolaev sanikolaev

View GitHub Profile
@sanikolaev
sanikolaev / load_elasticsearch_sharded.php
Created July 12, 2022 14:55
manticore and elasticsearch loading scripts with sharding
View load_elasticsearch_sharded.php
#!/usr/bin/php
<?php
if (count($argv) < 6) die("Usage: ".__FILE__." <batch size> <concurrency> <docs> <shards> <multiplier>\n");
require_once 'vendor/autoload.php';
$t = microtime(true);
$c = 0;
$ch = curl_init();
@sanikolaev
sanikolaev / load_elasticsearch.php
Last active July 12, 2022 14:57
scripts to load data ito manticore and elasticsearch with given concurrency and batch size
View load_elasticsearch.php
#!/usr/bin/php
<?php
if (count($argv) < 5) die("Usage: ".__FILE__." <batch size> <concurrency> <docs> <multiplier>\n");
require_once 'vendor/autoload.php';
$t = microtime(true);
$c = 0;
# delete old index
@sanikolaev
sanikolaev / gist:c9257714b0850c2989def31363420410
Last active April 12, 2021 16:20
manticore main+delta example
View gist:c9257714b0850c2989def31363420410
MySQL:
mysql> desc data;
+---------+------------+------+-----+-------------------+-----------------------------+
| Field | Type | Null | Key | Default | Extra |
+---------+------------+------+-----+-------------------+-----------------------------+
| id | bigint(20) | NO | PRI | 0 | |
| body | text | YES | | NULL | |
| updated | timestamp | NO | | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP |
+---------+------------+------+-----+-------------------+-----------------------------+
3 rows in set (0.00 sec)
@sanikolaev
sanikolaev / manticore_replication_sandbox.sh
Last active February 19, 2021 11:57
Manticore Search replication sandbox
View manticore_replication_sandbox.sh
#!/bin/sh
d="/tmp/manticore_replication_sandbox_docker_compose.yaml";
cat << EOF > $d
version: '2.2'
services:
manticore-1:
image: manticoresearch/manticore
networks:
View gist:a8b84e6c1d6e784a746ea7c16b402db2
➜ ~ docker run --name manticore -p9306:9306 -p9308:9308 --rm -d manticoresearch/manticore && \
docker exec -it manticore mysql && \
docker stop manticore
MySQL [(none)]> create table t2(f text);
MySQL [(none)]> insert into t2 values(0,'6406 Pz.Kpfw.VI Ausf.E Tiger I Late Production'),(0,'6800 Танк Wittmann\'sLast Tiger');
MySQL [(none)]> select * from t2;
+---------------------+------------------------------------------------+
| id | f |
+---------------------+------------------------------------------------+