Skip to content

Instantly share code, notes, and snippets.

View jpountz's full-sized avatar

Adrien Grand jpountz

  • Elasticsearch
  • Caen, France
View GitHub Profile
total disk: 379,720,980
num docs: 1,000,000
stored fields: 167,903,971
term vectors: 0
norms: 0
docvalues: 82,117,451
postings: 98,314,810
prox: 0
points: 23,599,626
terms: 7,761,248
@jpountz
jpountz / lucene-6.1.txt
Last active August 31, 2016 12:17
NYC taxi rides disk usage
total disk: 30,412,907,228
num docs: 165,346,692
stored fields: 11,049,749,404
term vectors: 0
norms: 0
docvalues: 8,722,043,518
postings: 918,100,584
prox: 0
points: 8,320,476,220
terms: 1,402,532,940
"dynamic_templates": [
{
"template1": {
"mapping": {
"store": true,
"type": "{dynamic_type}"
},
"match": "*"
}
}
import requests, json
url = "http://127.0.0.1:9206/test/_search?pretty&size=0"
#body = '{"query":{"match":{"field1":"value1"}}}'
body = '{"query":{"match_all":{}}}'
N=100
sumTook = 0
for i in range(0,N):
r = requests.get(url, data = body)
sumTook+=int(r.json.get('took'))
width = 4
top_count = 256
total = 0
freqs = {}
for line in open("/usr/share/dict/words").readlines():
line = line.rstrip('\n')
if line.find('\'') >= 0:
continue
total += len(line)
DELETE test
PUT test
{
"mappings": {
"test": {
"properties": {
"start": {
"type": "date"
},
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
@jpountz
jpountz / IntArrayDocIdSet.java
Created February 16, 2015 16:01
IntArrayDocIdSet.java
import java.io.IOException;
import java.util.Arrays;
import org.apache.lucene.search.DocIdSet;
import org.apache.lucene.search.DocIdSetIterator;
import org.apache.lucene.util.ArrayUtil;
import org.apache.lucene.util.RamUsageEstimator;
@jpountz
jpountz / set.groovy
Created November 28, 2014 14:27
Set update
DELETE test
PUT test/test/1
{
"values": ["a", "c"]
}
POST test/test/1/_update
{
"script": "def values = ctx._source.values as Set; ctx._source.values = values + new_values",