<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
		xmlns:xhtml="http://www.w3.org/1999/xhtml"
>

<channel>
	<title>本質思考道場 &#187; CSE</title>
	<atom:link href="http://takamorry.com/tag/cse/feed" rel="self" type="application/rss+xml" />
	<link>http://takamorry.com</link>
	<description>モノゴトの本質を考え抜くことを怠っていないか? ブログを書き発信して情報交流することで、逞しい本質思考能力を磨く道場!!</description>
	<lastBuildDate>Thu, 29 Jul 2010 11:33:57 +0000</lastBuildDate>
	<language>#</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
<image>
  <link>http://takamorry.com</link>
  <url>http://takamorry.com//image/favicon.ico</url>
  <title>本質思考道場</title>
</image>
<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://takamorry.com/tag/cse/feed" />
		<item>
		<title>Google Custom Searchで検索するWordPressプラグイン</title>
		<link>http://takamorry.com/article/20090118cse.html</link>
		<comments>http://takamorry.com/article/20090118cse.html#comments</comments>
		<pubDate>Mon, 19 Jan 2009 13:19:55 +0000</pubDate>
		<dc:creator>Takamorry</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[CSE]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[プラグイン]]></category>

		<guid isPermaLink="false">http://takamorry.com/article/20090118cse.html</guid>
		<description><![CDATA[WordPressの検索結果はイマイチだと思っていませんか？標準だと単語が含まれるエントリーが新しいもの順に並んでいるだけですからね。。。
Googleカスタムサーチエンジン(Google CSE)で検索するためのプラグ [...]]]></description>
			<content:encoded><![CDATA[<p>WordPressの検索結果はイマイチだと思っていませんか？標準だと単語が含まれるエントリーが新しいもの順に並んでいるだけですからね。。。</p>
<p>Googleカスタムサーチエンジン(Google CSE)で検索するためのプラグインがありました。これで、通常のGoogle検索のように、かつ自分のブログエントリーのみを検索出来るようになります。</p>
<p><a rel="lightview" href="http://takamorry.com/image/GoogleCustomSearchWordPress_13275/image0f78eb3176124b189cf1947b1db3ff0a.png"><img style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" title="image" src="http://takamorry.com/image/GoogleCustomSearchWordPress_13275/image_thumb49b64c371e3244e699c6096edeb091ae.png" border="0" alt="image" width="304" height="199" /></a><br />
↑Google CSEが簡単に組み込める。</p>
<h4>１．インストール</h4>
<p>プラグインはこちらから。<br />
<a href="http://aleembawany.com/projects/wordpress/google-custom-search-plugin/">■Google Custom Search Plugin for WordPress &#8211; Aleem Bawany</a> <a href="http://b.hatena.ne.jp/entry/http://aleembawany.com/projects/wordpress/google-custom-search-plugin/"><img src="http://bbeta.hatena.ne.jp/entry/image/http://aleembawany.com/projects/wordpress/google-custom-search-plugin/" alt="" /> </a></p>
<p>それと、ご自分のブログ専用の検索エンジンを作ります。こちらから。ブログだけじゃなく、一般のサイトにも有効です。<br />
<a href="http://www.google.co.jp/coop/cse/">■Google カスタム検索エンジン &#8211; サイト検索</a> <a href="http://b.hatena.ne.jp/entry/http://www.google.co.jp/coop/cse/"><img src="http://bbeta.hatena.ne.jp/entry/image/http://www.google.co.jp/coop/cse/" alt="" /> </a></p>
<h4>２．設定</h4>
<p>Google CSEのコントロールパネルから、「コード」タブを開き、こんな感じで設定。「検索ボックスコード」をクリップボードにコピーして、WordPressのダッシュボード「設定：Google Search」に貼り付け。</p>
<p><a rel="lightview" href="http://takamorry.com/image/GoogleCustomSearchWordPress_13275/imagefa1a3f60d126405ca735218c101b899d.png"><img style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" title="image" src="http://takamorry.com/image/GoogleCustomSearchWordPress_13275/image_thumbe2ef3731e2844c4e91b73f021975d006.png" border="0" alt="image" width="404" height="419" /></a><br />
↑これを<br />
↓こっちに貼り付け。<br />
<a rel="lightview" href="http://takamorry.com/image/GoogleCustomSearchWordPress_13275/imagead9017a3f63746e58b1531751451c5a2.png"><img style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" title="image" src="http://takamorry.com/image/GoogleCustomSearchWordPress_13275/image_thumb426bb29580df438cb3d62f552f8ec35d.png" border="0" alt="image" width="404" height="357" /></a></p>
<p>出力結果のコードも同様に貼り付けます。<br />
<a rel="lightview" href="http://takamorry.com/image/GoogleCustomSearchWordPress_13275/image36b1ff4e26c34062a5121fafb704be69.png"><img style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" title="image" src="http://takamorry.com/image/GoogleCustomSearchWordPress_13275/image_thumbefa720ffa637465a90d161d0a54f7d31.png" border="0" alt="image" width="404" height="200" /></a><br />
↑これを<br />
↓こっちに貼り付け。<br />
<a rel="lightview" href="http://takamorry.com/image/GoogleCustomSearchWordPress_13275/imagedec93e37c45846bbb611934b399af932.png"><img style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" title="image" src="http://takamorry.com/image/GoogleCustomSearchWordPress_13275/image_thumbc60b0e714d814d66b0159b89cbea7a76.png" border="0" alt="image" width="404" height="288" /></a></p>
<h4>３．出来上がり</h4>
<p>こんな風に、検索ボックスがGoogle CSEになりました。</p>
<p><a rel="lightview" href="http://takamorry.com/image/GoogleCustomSearchWordPress_13275/imagea1f77137644240a795b814eb9f30777e.png"><img style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" title="image" src="http://takamorry.com/image/GoogleCustomSearchWordPress_13275/image_thumb8eb64bdb3a7d4c228c246812399021d0.png" border="0" alt="image" width="246" height="152" /></a></p>
<p>検索してみるとこんな感じ。広告は出したくないですが、Google CSEの有料版じゃないとダメみたい。<br />
<a rel="lightview" href="http://takamorry.com/image/GoogleCustomSearchWordPress_13275/image27bfbeb7beb349489b64754e34106075.png"><img style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" title="image" src="http://takamorry.com/image/GoogleCustomSearchWordPress_13275/image_thumbb38a7b3dfe174c97bf1dd8352516c4cb.png" border="0" alt="image" width="404" height="200" /></a></p>
<h4>４．wp.Vicuna.Extの場合</h4>
<p>という便利なプラグインですが、私が使っているテーマ「wp.Vicuna.Ext」との相性が悪く、うまくフックしてくれません。そこで、直接phpをいじることにしました。</p>
<p>/themes/wp.vicuna.ext/script/widgets.phpのvicuna_widget_search()の入力formを丸ごと入れ替えてしまいます。cxパラメータはご自分のものにしてくださいね。</p>
<pre class="csharpcode">/**
 * Display a widget of search form.
 */
function vicuna_widget_search($args) {
    extract($args);
    $options = get_option('widget_search');
    $title = empty($options['title']) ? __('Search', 'vicuna') : $options['title'];
    echo $before_widget . $before_title . $title . $after_title;
?<span class="kwrd">&gt;</span>

<span class="kwrd">&lt;</span><span class="html">form</span> <span class="attr">action</span><span class="kwrd">="http://www.google.com/cse"</span> <span class="attr">id</span><span class="kwrd">="cse-search-box"</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;</span><span class="html">fieldset</span><span class="kwrd">&gt;</span>
  <span class="kwrd">&lt;</span><span class="html">div</span><span class="kwrd">&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">input</span> <span class="attr">type</span><span class="kwrd">="hidden"</span> <span class="attr">name</span><span class="kwrd">="cx"</span> <span class="attr">value</span><span class="kwrd">="013002905073341684501:z9ybagspxew"</span> <span class="kwrd">/&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">input</span> <span class="attr">type</span><span class="kwrd">="hidden"</span> <span class="attr">name</span><span class="kwrd">="ie"</span> <span class="attr">value</span><span class="kwrd">="UTF-8"</span> <span class="kwrd">/&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">input</span> <span class="attr">type</span><span class="kwrd">="text"</span> <span class="attr">name</span><span class="kwrd">="q"</span> <span class="attr">size</span><span class="kwrd">="18"</span> <span class="kwrd">/&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">input</span> <span class="attr">type</span><span class="kwrd">="submit"</span> <span class="attr">class</span><span class="kwrd">="submit"</span> <span class="attr">name</span><span class="kwrd">="sa"</span> <span class="attr">value</span><span class="kwrd">="検索"</span> <span class="kwrd">/&gt;</span>
  <span class="kwrd">&lt;/</span><span class="html">div</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">fieldset</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">form</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;</span><span class="html">script</span> <span class="attr">type</span><span class="kwrd">="text/javascript"</span> <span class="attr">src</span><span class="kwrd">="http://www.google.com/coop/cse/brand?form=cse-search-box&amp;lang=ja"</span><span class="kwrd">&gt;&lt;/</span><span class="html">script</span><span class="kwrd">&gt;</span>

<span class="kwrd">&lt;?</span>php
    echo $after_widget;
}</pre>
<h4>５．まとめ</h4>
<p>ブログに書き留めることって、自分にも役立つ情報が満載ですので、効率よく検索したいものです。Google CSEを使って便利なサイトになるといいですね。<br />
<!-- .csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; } --></p>
]]></content:encoded>
			<wfw:commentRss>http://takamorry.com/article/20090118cse.html/feed</wfw:commentRss>
		<slash:comments>15</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://takamorry.com/article/20090118cse.html" />
	</item>
		<item>
		<title>このブログの検索を「Google Custom Search」にしてみた</title>
		<link>http://takamorry.com/article/96741317.html</link>
		<comments>http://takamorry.com/article/96741317.html#comments</comments>
		<pubDate>Wed, 14 May 2008 14:46:09 +0000</pubDate>
		<dc:creator>Takamorry</dc:creator>
				<category><![CDATA[ブログ]]></category>
		<category><![CDATA[CSE]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[RSS]]></category>
		<category><![CDATA[ゴルゴ]]></category>

		<guid isPermaLink="false">http://takamorry.sakura.ne.jp/?p=176</guid>
		<description><![CDATA[Seesaaブログにもともと備え付けられているブログ内検索パーツは、Yahoo!のエンジンを内部的に使っていて、(Yahoo!にジャンプするのではなく)ブログサイト内に検索結果が表示される。しかし、精度が悪く遅いので気に [...]]]></description>
			<content:encoded><![CDATA[<p>Seesaaブログにもともと備え付けられているブログ内検索パーツは、Yahoo!のエンジンを内部的に使っていて、(Yahoo!にジャンプするのではなく)ブログサイト内に検索結果が表示される。しかし、精度が悪く遅いので気に入らなかった。<br />
昨年、日本語対応された「Google Custom Search(以下Google CSE)」にしようと思っていてやれていなかったのだが、idea*ideaでも作業ログが紹介されていたので、乗り移ることにした。</p>
<p><a href="http://www.google.com/coop/cse/" target="_blank" title="google">■Google Custom Search Engine &#8211; Site search and more</a><br />
<a href="http://japan.cnet.com/news/media/story/0,2000056023,20361504,00.htm?ref=rss" target="_blank" title="CNET Japan">■「Google Custom Search Engine」、全世界向けに拡大:ニュース &#8211; CNET Japan</a><br />
<a href="http://www.ideaxidea.com/archives/2008/05/google_custom_search_engine.html" target="_blank" title="idea*idea">■『Google Custom Search Engine』で百式ブログシリーズを横断検索できるウィジェットを作ってみた | IDEA*IDEA</a></p>
<p>Google精度で素早く検索してくれるので、超オススメ。作業のほとんどはidea*ideaのやり方通りだが、二つだけ本質思考道場ならではの工夫をしてみた。</p>
<p>１．検索結果ページのバナー<br />
検索結果の左上バナーをオリジナルにして、バナー画像から元のブログサイトに戻れるようにした。</p>
<p><a href="http://go-morry.up.seesaa.net/WindowsLiveWriter/GoogleCustomSearch_1455C/cse1_2.jpg"><img style="border: 0px" src="http://go-morry.up.seesaa.net/WindowsLiveWriter/GoogleCustomSearch_1455C/cse1_thumb.jpg" border="0" alt="cse1" width="404" height="264" /></a><br />
ちなみに、２つの画像(この場合は顔写真とGoogleロゴ)を合成するのは、Paint.NETというフリーソフトを使っている。フリーなのにレイヤーが使えて便利。こういうのはAdobe PhotoShopの得意技だけど、私にはこのフリーソフトで十分。<br />
<a href="http://www.getpaint.net/index.html" target="_blank" title="Paint.NET">■Paint.NET &#8211; Free Software for Digital Photo Editing</a><br />
画像の中で強調したい部分にスポットライトがあたっているように見せるのも簡単に加工できる。やり方は下を見てください。<br />
<a href="http://pamgau.net/item/488" target="_blank" title="PamGau">■スポットライトが当たったような画像をPaint.NETで作る : PamGau</a><br />
画像内容はどうでもよいが、元のブログサイトに戻りやすくしておくのは親切ですよね(自画自賛ww)。</p>
<p>２．検索フィルタを外す<br />
検索してみると、結果がいまいち。例えば「ゴルゴ」で検索するとこんな感じ。</p>
<p><a href="http://go-morry.up.seesaa.net/WindowsLiveWriter/GoogleCustomSearch_1455C/image_2.png"><img style="border: 0px" src="http://go-morry.up.seesaa.net/WindowsLiveWriter/GoogleCustomSearch_1455C/image_thumb.png" border="0" alt="image" width="404" height="341" /></a><br />
ゴルゴにまつわるエントリーは３つあるのだが、上位に出てこない。検索結果ページをめくっていくと、最後にこうなっている。<br />
<a href="http://go-morry.up.seesaa.net/WindowsLiveWriter/GoogleCustomSearch_1455C/image_4.png"><img style="border: 0px" src="http://go-morry.up.seesaa.net/WindowsLiveWriter/GoogleCustomSearch_1455C/image_thumb_1.png" border="0" alt="image" width="404" height="56" /></a><br />
これを最初から「検索結果をすべて表示する」には、getパラメータに「filter=0」を追加すればよい。よって、Google CSEのページでコピーしたHTMLコードにhiddenパラメータを加えて完成。formタグ一式はこんな感じ。</p>
<blockquote><p>&lt;form action=&quot;<a href="http://www.google.com/cse">http://www.google.com/cse&quot;</a> id=&quot;cse-search-box&quot;&gt;<br />
&nbsp; &lt;div&gt;<br />
&nbsp;&nbsp;&nbsp; &lt;input type=&quot;hidden&quot; name=&quot;cx&quot; value=&quot;003052090568057941289:nihsugwxb6o&quot; /&gt;<br />
&nbsp;&nbsp;&nbsp; <font color="#ff0000">&lt;input type=&quot;hidden&quot; name=&quot;filter&quot; value=&quot;0&quot; /&gt;</font><br />
&nbsp;&nbsp;&nbsp; &lt;input type=&quot;text&quot; name=&quot;q&quot; size=&quot;25&quot; /&gt;<br />
&nbsp;&nbsp;&nbsp; &lt;input type=&quot;submit&quot; name=&quot;sa&quot; value=&quot;検索&quot; /&gt;<br />
&nbsp; &lt;/div&gt;<br />
&lt;/form&gt;</p>
</blockquote>
<p>赤字の部分が追加した行。検索結果がイマイチ納得できない方はお試しください。私は思った通りに結果が出ました。<br />
<a href="http://go-morry.up.seesaa.net/WindowsLiveWriter/GoogleCustomSearch_1455C/image_6.png"><img style="border: 0px" src="http://go-morry.up.seesaa.net/WindowsLiveWriter/GoogleCustomSearch_1455C/image_thumb_2.png" border="0" alt="image" width="404" height="308" /></a><br />
一昔前なら、<a href="http://www.namazu.org/index.html.ja" target="_blank" title="namazu">Namazu</a>とかのCGIものをサーバ側に組み込んで、いちいち全文検索させて、なんてことをやっていましたが、便利な世の中になりました。<br />
ブログは<strong>「ブロガーの個性を最大限アウトプットしているサイト」</strong>だと思うので、自分の脳みそを素早く検索するためにも、ブログにはより良い検索エンジンを積んでおきたいですね。</p>
]]></content:encoded>
			<wfw:commentRss>http://takamorry.com/article/96741317.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://takamorry.com/article/96741317.html" />
	</item>
	</channel>
</rss>
