Skip to content

Instantly share code, notes, and snippets.

View ianAndrewClark's full-sized avatar

Ian Clark ianAndrewClark

View GitHub Profile
@ianAndrewClark
ianAndrewClark / gist:1055826
Created June 30, 2011 07:50
3 times 10 point polygon query
{
"from": 0,
"size": 100,
"facets": {
"postalsector": {
"terms": {
"field": "postalsector",
"order": "count",
"size": 5
}
@ianAndrewClark
ianAndrewClark / gist:1058355
Created July 1, 2011 11:32
10 point polygon test, with bounded box
{
"from": 0,
"size": 100,
"facets": {
"outcodes": {
"terms": {
"field": "outcode",
"order": "count",
"size": 5
}
@ianAndrewClark
ianAndrewClark / gist:1058361
Created July 1, 2011 11:37
3 point polygon with bounded box query
{
"from": 0,
"size": 100,
"facets": {
"outcodes": {
"terms": {
"field": "postalsector",
"order": "count",
"size": 5
}
@ianAndrewClark
ianAndrewClark / gist:1066838
Created July 6, 2011 08:36
search response errors
[2011-07-06 03:50:13,582][DEBUG][monitor.jvm ] [Aardwolf] [gc][PS Scavenge][12] took [30ms]/[494ms], reclaimed [742.4mb], leaving [87.1mb] used, max [2.5gb]
[2011-07-06 09:02:54,047][WARN ][http.netty ] [Aardwolf] Caught exception while handling client http traffic, closing connection
java.lang.IllegalStateException: cannot send more responses than requests
at org.elasticsearch.common.netty.handler.codec.http.HttpContentEncoder.writeRequested(HttpContentEncoder.java:102)
at org.elasticsearch.common.netty.channel.SimpleChannelHandler.handleDownstream(SimpleChannelHandler.java:266)
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:568)
at org.elasticsearch.common.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:563)
at org.elasticsearch.common.netty.channel.Channels.write(Channels.java:611)
at org.elasticsearch.common.netty.channel.Channels.write(Channels.java:578)
at org.elasticsearch.comm
@ianAndrewClark
ianAndrewClark / job titles test
Created July 13, 2011 10:14
results in MapperParsingException[Analyzer [techTermPreservingFilterAnalyzer] not found for field [jobtitle]]
curl -XPUT 'localhost:9200/jt/' -d '
{
"settings": {
"index": {
"number_of_shards":5,
"number_of_replicas":0
}
}
}
'
@ianAndrewClark
ianAndrewClark / gist:1099101
Created July 22, 2011 08:43
multi-value term facet
curl -X DELETE "http://localhost:9200/classifieds"
echo -e "\ndeleted index"
curl -X POST "http://localhost:9200/classifieds/property/1" -d '{"type" : ["house", "detached"]}'
echo -e "\nindexed 1"
curl -X POST "http://localhost:9200/classifieds/property/2" -d '{"type" : ["house","detached"]}'
echo -e "\nindexed 2"
curl -X POST "http://localhost:9200/classifieds/property/3" -d '{"type" : ["house","semi"]}'
echo -e "\nindexed 3"
curl -X POST "http://localhost:9200/classifieds/property/4" -d '{"type" : ["house","terraced"]}'
echo -e "\nindexed 4"
@ianAndrewClark
ianAndrewClark / gist:1171014
Created August 25, 2011 15:55
location mapping, with settings
{
"mappings": {
"locations": {
"properties": {
"recordId": {
"type": "long"
},
"namePlain": {
"type": "string",
"store": "no",
@ianAndrewClark
ianAndrewClark / gist:1369898
Created November 16, 2011 11:42
external_quiet version test script
curl -X DELETE "http://localhost:9200/dashboard"
curl -X POST "http://localhost:9200/dashboard/article/1?version=15&version_type=external_quiet" -d '
{ "title" : "One",
"tags" : ["ruby", "java", "search"]}
'
#{"ok":true,"_index":"dashboard","_type":"article","_id":"1","_version":15}
curl -X POST "http://localhost:9200/dashboard/article/1?version=13&version_type=external_quiet" -d '
{ "title" : "Two",
@ianAndrewClark
ianAndrewClark / perf-timing
Created December 14, 2011 12:52
timing script
function listTimingInfo (){
var timing = window.performance.timing;
var url = document.location.href;
var navigationStart = timing.navigationStart;
var loadEnd = timing.loadEventEnd;
var totalLoadTime = loadEnd - navigationStart;
@ianAndrewClark
ianAndrewClark / dabblet.css
Created January 12, 2012 15:21
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height:100%;