Skip to content

Instantly share code, notes, and snippets.

def self.oauth_client
OAuth2::Client.new(
AppConfig.slack_api_client.client_id,
AppConfig.slack_api_client.client_secret,
site: 'https://slack.com',
authorize_url: '/oauth/authorize',
token_url: '/api/oauth.access',
)
end
@bbansal
bbansal / elasticsearch-nested-test.sh
Created February 22, 2013 02:41
Elastic search nested query issue
# Create a new index
curl -XPUT http://localhost:9200/newindex
# Create a nested mapping
curl -XPUT http://localhost:9200/newindex/foo/_mapping -d '{"foo" : {"properties": { "nested_field" : { "type": "nested" }} }}'
# Add a document
curl -XPUT http://localhost:9200/newindex/foo/5812395 -d '{ "nested_field" : [ { "name" : "blue", "count" : 4 }, { "name" : "green", "count" : 6 } ], "id":5812395 }'
# Refresh the index