Skip to content

Instantly share code, notes, and snippets.

@tstibbs
tstibbs / gist:9762265
Created March 25, 2014 13:52
Elasticsearch geo field causing query parser failure for index which doesn't have that field
curl -XPUT localhost:9200/test1 -d '{
"settings": {
"number_of_shards": 1,
"number_of_replicas": 0
},
"mappings": {
"type1": {
"properties": {
"geofield": {
"type": "geo_point"
@tstibbs
tstibbs / gist:1c337313115de57a7229
Created May 13, 2014 10:04
Geo and Date fields return different values if fetched from stored value or _source
curl -XPUT "http://localhost:9200/test" -d '
{
"mappings": {
"document": {
"properties": {
"date": {
"type": "date",
"store": "true"
},
"date2": {
@tstibbs
tstibbs / gist:dc36483f96f8d1471385
Last active August 29, 2015 14:03
Elasticsearch field 'copy_to' disagrees with itself
curl -XPUT 'http://localhost:9200/index1' -d '
{
"mappings": {
"parent": {
"properties": {
"children": {
"type": "nested",
"properties": {
"colour": {
"type": "string"
@tstibbs
tstibbs / gist:645e01c5dcdfa9d2a193
Created July 15, 2014 08:40
"matched_queries" does not include queries within a wrapper query
curl -XPUT 'http://localhost:9200/index'
curl -XPUT 'http://localhost:9200/index/thing/1' –d '
{
"stuff": "blah"
}
'
# works
curl -XPOST 'http://localhost:9200/index/_search' –d '
@tstibbs
tstibbs / bug.sh
Created January 13, 2016 09:51
Named query causes null pointer
#!/bin/bash
curl -XPUT 'http://localhost:9200/myindex/' -d '
{
"settings": {
"index": {
"number_of_shards": 1,
"number_of_replicas": 0
}
},
package com.example;
import java.net.URL;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
public class TestFilter implements ServletContextListener
{
public void contextInitialized(ServletContextEvent sce)
<!DOCTYPE html>
<!-- Based off https://github.com/xguaita/Leaflet.MapCenterCoord/blob/1211f46947c0f375a717561b9230c8303a178062/examples/simple.html -->
<html>
<head>
<title>Center Position Control - Simple</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.5/leaflet.css" />
@tstibbs
tstibbs / leaflet.html
Created June 14, 2016 12:03
leaflet control overlay
<!DOCTYPE html>
<html>
<!-- fork of http://leafletjs.com/examples/quick-start-example.html -->
<head>
<title>Leaflet Quick Start Guide Example</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.css" />
@tstibbs
tstibbs / Hello.js
Last active September 27, 2016 13:46
react-skylight#13
import React, { Component } from 'react';
import SkyLight from 'react-skylight';
class Hello extends Component {
constructor(props) {
super(props)
}
render() {
return (