Skip to content

Instantly share code, notes, and snippets.

View dkullmann's full-sized avatar

David Kullmann dkullmann

View GitHub Profile
{"query":{"filtered":{"query":{"text":{"_all":"poker"}},"filter":[{"term":{"user.role":"expert"}},{"term":{"expertprofile.approved":1}},{"term":{"expertprofile.is_public":1}}]}}}
{"query": {"filtered": {
"query": {"text": {"_all": "poker"}},
"filter": {"or": [
{"term": {"user.role": "expert"}},
{"term": {"expertprofile.approved": 1}},
{"term": {"expertprofile.is_public": 1}}
]}
}}}
{"filtered": {
"query": {"text": {"_all": "poker"}},
"filter": [
{"term": {"user.role": "expert"}},
{"term": {"expertprofile.approved": 1}},
{"term": {"expertprofile.is_public": 1}}
]
}}
{"User": {
"email": "bc561@hotmail.com",
"slug": "philip-newall",
"role": "expert",
"id": "4d792f20-4c60-447b-8e37-065dadcb5c22"
}}
{"filtered": {
"query": {"text": {"_all": "poker"}},
"filter": {"and": [
{"term": {"user.role": "expert"}},
{"term": {"expertprofile.approved": 1}},
{"term": {"expertprofile.is_public": 1}}
]}
}}
{"user": {"properties": {
"User": {
"dynamic": "true",
"properties": {
"id": {"type": "string"},
"email": {"type": "string"},
"role": {"type": "string"},
"slug": {"type": "string"}
}
},
@dkullmann
dkullmann / app.js
Created November 7, 2011 17:13
Mustache Iteration Example w/Backbone and an array of objects
jQuery(function() {
var Property = Backbone.Model.extend({
/**
* Primary key-like ID for each model
*/
idAttribute: 'ListingKey',
/**
@dkullmann
dkullmann / document.json
Created November 9, 2011 16:42
Why doesn't this query (query.json) match this document (document.json) in Elastic Search?
{
"_index":"listings",
"_type":"latest",
"_id":"1500-main-st-venice-ca-90291",
"_version":1,
"exists":true,
"_source":{
"BuildingSize":2915,
"Country":"UNITED STATES OF AMERICA",
"ListPrice":4995000,
@dkullmann
dkullmann / query.json
Created November 10, 2011 01:38
Why would this ElasticSearch geo_distance search return results so far away?
// http://cl.ly/2y1P02082I2n2g3B3h1s <-- ES results on left, cleaned up results on right
{
"query":{
"match_all":{
}
},
"filter":{
"and":[
{
"query":{
"query_string":{
"default_field":"FullAddress",
"query":"2920^0 Valle^1 Vista^2 Drive,^3 Eagle^4 Rock,^5 CA^6"
}
},
"filter":{
"terms":{
"ListingStatus":[