rails generate controller search
get 'search' => 'search#search', :as => :search
#!/bin/sh | |
# clear old pipe and lock | |
rmdir worklock 2>/dev/null | |
rm work | |
if [[ ! -p work ]]; then | |
mkfifo work | |
else | |
dd if=work of=/dev/null |
# rails generate migration add_indexed_at_to_searchable_models | |
class AddIndexedAtToSearchableModels | |
TABLES = [ :articles, :authors, :comments ] | |
def self.up | |
TABLES.each do |name| | |
change_table(name) do |t| | |
t.integer :indexed_at | |
end |
# create an index with some state (in this case, a mapping) | |
curl -X POST localhost:9200/test-original -d '{"mappings":{"wine":{"properties":{"designation":{"type":"string"},"full_name":{"type":"string"},"winery":{"type":"string"},"style":{"index":"no","type":"string"},"vintage":{"index":"no","type":"string"},"restaurant_ids":{"index":"no","type":"string"},"appellation":{"type":"string"},"vineyard_name":{"type":"string"},"variety_id":{"index":"no","type":"string"},"country":{"type":"string"}}}}}' | |
# => {"ok":true,"acknowledged":true} | |
# verify the mapping | |
curl localhost:9200/test-original/_mapping | |
# => {"test-original":{"wine":{"properties":{"appellation":{"type":"string"},"country":{"type":"string"},"designation":{"type":"string"},"full_name":{"type":"string"},"restaurant_ids":{"type":"string","index":"no"},"style":{"type":"string","index":"no"},"variety_id":{"type":"string","index":"no"},"vineyard_name":{"type":"string"},"vintage":{"type":"string","index":"no"},"winery":{"type":"string"}}}}} | |
# copy the inde |
require 'openssl' | |
class RSolrWithWebsolrAuth | |
attr_reader :secret | |
def initialize(secret) | |
@secret = secret | |
end |
class Tattoo | |
searchable do | |
text :title | |
text :description | |
text :studio | |
text :body_location | |
string :body_location do | |
body_location.split(/ /) |
check process foobar with pidfile /var/run/foobar.pid | |
start program = "/sbin/start foobar" | |
stop program = "/sbin/stop foobar" | |
if mem usage > 2% | |
for 2 cycles | |
then restart | |
if failed host 127.0.0.1 port 8000 protocol HTTP |
{ | |
"filter": { | |
"and": [ | |
{ "filter": "1" }, | |
{ | |
"or": [ | |
{ "filter": 2 }, | |
{ "filter": 3 }, | |
{ "filter": 4 } | |
] |
--- Drupal_Apache_Solr_Service.php.bak 2013-03-13 15:50:28.000000000 -0700 | |
+++ Drupal_Apache_Solr_Service.php 2013-03-13 14:19:54.000000000 -0700 | |
@@ -78,7 +78,7 @@ | |
const SEARCH_SERVLET = 'select'; | |
const LUKE_SERVLET = 'admin/luke'; | |
const SYSTEM_SERVLET = 'admin/system'; | |
- const STATS_SERVLET = 'admin/stats.jsp'; | |
+ #const STATS_SERVLET = 'admin/stats.jsp'; | |
/** |
Hello everyone,
Good news! After seven months of a widely adopted pre-release, Sunspot 2.0.0.pre has just been released as Sunspot 2.0.
Successfully built RubyGem
Name: sunspot
Version: 2.0.0
File: sunspot-2.0.0.gem