This file contains hidden or 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 CreateTerms < ActiveGroonga::Migration | |
def up | |
create_table(:terms, :type => :patricia_trie, :key_type => "ShortText", :key_normalize => true, :default_tokenizer => "TokenMecab") do |table| | |
table.index("articles.body", :with_section => true, :with_weight => true, :with_position => true) | |
table.timestamps | |
end | |
end | |
def down | |
remove_table(:terms) |
This file contains hidden or 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
# coding: utf-8 | |
require 'pp' | |
require 'pathname' | |
require 'open-uri' | |
require 'nokogiri' | |
require 'active_groonga' | |
require 'baby_erubis' | |
current_dir = Pathname(__dir__).expand_path | |
ORIGIN_URI = URI('http://sinap.jp') |
This file contains hidden or 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
# coding: utf-8 | |
require 'pp' | |
require 'logger' | |
require 'pathname' | |
require 'open-uri' | |
require 'nokogiri' | |
require 'groonga' | |
current_dir = Pathname(__dir__).expand_path | |
ORIGIN_URI = URI('http://ji-sedai.jp') |
This file contains hidden or 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
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: droonga-engine | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Droonga engine is a core component in Droonga system | |
### END INIT INFO |
This file contains hidden or 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
<!doctype html> | |
<style> | |
.keyword { | |
font-weight: bold; | |
color: red; | |
} | |
</style> | |
<h1></h1> | |
<div></div> | |
<script> |
This file contains hidden or 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
[Unit] | |
Description=Droonga HTTP Server | |
Wants=droonga-engine.service | |
[Service] | |
User=droonga-http-server | |
ExecStart=/usr/bin/droonga-http-server --cache-size=-1 | |
ExecStop=/bin/kill -TERM $MAINPID | |
Restart=on-failure | |
WorkingDirectory=/home/droonga-http-server/droonga |
This file contains hidden or 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
# DigitalOcean CentOS 7 | |
DROONGA_GID = 1000 | |
execute "curl https://raw.githubusercontent.com/droonga/droonga-engine/master/install.sh | bash" do | |
not_if "type droonga-engine" | |
end | |
execute "curl https://raw.githubusercontent.com/droonga/droonga-http-server/master/install.sh | bash" do | |
not_if "type droonga-http-server" | |
end |
This file contains hidden or 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
vagrant@epub-searcher-demo:~$ sudo -udroonga-http-server bash -c 'cd /home/droonga-http-server/droonga && droonga-http-server --daemon --pid-file=/var/run/droonga-http-server/droonga-http-server.pid --system-log-level=trace --droonga-engine-port=10031' |
This file contains hidden or 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
作成したばかりのインスタンスにて。 | |
Nginx worker(nobody)から再オープンできないように見える。 | |
と言うか実際、sudo service nginx reopen_logsやったら(/etc/logrotate.d/nginxがやってる)、 | |
access.logが空になった後ログが書き込まれない。 | |
/data/conf/nginx.confではuser nobody;となっているけど、Amazon LinuxのリポジトリーかられたばかりのNginxバッケージではこの行はコメントアウトされている。 | |
コメントインしたけどログディレクトリーやファイルのパーミッション調整がされていなかったということなのだろうか。 | |
$ ll /var/log/ | |
合計 196 |
This file contains hidden or 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
package main | |
import ( | |
"os" | |
"net/url" | |
"net/http" | |
"io/ioutil" | |
"encoding/json" | |
"fmt" | |
) |