Skip to content

Instantly share code, notes, and snippets.

View xeraa's full-sized avatar
🥑
Developer

Philipp Krenn xeraa

🥑
Developer
View GitHub Profile
@xeraa
xeraa / .env
Last active December 18, 2018 13:33
Zusammengesetzte Worte in Elasticsearch
ELASTIC_VERSION=6.5.3
@xeraa
xeraa / kibana.json
Created October 16, 2018 08:20
Retrieving a copy_to field in Elasticsearch (Kibana syntax)
DELETE my_index
PUT my_index
{
"settings": {
"number_of_shards": 1
},
"mappings": {
"_doc": {
"properties": {
"first_name": {
@xeraa
xeraa / docker-compose.yml
Created October 2, 2018 15:41
Demo for Liferay and Elasticsearch + Kibana
---
version: '2'
services:
liferay:
image: mdelapenya/liferay-portal:7.1-ce-beta2-tomcat-hsql
ports:
- 8080:8080
- 11311:11311
@xeraa
xeraa / .env
Last active January 17, 2020 17:32
Docker: Kibana + Elasticsearch with Stempel, Phonetic, and Language detection
ELASTIC_VERSION=6.3.0
@xeraa
xeraa / .env
Last active March 14, 2020 08:55
Minimal 3 node Elasticsearch + Kibana setup
ELASTIC_VERSION=5.6.9
#ELASTIC_VERSION=6.3.0
# Data
DELETE latest-connection
POST _bulk
{ "index" : { "_index" : "latest-connection", "_type" : "_doc"} }
{ "client": "10.10.10.10", "version": "1.3", "timestamp": "2018-05-01T12:10:30Z" }
{ "index" : { "_index" : "latest-connection", "_type" : "_doc"} }
{ "client": "20.20.20.20", "version": "1.5", "timestamp": "2018-05-01T12:10:30Z" }
{ "index" : { "_index" : "latest-connection", "_type" : "_doc"} }
{ "client": "10.10.10.10", "version": "1.4", "timestamp": "2018-05-02T12:10:30Z" }
{ "index" : { "_index" : "latest-connection", "_type" : "_doc"} }
DELETE companies
PUT companies
{
"mappings": {
"company" : {},
"employee" : {
"_parent": {
"type": "company"
}
DELETE my_index
PUT my_index
{
"mappings": {
"my_type": {
"properties": {
"last_viewed": {
"type": "date",
"format": "dd/MM/YYYY||YYYY/MM/dd"
}
@xeraa
xeraa / issues.sh
Last active May 16, 2017 12:46
Export GitHub issues to Elasticsearch
#!/bin/bash
response=200
i=1
while [[ response -eq 200 ]]
do
curl -u '<username>:<token>' "https://api.github.com/repos/<account>/<repository>/issues?filter=all&state=all&per_page=100&page=${i}" > issues${i}.json
response=$(curl --write-out %{http_code} --silent --output /dev/null -u '<username>:<token>' "https://api.github.com/repos/<account>/<repository>/issues/$((i*100))")
((i++))
done
@xeraa
xeraa / union.json
Created January 13, 2017 23:51
Simulating a union query from SQL in Elasticsearch
DELETE my_index
PUT my_index
{
"mappings": {
"my_type": {
"properties": {
"type": {
"type": "keyword"
}