query: tag:search

Creating OpenSearch plugins for Firefox
を参考に、このブログの検索機能をOpenSearchプラグインに対応しました。

FirefoxやFlock、CaminoなどのMozilla系のブラウザの検索バーから、
サイト内を検索することができます。

posted by genki genki on Sun 2 Dec 2007 at 00:38 with 0 comments

acts_as_searchable
is one of the most useful plugins which's enabling us to add a fulltext search feature to our models/resources easily.

Unfortunately, it is lacking an interface to the features of searching by similarity provided by
HyperEstraier.

So I wrote some codes to add an interface to exploit it.
This is
acts_as_searchable_with_similarity.

How to use?

Here is an example.

app/models/article.rb

rails>>
class Article < ActiveRecord::Base
acts_as_searchable
end

Article.similarity_search(target_article, :limit => 5)
<<--

posted by genki genki on Thu 29 Nov 2007 at 23:37 with 0 comments

acts_as_searchable
は、
HyperEstraier
を使って簡単に全文検索を行うことができる、
非常に便利なRailsプラグインです。
しかし、HyperEstraierが提供する類似検索機能を使うインターフェイスが
用意されていないようだったので、類似検索機能を付け足しました。

オリジナルの
acts_as_searchable
に対する差分はこちらにあります。

使い方

まずは、オリジナルと同様に検索対象のモデルに
acts_as_searchableを書き加えます。
必要に応じて適切なオプションを指定してください。

app/models/article.rb

rails>>
class Article < ActiveRecord::Base
acts_as_searchable
<<--

あとは、以下のように類似検索を行うだけです。

rails>>
Article.similarity_search(target_article, :limit => 5)
<<--

ちなみに、このブログの類似記事表示機能でも使用しています。

MIT LICENSE
に基づいて、修正版を再配布します。

  1. このソフトウェアを誰でも無償で無制限に扱って良い。但し、著作権表示および本許諾表示を、ソフトウェアのすべての複製または重要な部分に記載しなければならない。
  2. 作者または著作権者は、ソフトウェアに関してなんら責任を負わない。

修正部分のコードもMIT LICENSEとします。

posted by genki genki on Thu 29 Nov 2007 at 23:08 with 0 comments
This article was migrated from http://rails.office.drecom.jp/takiuchi/archive/178

HyperEstraier
は、全文検索エンジンです。Ruby on Railsから利用する場合は、acts_as_searchableを利用すると、非常に簡単にWebサービスに検索機能を追加することができます。

今回は、HyperEstraierのP2P連携機能を使ってクラスタリングを行う手順を紹介します。

まず、クラスタリングを行う全てのPCに、
通常の手順でHyperEstraierをインストール
します。パッケージマネージャを使う事もできますが、今回はソースからインストールする事にします。

インストールが済んだら、HyperEstraierを初期化して起動します。以下では、/usr/local/hyperestraier以下に環境を構築しています。

shell-unix-generic>>

estmaster init /usr/local/hyperestraier

estmaster start -bg /usr/local/hyperestraier

<<--

起動したら、ポート1978にアクセスし、動いていることを確認します。
続いてWebインターフェイスからノード間のリンクを作成します(もちろん、あらかじめノードを作成しておく必要があります。)

リンクの作成は、ノード編集画面から行います。

例)
http://search-1.com:1978/master_ui?action=10&name=nodename

ノード編集画面の一番下のlist of linksに以下のように、「{{!}}」で区切って別なサーバのノードを登録します。

http://search-2.com:1978/node/nodename{{!}}label{{!}}1000

上記は、search-2.com上のnodenameというノードに対して、labelというラベルでリンクを作成しています。1000というのは信頼度で、検索結果の順位に影響します。1台目から2台目へのlinkの設定が済んだら、2台目から1台目に逆方向にリンクを張ります。

以上でクラスタリングは完了です。
実際に検索を行うときは、メタ検索のdepthを1以上に指定する必要があります。

This article was migrated from http://rails.office.drecom.jp/takiuchi/archive/178
posted by genki genki on Thu 22 Nov 2007 at 04:48 with 0 comments
Contents rssrss
Leading Smart TV App Development Companies | USA | 4 Way Technologies
Apple TV Developer | TVOS Development | USA | 4 Way Technologies
光ファイバーを二次元振動させて走査するAR用ディスプレイ
因果の取り違え
Value Transformer
Swift2's defer for CoffeeScript
mongodb-3.0からcreateIndexのdropDupsが無くなったらしい
mongodb-3.0以降のWiredTigerの設定を動的に変更する方法
一般楕円の高速生成アルゴリズムへの道標
farro mantecatoのレシピ
Tags
search
Comments rssrss
https://rootskitchen.bar/ https://rootskitchen.bar/: Finished a deadly evening session punting on crash... 04/18 12:17
https://www.oyeanuncios.com/profile/margueritecava https://www.oyeanuncios.com/profile/margueritecava: Hat jemand Tipps gegen die leichte Übelkeit in der... 04/17 23:02
https://athworldproperties.com/author/deangelonewhou/ https://athworldproperties.com/author/deangelonewhou/: Mein Stoffwechsel fühlt sich zum ersten Mal seit J... 04/17 23:00
https://hyperharmony.com/author-profile/shannaminifie/ https://hyperharmony.com/author-profile/shannaminifie/: Endlich ist dieses ständige „Food Noise“ im Kopf k... 04/17 22:49
https://rootskitchen.bar/ https://rootskitchen.bar/: Just wrapped up a cracking arvo session grinding c... 04/17 02:19
https://www.legnostyle.ru/catalog/mebel/spalni/sp-3.html https://www.legnostyle.ru/catalog/mebel/spalni/sp-3.html: Мебель из Германии славится на весь мир своими изы... 04/16 15:20
https://www.hampshireairfields.eu.com/ https://www.hampshireairfields.eu.com/: 优质xxx平台 提供高质量的成人娱乐内容。选择 有保障的平台 以获得安全且愉快的观看体验。 04/16 13:16
https://slon8.at-slon6.cc https://slon8.at-slon6.cc: Superb, what a webpage it is! This weblog presents... 04/15 21:27