{"action":"created","issue":{"url":"https://api.github.com/repos/calagator/calagator/issues/190","labels_url":"https://api.github.com/repos/calagator/calagator/issues/190/labels{/name}","comments_url":"https://api.github.com/repos/calagator/calagator/issues/190/comments","events_url":"https://api.github.com/repos/calagator/calagator/issues/190/events","html_url":"https://github.com/calagator/calagator/issues/190","id":39919541,"number":190,"title":"Search for sub-terms / partial words","user":{"login":"donpdonp","id":13176,"avatar_url":"https://avatars.githubusercontent.com/u/13176?v=3","gravatar_id":"","url":"https://api.github.com/users/donpdonp","html_url":"https://github.com/donpdonp","followers_url":"https://api.github.com/users/donpdonp/followers","following_url":"https://api.github.com/users/donpdonp/following{/other_user}","gists_url":"https://api.github.com/users/donpdonp/gists{/gist_id}","starred_url":"https://api.github.com/users/donpdonp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/donpdonp/subscriptions","organizations_url":"https://api.github.com/users/donpdonp/orgs","repos_url":"https://api.github.com/users/donpdonp/repos","events_url":"https://api.github.com/users/donpdonp/events{/privacy}","received_events_url":"https://api.github.com/users/donpdonp/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/calagator/calagator/labels/feature","name":"feature","color":"bfe5bf"},{"url":"https://api.github.com/repos/calagator/calagator/labels/search","name":"search","color":"d4c5f9"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2014-08-10T23:28:31Z","updated_at":"2015-03-22T23:26:54Z","closed_at":null,"body":"The lucerne search terms by default are whole-word matches. It would be useful if a search matches partial words.\r\n\r\nbased on the lucerne search syntax, \r\nhttp://lucene.apache.org/core/2_9_4/queryparsersyntax.html\r\n\r\nadding ~ to each search term allows for partial matches. If the search box is to support phrases using quotes 'red \"golf cart\"', then adding a ~ to each term gets complex. \r\n\r\na simple start to this looks like\r\n<pre>\r\n+++ b/app/models/event/search.rb\r\n@@ -29,7 +29,7 @@ class Event < ActiveRecord::Base\r\n       @events ||= if tag\r\n         Event.search_tag(tag, order: order, current: current)\r\n       else\r\n-        Event.search(query, order: order, skip_old: current)\r\n+        Event.search(solr_query, order: order, skip_old: current)\r\n       end\r\n     end\r\n \r\n@@ -43,6 +43,10 @@ class Event < ActiveRecord::Base\r\n \r\n     private\r\n \r\n+    def solr_query\r\n+      query + \"~\"\r\n+    end\r\n+\r\n     def validate!\r\n       unless %w(date name title venue score).include?(order) || order.blank?\r\n\r\n</pre>"},"comment":{"url":"https://api.github.com/repos/calagator/calagator/issues/comments/84732557","html_url":"https://github.com/calagator/calagator/issues/190#issuecomment-84732557","issue_url":"https://api.github.com/repos/calagator/calagator/issues/190","id":84732557,"user":{"login":"shawnacscott","id":1648967,"avatar_url":"https://avatars.githubusercontent.com/u/1648967?v=3","gravatar_id":"","url":"https://api.github.com/users/shawnacscott","html_url":"https://github.com/shawnacscott","followers_url":"https://api.github.com/users/shawnacscott/followers","following_url":"https://api.github.com/users/shawnacscott/following{/other_user}","gists_url":"https://api.github.com/users/shawnacscott/gists{/gist_id}","starred_url":"https://api.github.com/users/shawnacscott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shawnacscott/subscriptions","organizations_url":"https://api.github.com/users/shawnacscott/orgs","repos_url":"https://api.github.com/users/shawnacscott/repos","events_url":"https://api.github.com/users/shawnacscott/events{/privacy}","received_events_url":"https://api.github.com/users/shawnacscott/received_events","type":"User","site_admin":false},"created_at":"2015-03-22T23:26:54Z","updated_at":"2015-03-22T23:26:54Z","body":"reference #182, #146 "}}