Skip to content

Instantly share code, notes, and snippets.

View wflanagan's full-sized avatar

William Flanagan wflanagan

View GitHub Profile
@wflanagan
wflanagan / Elasticsearch_error_log.txt
Last active August 29, 2015 14:01
Problem with dynamic field on a subdocument
# 2014-05-26 12:06:24:323 [400]
#
# {
# "error": "MapperParsingException[failed to parse [profiles.location]]; nested: ElasticSearchIllegalArgumentException[unknown property [city]]; ",
# "status": 400
# }
@wflanagan
wflanagan / error.text
Last active August 29, 2015 14:04
ElasticSearch AR Persistence different data structure examples.rb
Elasticsearch::Transport::Transport::Errors::BadRequest: [400] {"error":"MapperParsingException[failed to parse [headers]]; nested: ElasticSearchIllegalArgumentException[unknown property [server]]; ","status":400}
from /home/vagrant/.rvm/gems/ruby-1.9.3-p545/gems/elasticsearch-transport-0.4.11/lib/elasticsearch/transport/transport/base.rb:132:in `__raise_transport_error'
from /home/vagrant/.rvm/gems/ruby-1.9.3-p545/gems/elasticsearch-transport-0.4.11/lib/elasticsearch/transport/transport/base.rb:227:in `perform_request'
from /home/vagrant/.rvm/gems/ruby-1.9.3-p545/gems/elasticsearch-transport-0.4.11/lib/elasticsearch/transport/transport/http/faraday.rb:20:in `perform_request'
from /home/vagrant/.rvm/gems/ruby-1.9.3-p545/gems/elasticsearch-transport-0.4.11/lib/elasticsearch/transport/client.rb:92:in `perform_request'
from /home/vagrant/.rvm/gems/ruby-1.9.3-p545/gems/elasticsearch-api-0.4.11/lib/elasticsearch/api/actions/index.rb:79:in `index'
from /home/vagrant/.rvm/gems/ruby-1.9.3-p545/bundler/gems/elas
var Audienti = {
currentUser: function (){
return $('body').data('user-id');
}
};
@wflanagan
wflanagan / query.txt
Created June 12, 2015 18:09
Trying to query to remove documents with negative keywords in ElastIcSearch
Parse Failure [Failed to parse source [{\"query\":{\"filtered\":{\"query\":{\"bool\":{\"must\":[{\"match_all\":{}}],\"must_not\":[]}},\"filter\":{\"bool\":{\"must\":[{\"term\":{\"project_ids\":1022}},{\"terms\":{\"wordsmaster_id\":[18363,18662,18409,18016,18017,18038,18039,18041,18257,18258,18259,18260,18261,18262,18263,18264,18268,18267,18269,18272,18270,18273,18274,18275,18276,18277,18271,18641,18642,18643,18648,18649,18650,18651,18653,18656,18654,18657,18659,18652,18655,18661,18660,18658]}}],\"should\":[],\"must_not\":[{\"match\":{\"text\":[\"seo\",\"indian\"]}}]}}}},\"size\":10,\"from\":0,\"sort\":[{\"created_at\":\"desc\"}]}]]]; nested: QueryParsingException[[mentions_001] No filter registered for [match]]; }]","status":400}
a = Goal.results(profile).each {|row_of_data| row_of_data }
# how do I modify the "metrics and dimensions" methods without defining a specific class?
rifice child
[1003950.944011] Killed process 1157 (bundle) total-vm:19344kB, anon-rss:4756kB, file-rss:0kB
[1003965.552027] Out of memory: Kill process 1223 (bundle) score 4 or sacrifice child
[1003965.552027] Killed process 1223 (bundle) total-vm:19372kB, anon-rss:5024kB, file-rss:40kB
[1004036.584031] Out of memory: Kill process 1245 (bundle) score 4 or sacrifice child
[1004036.584031] Killed process 1245 (bundle) total-vm:19292kB, anon-rss:5168kB, file-rss:44kB
[1004057.621714] Out of memory: Kill process 1410 (bundle) score 4 or sacrifice child
[1004057.621739] Killed process 1410 (bundle) total-vm:19344kB, anon-rss:4944kB, file-rss:0kB
[1004111.392018] Out of memory: Kill process 1450 (bundle) score 4 or sacrifice child
[1004111.392018] Killed process 1450 (bundle) total-vm:19320kB, anon-rss:4844kB, file-rss:184kB
/Users/wflanagan/sites/marketfu/config/initializers/typhoeus_response_document_patch.rb:92: [BUG] Segmentation fault
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.2.0]
-- control frame ----------
c:0047 p:0013 s:0183 b:0182 l:000060 d:000181 BLOCK /Users/wflanagan/sites/marketfu/config/initializers/typhoeus_response_document_patch.rb:92
c:0046 p:0015 s:0172 b:0172 l:000162 d:000171 BLOCK /Users/wflanagan/.rvm/gems/ruby-1.9.2-p290/gems/nokogiri-1.4.6/lib/nokogiri/xml/node_set.rb:239
c:0045 p:---- s:0169 b:0169 l:000168 d:000168 FINISH
c:0044 p:---- s:0167 b:0167 l:000166 d:000166 CFUNC :upto
c:0043 p:0023 s:0163 b:0163 l:000162 d:000162 METHOD /Users/wflanagan/.rvm/gems/ruby-1.9.2-p290/gems/nokogiri-1.4.6/lib/nokogiri/xml/node_set.rb:238
c:0042 p:0129 s:0159 b:0159 l:000060 d:000060 METHOD /Users/wflanagan/sites/marketfu/config/initializers/typhoeus_response_document_patch.rb:90
@wflanagan
wflanagan / gist:1442731
Created December 7, 2011 13:06
complete links function
def complete_links(opts = {})
return @complete_links unless @complete_links.blank?
link_list = if opts[:limit]
links.slice(0..opts[:limit])
else
links
end
@complete_links = []
@wflanagan
wflanagan / gist:1442732
Created December 7, 2011 13:06
complete links function
def complete_links(opts = {})
return @complete_links unless @complete_links.blank?
link_list = if opts[:limit]
links.slice(0..opts[:limit])
else
links
end
@complete_links = []
/Users/wflanagan/.rvm/gems/ruby-1.9.2-p290@marketfu/bundler/gems/nokogiri-bd52db9bc49e/lib/nokogiri/xml/node.rb:830: [BUG] Segmentation fault
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.2.0]
-- control frame ----------
c:0031 p:---- s:0136 b:0136 l:000135 d:000135 CFUNC :native_write_to
c:0030 p:0250 s:0129 b:0129 l:000128 d:000128 METHOD /Users/wflanagan/.rvm/gems/ruby-1.9.2-p290@marketfu/bundler/gems/nokogiri-bd52db9bc49e/lib/nokogiri/xml/node.rb:830
c:0029 p:0183 s:0119 b:0119 l:000118 d:000118 METHOD /Users/wflanagan/.rvm/gems/ruby-1.9.2-p290@marketfu/bundler/gems/nokogiri-bd52db9bc49e/lib/nokogiri/xml/node.rb:752
c:0028 p:0054 s:0110 b:0110 l:000109 d:000109 METHOD /Users/wflanagan/.rvm/gems/ruby-1.9.2-p290@marketfu/bundler/gems/nokogiri-bd52db9bc49e/lib/nokogiri/html/document.rb:64
c:0027 p:0149 s:0106 b:0106 l:000105 d:000105 METHOD /Users/wflanagan/.rvm/gems/ruby-1.9.2-p290@marketfu/bundler/gems/nokogiri-bd52db9bc49e/lib/nokogiri/xml/node.rb:769
c:0026 p:0159 s:0102 b:0102 l:000101 d