This file contains 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
### Keybase proof | |
I hereby claim: | |
* I am chadwpry on github. | |
* I am chadwpry (https://keybase.io/chadwpry) on keybase. | |
* I have a public key whose fingerprint is 05A5 F443 783B 48A8 63E5 A093 892E 2FA7 1A92 6B30 | |
To claim this, I am signing this object: |
This file contains 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
@search = Ultrasphinx::Search.new(:query => @query) | |
@search.run | |
@search.results |
This file contains 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
$ rake ultrasphinx:configure | |
$ rake ultrasphinx:index | |
$ rake ultrasphinx:daemon:start | |
This file contains 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
$ rake solr:start |
This file contains 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
@criteria = params[:criteria] | |
if @criteria.size > 1 | |
@result = Page.multi_solr_search @criteria, :models => [Brand, Leader, Career, Release] | |
if @result.nil? | |
@result = "Sorry no results for your search." | |
end | |
else | |
@result = "Please refine your search using more specific keywords." | |
end | |
This file contains 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
class Story < ActiveRecord::Base | |
# FULLTEXT INDEXING | |
is_indexed :fields => [ | |
{:field => 'title', :sortable => true}, | |
:content, :teaser, :category_id | |
], | |
:include => [ | |
{:association_name => 'category', :field => 'name', :as => 'category_name'}, | |
{:association_name => 'category', :field => 'parent_id'} |
This file contains 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
class Story < ActiveRecord::Base | |
# FULLTEXT INDEXING | |
is_indexed :fields => [ | |
{:field => 'title', :sortable => true}, | |
:content, :teaser, :category_id | |
], | |
:include => [ | |
{:association_name => 'category', :field => 'name', :as => 'category_name'}, | |
{:association_name => 'category', :field => 'parent_id'} |
This file contains 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
class Story < ActiveRecord::Base | |
acts_as_solr :facets => [:notes], | |
:fields => [ | |
:name, :title, | |
:content, :display_name, :intro | |
] | |
end |
This file contains 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
class Admin::BaseController < ApplicationController | |
include AuthenticatedSystem | |
include SslRequirement | |
audit Affiliate, Category, Industry, Permission, Promotion | |
before_filter :login_required | |
before_filter :site_administrator? | |
This file contains 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
class User < ActiveRecord::Base | |
... | |
define_index do | |
indexes [:first_name, :last_name], :as => :name, :sortable => true | |
indexes :email, :sortable => true | |
has created_at, updated_at | |
end | |
OlderNewer