Skip to content

Instantly share code, notes, and snippets.

View julesbravo's full-sized avatar

James Bathgate julesbravo

  • Postscript
  • San Antonio, TX
View GitHub Profile
{
"size" : 20,
"fields": [
"siteId",
"searchQuery",
"popularity"
],
"query": {
"filtered" : {
"query": {
curl -XPUT 'http://localhost:9200/myindex/' -d '
{
"settings" : {
"analysis" : {
"analyzer" : {
"skuIndexAnalyzer" : {
"type" : "custom",
"tokenizer" : "keyword",
"filter" : ["skuDelimiter", "lowercase", "ngram", "unique"]
},
npm http 304 https://registry.npmjs.org/glob/3.2.1
npm WARN package.json jade@0.26.3 No README.md file found!
npm ERR! error rolling back Error: ENOTEMPTY, rmdir '/Ghost/node_modules/grunt/node_modules/async'
npm ERR! error rolling back grunt@0.4.1 { [Error: ENOTEMPTY, rmdir '/Ghost/node_modules/grunt/node_modules/async']
npm ERR! error rolling back errno: 53,
npm ERR! error rolling back code: 'ENOTEMPTY',
npm ERR! error rolling back path: '/Ghost/node_modules/grunt/node_modules/async' }
npm ERR! Error: ENOENT, utime '/Ghost/node_modules/grunt/node_modules/eventemitter2/test/perf'
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
vagrant@vagrant-ubuntu-precise-64:/Ghost$ npm install grunt-jslint
npm http GET https://registry.npmjs.org/grunt-jslint
npm http 304 https://registry.npmjs.org/grunt-jslint
npm ERR! Error: EROFS, symlink '../grunt-jslint/bin/grunt-jslint'
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-@googlegroups.com>
npm ERR! System Linux 3.2.0-44-generic
vagrant@vagrant-ubuntu-precise-64:/Ghost$ npm install -g grunt-cli
npm http GET https://registry.npmjs.org/grunt-cli
npm http 200 https://registry.npmjs.org/grunt-cli
npm http GET https://registry.npmjs.org/grunt-cli/-/grunt-cli-0.1.9.tgz
npm http 200 https://registry.npmjs.org/grunt-cli/-/grunt-cli-0.1.9.tgz
npm ERR! error rolling back Error: EACCES, unlink '/home/vagrant/nvm/v0.10.5/bin/grunt'
npm ERR! error rolling back grunt-cli@0.1.9 { [Error: EACCES, unlink '/home/vagrant/nvm/v0.10.5/bin/grunt']
npm ERR! error rolling back errno: 3,
npm ERR! error rolling back code: 'EACCES',
npm ERR! error rolling back path: '/home/vagrant/nvm/v0.10.5/bin/grunt' }
created: function () {
var searchData = {
id : this.id,
title : this.attributes.title,
content : this.attributes.content,
meta_title : this.attributes.meta_title,
meta_description : this.attributes.meta_description,
meta_keywords : this.attributes.meta_keywords
};
@julesbravo
julesbravo / request.js
Created January 9, 2014 21:49
Test for including body in HTTP GET requests using http.request. Results in empty body and "problem with request: socket hang up".
var http = require('http');
var options = {
hostname: 'localhost',
port: 23000,
path: '/',
method: 'GET'
};
var req = http.request(options, function(res) {
@julesbravo
julesbravo / results
Created March 3, 2014 21:45
Slow Percolator Index
Deleting Old Index:
{"acknowledged":true}
Creating Index:
{"acknowledged":true}
Create Percolator Mapping:
{"acknowledged":true}
Create Query Mapping:
curl "http://localhost:9200/_nodes/hot_threads"
::: [Strongarm][ZiJTz2JGR_S8ttDeGmkZgA][ec2-23-23-23-3.compute-1.amazonaws.com][inet[/10.0.2.15:9300]]
98.7% (493.3ms out of 500ms) cpu usage by thread 'elasticsearch[Strongarm][bulk][T#1]'
3/10 snapshots sharing following 19 elements
java.lang.reflect.Array.get(Native Method)
org.apache.lucene.util.RamUsageEstimator.measureObjectSize(RamUsageEstimator.java:456)
org.apache.lucene.util.RamUsageEstimator.sizeOf(RamUsageEstimator.java:350)
org.elasticsearch.index.percolator.stats.ShardPercolateService$RamEstimator.sizeOf(ShardPercolateService.java:97)
org.elasticsearch.index.percolator.stats.ShardPercolateService.computeSizeInMemory(ShardPercolateService.java:89)
@julesbravo
julesbravo / gist:9357887
Created March 4, 2014 23:23
Broken Percolator with Range Filters
#!/bin/bash
echo "Deleting Old Index: "
curl -XDELETE "http://localhost:9200/merchandising"
echo "
";
echo "Creating Index: "
curl -XPUT "http://localhost:9200/merchandising" -d '{