Ask yourself:
Where is the community that needs this tool?
What function or need does it address?
What is the discussion in the community?
Note: I've included addendum material in all basement slides. Check it out!
Ask yourself:
Does this already exist?
If so, how does it address a need?
What is the discussion in the community?
Ep. 9 - How To Build A Product
http://www.codenewbie.org/podcast/how-to-build-a-product
Sub-goal: Learn elasticsearch, have fun!
break it.
#Elasticsearch gem
gem 'elasticsearch', '~> 1.0.6'
gem 'elasticsearch-model'
gem 'elasticsearch-rails'
#Chewy for log handling
gem 'chewy', '~> 0.6.0'
def search
if params[:query].nil?
@hospitals = []
else
@hospitals = Hospital.search params[:query]
end
end
require 'elasticsearch/model'
class Hospital < ActiveRecord::Base
include Elasticsearch::Model
include Elasticsearch::Model::Callbacks
end
Hospital.import # for auto sync model with elastic search
All-in-all Ruby had the better free online tutorials.
Discussion point: Will those with more clear, free, tutorials win out?
Gemfile
Search Controller
Hospital Model
http://www.sitepoint.com/full-text-search-rails-elasticsearch/
Does this achieve the purpose we laid out for it at the beginning?
What if I add this additional functionality...
def self.search(query)
__elasticsearch__.search(
{
query: {
multi_match: {
query: name,
fields: ['name^10', 'name']
}
},
highlight: {
pre_tags: ['<em>'],
post_tags: ['</em>'],
fields: {
name: {},
hospital: {}
}
}
}
)
end
wsankey@gmail.com; @wsankey; willsankey.com