⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HA Proxy Logging on Lion | |
------------------------- | |
# To enable haproxy logging we need to change syslogd startup procedure to include its network listener. | |
# Backup syslogd start up file | |
sudo cp /System/Library/LaunchDaemons/com.apple.syslogd.plist /System/Library/LaunchDaemons/com.apple.syslogd.plist.bakup | |
# Convert binary file to xml to be human readable / editable |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'http://localhost:9200/test,test2/_search?timeout=10s&size=10' -d ' | |
{ | |
"sort": | |
[ | |
"_score" | |
], | |
"query": | |
{ | |
"filtered": |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -XDELETE 'http://localhost:9200/blog/' | |
curl -XPUT 'http://localhost:9200/blog/' | |
curl -XPUT 'http://localhost:9200/blog/doc/_mapping' -d ' | |
{ | |
"doc" : { | |
"dynamic" : false, | |
"properties" : { | |
"title" : { "type" : "string"}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Expensive child query | |
--------------------- | |
curl -XGET 'http://localhost:9200/test/_search?pretty=true&timeout=2' -d ' | |
{ | |
"query" : { | |
"has_child" : { | |
"type" : "comment", | |
"query" : { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From Docs: max_expansions parameter that can control to how many prefixes the last term will be expanded. It is highly recommended to set it to an acceptable value to control the execution time of the query. | |
curl -X DELETE localhost:9200/cities | |
curl -X POST "http://localhost:9200/cities/city" -d '{ "city" : "San Gabriel" }' | |
curl -X POST "http://localhost:9200/cities/city" -d '{ "city" : "San Gwann" }' | |
curl -X POST "http://localhost:9200/cities/city" -d '{ "city" : "San Carlos" }' | |
curl -X POST "http://localhost:9200/cities/city" -d '{ "city" : "San Cristobal" }' | |
curl -X POST "http://localhost:9200/cities/city" -d '{ "city" : "San Clemente" }' | |
curl -X POST "http://localhost:9200/cities/city" -d '{ "city" : "San Diego" }' | |
curl -X POST "http://localhost:9200/cities/city" -d '{ "city" : "San Dimas" }' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -XGET 'http://localhost:9200/ticket_customers/ticket_customer/_search?pretty=true' -d ' | |
{ | |
"sort": | |
[ | |
"_score" | |
], | |
"query": | |
{ | |
"bool": | |
{ |