'solrconfig.xml'에 해당되는 글 1건

  1. 2012.04.25 [solr] solrconfig.xml 맛보기

[solr] solrconfig.xml 맛보기

Elastic/Elasticsearch 2012. 4. 25. 14:42

solr 자체에 대한 설정 파일을 안보고 왔었내요.
solrconfig.xml 파일이 뭐 하는 넘인지 보도록 하겠습니다.

원문은 아래 링크에 있습니다.
다만, solrconfig.xml 파일고 문서를 비교해 보니.. 좀 다르내요.. 
둘다 참고 하셔야 할 듯 합니다.
저는 기냥 solrconfig.xml 파일을 가지고 정리 합니다. ^^;

[solrconfig.xml]
- Solr 설정을 위한 대부분의 정보를 가지고 있다고 하는 군요.

solrconfig.xml is the file that contains most of the parameters for configuring Solr itself.

[lib directive]
- solr plugin 이나 jar 파일들을 loading 하기 위해 사용되는 directive 입니다.
- 아래 주석을 포함한 샘플 코드를 보시면 이해 하기 쉬우실 겁니다.
- 내용에 이런게 있내요, dir 에 매치 되는게 없으면 그냥 무시 하지만 path 로 정확하게 지정 했을 경우 없으면 에러가 난다는군요.

[dataDir directive]
- 절대경로, 상대경로에 주의 해서 사용을 하세요.
- 색인데이터가 위치하는 경로 입니다.

dataDir parameter

Used to specify an alternate directory to hold all index data other than the default ./data under the Solr home. If replication is in use, this should match the replication configuration. If this directory is not absolute, then it is relative to the current working directory of the servlet container.

<!-- Data Directory

       Used to specify an alternate directory to hold all index data
       other than the default ./data under the Solr home.  If
       replication is in use, this should match the replication
       configuration.
    -->
  <dataDir>${solr.data.dir:}</dataDir>

[luceneMatchVersion directive]
- solr 에서 사용하는 lucene 버전을 명시 합니다.

  <!-- Controls what version of Lucene various components of Solr
       adhere to.  Generally, you want to use the latest version to
       get all bug fixes and improvements. It is highly recommended
       that you fully re-index after changing this setting as it can
       affect both how text is indexed and queried.
  --> 

<luceneMatchVersion>LUCENE_40</luceneMatchVersion>

[directoryFactory directive]
- 이건 lucene 에서도 indexWriter 에서 사용하게 되는 내용과 같은 거라고 보시면 됩니다.
- 색인 파일에 대한 file system 이라고 이해 하시고, lucene 에서는 Direcotry Class 를 참고 하시면 됩니다.

<!-- The DirectoryFactory to use for indexes.

       
       solr.StandardDirectoryFactory, the default, is filesystem
       based and tries to pick the best implementation for the current
       JVM and platform.  One can force a particular implementation
       via solr.MMapDirectoryFactory, solr.NIOFSDirectoryFactory, or
       solr.SimpleFSDirectoryFactory.

       solr.RAMDirectoryFactory is memory based, not
       persistent, and doesn't work with replication.
    -->
  <directoryFactory name="DirectoryFactory" 
                    class="${solr.directoryFactory:solr.StandardDirectoryFactory}"/>

[indexConfig directive]
- 이 부분은 색인을 하기 위한 상세 설정을 하게 됩니다.
- 관련 지식이 부족 할 경우 접근하기 매우 어렵습니다. (저는 잘 하냐구요? 후덜덜;;;;)

[jmx directive]
http://wiki.apache.org/solr/SolrJmx

[updateHandler directive] - 어떤 조건하에 commit 수행을 하도록 설정을 합니다. - solr 에서 add/replace/commit/delete 그리고 query 에 의한 delete 시에 사용 되는 것 같습니다. - 주석에 나와 있는 링크 참고하세요.

[indexReaderFactory directive]
- lucene 의 indexReader 와 같은 역할을 하는 거라고 보시면 될 것 같습니다.

<!-- IndexReaderFactory

       Use the following format to specify a custom IndexReaderFactory,
       which allows for alternate IndexReader implementations.

       ** Experimental Feature **

       Please note - Using a custom IndexReaderFactory may prevent
       certain other features from working. The API to
       IndexReaderFactory may change without warning or may even be
       removed from future releases if the problems cannot be
       resolved.


       ** Features that may not work with custom IndexReaderFactory **

       The ReplicationHandler assumes a disk-resident index. Using a
       custom IndexReader implementation may cause incompatibility
       with ReplicationHandler and may cause replication to not work
       correctly. See SOLR-1366 for details.

    -->
  <!--
  <indexReaderFactory name="IndexReaderFactory" class="package.class">
    <str name="someArg">Some Value</str>
  </indexReaderFactory >
  -->
  <!-- By explicitly declaring the Factory, the termIndexDivisor can
       be specified.
    -->
  <!--
     <indexReaderFactory name="IndexReaderFactory" 
                         class="solr.StandardIndexReaderFactory">
       <int name="setTermIndexDivisor">12</int>
     </indexReaderFactory > 

-->

[query directive]
- cache 에 대한 설정과 indexSeacher 에 대한 action 을 설정 합니다.

[requestDispatcher directive]
- /select?qt=xxxx 에 대한 처리를 설정 합니다.
[requestParsers directive]
- solr 가 parsing 하기 위한 설정 또는 제한
[httpCaching directive]
- cache control 설정을 합니다.

[requestHandler & searchHandler directive]
- 이 넘들은 아래 주석에서 처럼 searchHandler 를 한번 보시고 보시면 이해가 쉽습니다.
- 말은 쉽습니다 했으나.. 겁나 어려운 영역 입니다.
- 이 설정을 어떻게 하느냐에 따라서 검색 결과가 막 영향을 받을 테니까요..

[searchComponent directive]
- 이 넘은 searchHandler 대신 사용하는가 봅니다.
- 그리고 requestHandler 랑 조합해서 사용을 하는 군요.
- 역시 이 부분도 설정이 매우 어렵습니다. ㅡ.ㅡ;;

[updateRequestProcessorChain directive]
- update request 에 대한 추가적인 처리가 필요 할때 뭔가 하는 것 같은데 직접 돌려봐야겠내요.

[queryReponseWriter directive]
- response format 을 지정 합니다.

[queryParser, valueSourceParse, transformer, admin directive]
- queryParser 와 valueSourceParse 의 경우는 검색 query 에 대해 처리 하기 위한 내용입니다.
- 아래 URL 참고 하시면 됩니다.


: