Más contenido relacionado
La actualidad más candente (20)
Similar a AlfrescoとSolr(中編) (20)
Más de Ashitaba YOSHIOKA (18)
AlfrescoとSolr(中編)
- 3. 自己紹介
‣ mryoshio
→ A社の社員
→ AlfrescoやLiferayのコンサルタント
→ ソースコードを読んだりカスタマイズしたり
→ Twitterとか色々なところにいます
→ Solr/Lucene周りで遊びたいけど時間とれてない
→ GAE使って作りたいものあるけど(ry
- 5. Alfrescoとは
‣ 何?
→ 英Alfresco社が提供するオープンソースソフトウェア。企業規模のコンテンツ
管理を行える。それ以外に,Webコンテンツ管理やコラボレーションを低コ
ストで行える
‣ 似た機能をもつ製品は?
→ SharePoint(コラボレーション),Documentum(コンテンツ管理)あた
りが該当する。DM,WCM,Shareにより異なる種類の製品に該当
‣ 特徴は?
→ Community版 (無償)とEnterprise版(有償)が存在
→ 多くのインターフェース(e.g. DM,Share,WCM)が存在
- 6. Solrとは
‣ エンタープライズ検索プラットフォーム
→ Apache Luceneプロジェクトから派生した人気のある検索プラット
フォーム。ヒット部分のハイライト,ファセットサーチなど豊富な機
能がある。スケーラブルで分散した検索やインデクスレプリケーショ
ンも可能
‣ スタンドアロンの全文検索サーバ
→ Tomcatなどサーブレットコンテナ上で動作する。Luceneを検索ラ
イブラリとして使用し,インデクスを用いた全文検索を行う。REST
ライクなHTTPベースのXMLやJSONインターフェースを持ち,プロ
グラマブルにドキュメントの操作を行える
http://lucene.apache.org/solr/
- 7. Alfresco Solr Plugin
‣ 内包LuceneでなくでなくSolrで検索を行う
‣ Alfrescoクラスタリングを行う場合,
検索インデクスのレプリケーションが不要
‣ 基本的に外部のSolrインスタンスへ
HTTPベースで問い合わせを行う
- 8. メリット,デメリット
‣ メリット
→ 前頁を参照
‣ デメリット
→ WCMを使えない
→ RMモジュールを使えない
→ マルチテナントを使えない
→ トランザクション内でのインデクシングなど
一貫性を重視する場合には使えない
※ http://wiki.alfresco.com/wiki/Alfresco_And_SOLR
- 14. Alfrescoのインストール
‣ 過去の勉強会資料を参照
→ http://www.slideshare.net/mryoshio/alfresco-install
‣ alfresco-community-4.0.e.zipをダウンロード
→ https://wiki.alfresco.com/wiki/Community_file_list_4.0.e
- 15. SolrおよびSolr Pluginのインストール
‣ 過去の勉強会資料を参照
→ http://www.slideshare.net/TasukuOtani/
alfrescostudy4alfresco4solrintegration
→ この資料では同じTomcatにAlfresco,Solrを載せている
‣ alfresco-community-solr-4.0.e.zipをダウン
ロード
→ https://wiki.alfresco.com/wiki/Community_file_list_4.0.e
- 16. 動作確認
‣ Alfresco Tomcatのlog4j.propertiesへ追記
→ log4j.logger.org.alfresco.repo.search.impl.solr.SolrQueryHTTPC
lient=debug
‣ Alfrescoを起動
→ ログイン後,検索を実行 => システムエラーの発生を確認
2012-10-24 15:39:48,522 ERROR [ui.common.Utils] [http-8080-4] システムエラーが発生したため、検索できませんでした: 09240004
org.alfresco.repo.search.impl.lucene.LuceneQueryParserException: 09240004
at org.alfresco.repo.search.impl.solr.SolrQueryHTTPClient.executeQuery(SolrQueryHTTPClient.java:364)
at org.alfresco.repo.search.impl.solr.SolrQueryLanguage.executeQuery(SolrQueryLanguage.java:49)
at org.alfresco.repo.search.impl.solr.SolrSearchService.query(SolrSearchService.java:348)
at org.alfresco.repo.search.SearcherComponent.query(SearcherComponent.java:78)
(中略)
at java.lang.Thread.run(Thread.java:680)
Caused by: java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
(後略)
- 17. 動作確認
‣ Solrを起動
→ 再度Alfrescoにて検索を実行 => catalina.outへログが出力される
2012-10-24 15:45:54,157 DEBUG [impl.solr.SolrQueryHTTPClient] [http-8080-3] Sent :/solr/alfresco/alfresco?q=%28%28+TYPE
%3A%22%7Bhttp%3A%2F%2Fwww.alfresco.org%2Fmodel%2Fcontent%2F1.0%7Dcontent%22++AND+%28%40%5C%7Bhttp
%5C%3A%2F%2Fwww.alfresco.org%2Fmodel%2Fcontent%2F1.0%5C%7Dname%3A%22simple%22++TEXT%3A%22simple
%22%29%29+%28+TYPE%3A%22%7Bhttp%3A%2F%2Fwww.alfresco.org%2Fmodel%2Fcontent%2F1.0%7Dfolder%22++AND+
%28%40%5C%7Bhttp%5C%3A%2F%2Fwww.alfresco.org%2Fmodel%2Fcontent%2F1.0%5C%7Dname%3A%22simple%22+
%29%29%29+AND+NOT+ASPECT%3A%22sys%3Ahidden%22+&wt=json&fl=*
%2Cscore&rows=500&df=TEXT&start=0&locale=ja_JP&fq=%7B%21afts%7DAUTHORITY_FILTER_FROM_JSON&fq=%7B%21afts
%7DTENANT_FILTER_FROM_JSON
2012-10-24 15:45:54,157 DEBUG [impl.solr.SolrQueryHTTPClient] [http-8080-3] with: {"textAttributes":[],"allAttributes":
[],"templates":[],"authorities":
["GROUP_ALFRESCO_ADMINISTRATORS","GROUP_EMAIL_CONTRIBUTORS","GROUP_EVERYONE","GROUP_site_admins","GROUP_
site_admins_SiteManager","GROUP_site_swsdp","GROUP_site_swsdp_SiteManager","ROLE_ADMINISTRATOR","ROLE_AUTHENTICA
TED","admin"],"tenants":[""],"query":"(( TYPE:"{http://www.alfresco.org/model/content/1.0}content" AND (@{http://
www.alfresco.org/model/content/1.0}name:"simple" TEXT:"simple")) ( TYPE:"{http://www.alfresco.org/model/content/1.0}
folder" AND (@{http://www.alfresco.org/model/content/1.0}name:"simple" ))) AND NOT ASPECT:"sys:hidden"
","locales":["ja_JP"],"defaultNamespace":"http://www.alfresco.org/model/content/
1.0","defaultFTSFieldOperator":"OR","defaultFTSOperator":"OR"}
2012-10-24 15:45:54,157 DEBUG [impl.solr.SolrQueryHTTPClient] [http-8080-3] Got: 6 in 904 ms
- 19. Alfresco Solr Plugin側
‣ solr-tomcat-context.xml
‣ solr.xml
‣ AlfrescoCoreAdminHandler
‣ CoreTracker
‣ CoreWatcherJob
‣ CoreTrackerJob
- 21. solr.xml
‣ ${SOLR_HOME}/solr.xml
‣ 前頁の ${TOMCAT_HOME}/conf/Catalina/
localhost/solr.xmlとは異なるもの
‣ Solrのマルチコア機能を使い複数のコアを設定
→ alfrescoコアのsolr.homeをworkspace-SpacesStoreディレクトリに,
archiveコアのsolr.homeをarchive-SpacesStoreディレクトリに設定
<?xml version="1.0" encoding="UTF-8" ?>
<solr persistent="true" sharedLib="lib" >
<cores adminPath="/admin/cores" adminHandler="org.alfresco.solr.AlfrescoCoreAdminHandler">
<core name="alfresco" instanceDir="workspace-SpacesStore" />
<core name="archive" instanceDir="archive-SpacesStore" />
</cores>
</solr>
- 22. AlfrescoCoreAdminHandler
‣ マルチコアのハンドリングを行う
→ CoreAdminHandlerを継承
→ coreを指定したactionリクエストを処理
→ handleCustomActionが実際のロジック
→ 重要なメソッド
AlfrescoCoreAdminHandler ... CoreWatcherJobのスケジューリング
http://localhost:8080/solr/admin/cores?core=alfresco&action=check
上記のアクセスを行った場合,下記の分岐に入る
151 if (a.equalsIgnoreCase("CHECK"))
152 {
- 23. CoreTracker
‣ インデクスのトラッキングを行う
→ CloseHookを継承
→ solrcore.propertiesから読み込んだcoreの情報を保持
(e.g. alfresco.host)
→ Jobのスケジューリング
→ Alfrescoへ接続するclientを保持
→ 重要なメソッド
L.267 CoreTracker
L.425 getRepoClient
L. 458 updateIndex
- 29. 情報を渡すWebScript
‣ Alfresco Solr PluginへAlfrescoの情報を渡す
→ webapps/alfresco/WEB-INF/classes/alfresco/templates/
webscripts/org/alfresco/repository/solr/に存在するWebScript群
aclChangeSets,acls,aclsReaders
model,modelsdiff
nodeContent,nodes,nodesMetaData、
transactions
- 31. 参考
‣ http://aegif-labo.blogspot.jp/2012/08/
solrssl.html
‣ http://wiki.alfresco.com/wiki/
Alfresco_And_SOLR
‣ http://docs.alfresco.com/4.0/index.jsp?topic=
%2Fcom.alfresco.enterprise.doc%2Fconcepts
%2Fsolr-webapp-config.html
Notas del editor
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- &#x30C8;&#x30E9;&#x30F3;&#x30B6;&#x30AF;&#x30B7;&#x30E7;&#x30F3;&#x5185;&#x3067;&#x306E;&#x30A4;&#x30F3;&#x30C7;&#x30AF;&#x30B7;&#x30F3;&#x30B0;~ ... WebScript&#x5185;&#x3067;&#x30B3;&#x30F3;&#x30C6;&#x30F3;&#x30C4;&#x3092;&#x4F5C;&#x308A;&#x3001;&#x305D;&#x306E;&#x76F4;&#x5F8C;&#x306B;&#x691C;&#x7D22;&#x3092;&#x884C;&#x3046;&#x7B49;&#x304C;&#x3067;&#x304D;&#x306A;&#x3044;\n
- \n
- \n
- \n
- \n
- \n
- \n
- &#x5B9F;&#x969B;&#x306B;&#x306F;&#x3053;&#x3053;&#x3067;Solr&#x672C;&#x4F53;&#x3082;&#x5165;&#x308C;&#x308B;&#x3053;&#x3068;&#x306B;&#x306A;&#x308B;&#x3002;\n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- 9&#x3064;\n
- \n
- \n
- \n