Skip to content

Instantly share code, notes, and snippets.

@MrJohnsson77
MrJohnsson77 / solrconfig.xml
Created May 12, 2012 23:46 — forked from hubgit/solrconfig.xml
Solr: solrconfig.xml for MoreLikeThis and CSV import
<?xml version="1.0" encoding="UTF-8"?>
<config>
<indexDefaults>
<useCompoundFile>false</useCompoundFile>
<mergeFactor>10</mergeFactor>
<ramBufferSizeMB>256</ramBufferSizeMB>
<maxFieldLength>100000000</maxFieldLength>
<writeLockTimeout>1000</writeLockTimeout>
<commitLockTimeout>10000</commitLockTimeout>
<lockType>native</lockType>
@MrJohnsson77
MrJohnsson77 / ES Beginner's PHP Script
Created September 4, 2012 04:42 — forked from stratawing/ES Beginner's PHP Script
ES Beginner's PHP Script
<?php
$ch = curl_init();
$method = "GET";
$url = "localhost/cerberus/resraw/_search?pretty=true";
$qry = '{
"size" : 10,
"fields" : "usr",
"query" : {
@MrJohnsson77
MrJohnsson77 / backup.sh
Created September 14, 2012 21:21 — forked from nherment/backup.sh
Backup and restore an Elastic search index (shamelessly copied from http://tech.superhappykittymeow.com/?p=296)
#!/bin/bash
# herein we backup our indexes! this script should run at like 6pm or something, after logstash
# rotates to a new ES index and theres no new data coming in to the old one. we grab metadatas,
# compress the data files, create a restore script, and push it all up to S3.
TODAY=`date +"%Y.%m.%d"`
INDEXNAME="logstash-$TODAY" # this had better match the index name in ES
INDEXDIR="/usr/local/elasticsearch/data/logstash/nodes/0/indices/"
BACKUPCMD="/usr/local/backupTools/s3cmd --config=/usr/local/backupTools/s3cfg put"
BACKUPDIR="/mnt/es-backups/"
YEARMONTH=`date +"%Y-%m"`
@MrJohnsson77
MrJohnsson77 / backup.sh
Created September 14, 2012 21:27 — forked from karussell/backup.sh
Backup ElasticSearch with rsync
# TO_FOLDER=/something
# FROM=/your-es-installation
DATE=`date +%Y-%m-%d_%H-%M`
TO=$TO_FOLDER/$DATE/
echo "rsync from $FROM to $TO"
# the first times rsync can take a bit long - do not disable flusing
rsync -a $FROM $TO
# now disable flushing and do one manual flushing
@MrJohnsson77
MrJohnsson77 / .gitignore
Created September 15, 2012 03:29 — forked from karmi/.gitignore
Donut Chart from ElasticSearch Terms Facet
.DS_Store
tmp/
@MrJohnsson77
MrJohnsson77 / README.md
Created October 29, 2012 01:58 — forked from mikedfunk/README.md
CodeIgniter Pagination for Twitter Bootstrap

This uses Twitter Bootstrap classes for CodeIgniter pagination.

Drop this file into application/config.

# simple match all query with term facet
ejs.Request()
.indices("myindex")
.types("mytype")
.query(ejs.MatchAllQuery())
.facet(
ejs.TermsFacet('url')
.field('url')
.size(20))
/*---------------------
:: Food
-> model
---------------------*/
module.exports = {
attributes : {
name: 'STRING',
type: 'STRING',
expiration: 'DATE',
quantity: 'STRING',
cloud:
aws:
access_key: AWS_ACCESS_KEY
secret_key: AWS_SECRET_KEY
region: eu-west-1
discovery:
type: ec2
ec2:
groups: datastore-elasticsearch
.img-rounded{behavior:url(/scripts/PIE.htc)}
.img-circle{behavior:url(/scripts/PIE.htc)}
.table-bordered{behavior:url(/scripts/PIE.htc)}
select,textarea,input,code,pre{behavior:url(/scripts/PIE.htc)}
.input-group-addon{behavior:url(/scripts/PIE.htc)}
.btn{behavior:url(/scripts/PIE.htc)}
.dropdown-menu{behavior:url(/scripts/PIE.htc)}
.panel{behavior:url(/scripts/PIE.htc)}
.well{behavior:url(/scripts/PIE.htc)}
.nav-tabs > li > a{behavior:url(/scripts/PIE.htc)}