Title text to go here

Download Report

Transcript Title text to go here

WISENUT 세미나
목
차
1. 색인기의 이해
2. 언어분석 설정
3. 컬렉션 설정
4. lautil
5. 색인 배포
1. 색인기의 이해
1.1. 색인 프로세스
1.2. 색인기 아키텍쳐
1.3. 색인기 실행 옵션
1.4. 색인 디렉토리 구조
1. 색인기의 이해
1.1. 색인 프로세스
 색인은 SCD로부터 색인어를 추출하는 색인 단계와 임시 색인 파일을
취합하는 병합 단계로 나뉜다. 색인 단계에서는 멀티쓰레드 구조로 동작한다.
BRIDGE
STRUCTURED
CRAWL
DOCUMENT
SCD
PARSING
DICTIONARY
KMA
KEYWORD
EXTRACTION
DFS
WRITING
ASSORTED
INVERTED
INDEX
DOCUMENT
FILE
SYSTEM
MERGE
INVERTED
INDEX
 정적/동적색인
 요약문,정렬,필터링 등
4
1. 색인기의 이해
1.2. 색인기 아키텍쳐
 색인기는 SCD 분석, 색인어 추출, 원문 저장의 구조를 가지며, 추출된
색인어들은 최종 병합 과정을 통해 완벽한 역파일 구조를 가지게 된다.
 Merger
MERGER
 Keyword Extractor
MIDDLE GATHER
HASH TABLE
UDM
TABLE
TOKEN
KEYWORD
EXTRACTOR
L ANGUAGE
ANALAYSIS
FILE SYSTEM
LIKE
NGRAM
DFS MANAGER
KMA
REGULATOR
FILE SELECTOR
 Document File System
SCD PARSER
DFS DOCUMENT
DATE PARSER
 SCD 파일 분석
5
1. 색인기의 이해
1.3. 색인기 실행 옵션
 색인기는 라이선스, 설정, 컬렉션, 색인 모드 등을 설정할 수 있는 실행
옵션을 제공한다. 라이선스, 설정, 컬렉션, 색인 모드, 타겟은 색인기를
실행하기 위한 필수 요소이다.
INDEXER
-license
-conf
 라이선스 파일 지정
 설정 파일 지정
-mode
 색인모드 지정
 색인모드: static/dynamic/merge/dummy/lautil
-colid
 컬렉션 이름 지정
-target
 색인 타겟 지정
 dynamic인 경우에는 현재 타겟과 동일하게, 그외는 다른 타겟으로 지정
-log
 로그 파일 지정 (옵션)
 지정하지 않을 경우 “$SF1_HOME/log/indexer/idx-컬렉션명” 으로 설정
-threadno
-dfslog
 색인어 추출시 스레드 개수 설정
 스레드가 많을 경우 CPU 사용률이 높아짐
 DFS 저장 정보를 로그로 기록
 색인 배포를 사용할 경우 배포 서버의 색인기에서 필요한 옵션
6
1. 색인기의 이해
1.4. 색인 디렉토리 구조
 색인 디렉토리는 SCD, UDM, DFS, Static, Dynamic, History, Temporary
등으로 나뉜다
COLLECTION
udm/0
or 1
 DOCID를 내부적인 integer로 변환하기 위한 테이블
 Insert, Update, Delete시 문서의 존재여부 판단
dfs/0
or 1
 검색 결과의 요약문을 생성하기 위한 데이터 저장소
 정렬/필터링/그룹핑 등에 사용되는 필드 데이터 저장소
tmp
 최종 색인을 생성하기 위한 임시 저장소
 색인 병합 후 삭제
static/0
or 1
 정적 색인 후 최종 색인 저장소
dynamic/0
or 1
 동적 색인 후 최종 색인 저장소
history
scd/index
scd/error
scd/backup
 색인 기록을 위한 저장소
 index: 색인을 위한 SCD를 저장
 error: 색인 오류 발생시 해당 SCD를 저장 (cmanager 구동시)
 backup: SCD 보관
7
2. 언어분석 설정
2.1. 레귤레이터 설정
2.2. 언어분석기 설정
2. 언어분석 설정
2.1. 레귤레이터 설정 (1)
 레귤레이터란 필드 값을 특정 문자(구분자)로 분리/병합하는 규칙을 말한다.
<Regulation>
<Regulator id="R1" method="allow" value="#+"
<Regulator id="R2" method="divide" value="/"
<Regulator id="R3" method="unite" value="_"
</Regulation>
code="" />
code="0xAD50" />
code="" />
 method attribute
allow
default
value
set
divide
code
set
value
set
unite
code
set
value
set
code
set
 white space
 symbol
코리아_와이즈넛
코리아
와이즈넛
코리아_와이즈넛
코리아와이즈넛
9
2. 언어분석 설정
2.1. 레귤레이터 설정 (2)
 레귤레이터란 필드 값을 특정 문자(구분자)로 분리/병합하는 규칙을 말한다.
<Regulation>
<Regulator id="R1" method="allow" value="#+"
<Regulator id="R2" method="divide" value="/"
<Regulator id="R3" method="unite" value="_"
</Regulation>
code="" />
code="0xAD50" />
code="" />
교
 code attribute: 유니코드 값을 Hexa로 지정
range
0x00A1
value
0x00AA~0x00AF
value
0x00A1,0x00AA~0x00AF
 http://unicode.org
10
2. 언어분석 설정
2.2. 언어분석 설정 (1)
 언어분석이란 필드 값에 대해서 색인어를 추출하는 방식을 말한다.
언어분석의 입력은 레귤레이터에서 분리된 토큰이다.
<LAE>
<Analyzer language="korean">
<!-- Dictionary attribute: usepreanalysis : y/n (default: n) -->
<Dictionary path="/sf-1-hom/knowledge/korean" />
<Method id="kmaall1" analysis="all" option="" specialchar="#+" />
<Method id="kmaall2" analysis="all" option="" specialchar="" dictionary="/sf-1-home/knowledge/korean2" />
<Method id="kmanoun" analysis="noun" />
<Method id="token"
analysis="token" />
<Method id="bigram" analysis="bigram" />
<Method id="trigram" analysis="bigram" level="3" />
<Method id="matrix" analysis="matrix" begin="y" end="y" />
<Method id="like"
analysis="like" minlength="2" maxlength="6" maxno="256" />
<Method id="ranked" analysis="ranked" />
</Analyzer>
</LAE>
 analysis attribute
검색엔진은
all
원문
명사
검색
엔진
noun
명사
검색엔진은
검색
엔진
검색엔진은
11
2. 언어분석 설정
2.2. 언어분석 설정 (2)
 언어분석이란 필드 값에 대해서 색인어를 추출하는 방식을 말한다.
언어분석의 입력은 레귤레이터에서 분리된 토큰이다.
<LAE>
<Analyzer language="korean">
<!-- Dictionary attribute: usepreanalysis : y/n (default: n) -->
<Dictionary path="/sf-1-hom/knowledge/korean" />
<Method id="kmaall1" analysis="all" option="" specialchar="#+" />
<Method id="kmaall2" analysis="all" option="" specialchar="" dictionary="/sf-1-home/knowledge/korean2" />
<Method id="kmanoun" analysis="noun" />
<Method id="token"
analysis="token" />
<Method id="bigram" analysis="bigram" />
<Method id="trigram" analysis="bigram" level="3" />
<Method id="matrix" analysis="matrix" begin="y" end="y" />
<Method id="like"
analysis="like" minlength="2" maxlength="6" maxno="256" />
<Method id="ranked" analysis="ranked" />
</Analyzer>
</LAE>
 specialchar attribute: korean의 all, noun analysis만 해당
 specialchar에 설정된 기호를 기준으로 앞/뒤의 숫자/기호/영문자를 하나의 키워드로 추출
 specialchar에 설정된 기호를 레귤레이터 구분자에서 제거
specialchar
없음
c++프로그래밍
c
프로그래밍
specialchar
‘+’
c++프로그래밍
c
프로그래밍
c++
12
2. 언어분석 설정
2.2. 언어분석 설정 (3)
 언어분석이란 필드 값에 대해서 색인어를 추출하는 방식을 말한다.
언어분석의 입력은 레귤레이터에서 분리된 토큰이다.
<LAE>
<Analyzer language="korean">
<!-- Dictionary attribute: usepreanalysis : y/n (default: n) -->
<Dictionary path="/sf-1-hom/knowledge/korean" />
<Method id="kmaall1" analysis="all" option="" specialchar="#+" />
<Method id="kmaall2" analysis="all" option="" specialchar="" dictionary="/sf-1-home/knowledge/korean2" />
<Method id="kmanoun" analysis="noun" />
<Method id="token"
analysis="token" />
<Method id="bigram" analysis="bigram" />
<Method id="trigram" analysis="bigram" level="3" />
<Method id="matrix" analysis="matrix" begin="y" end="y" />
<Method id="like"
analysis="like" minlength="2" maxlength="6" maxno="256" />
<Method id="ranked" analysis="ranked" />
</Analyzer>
</LAE>
 dictionary attribute: all이나 noun에 기본 사전이 아닌 별도의 사전 디렉토리를 지정
 사전 디렉토리에는 usernoun.txt, stopword.txt, synonym.txt, restrict.txt가 필요
 Dictionary::usepreanalysis attribute: 기분석 사전을 사용. 색인 속도가 향상.
단, 사용자 사전의 내용이 제대로 반영되지 않을 수 있음
kmaall1
d:\sf-1\sf-1-v4.2\knowledge\korean
kmaall2
d:\sf-1\sf-1-v4.2\knowledge\korean2
13
2.2. 언어분석 설정 (4)
2. 언어분석 설정
 언어분석이란 필드 값에 대해서 색인어를 추출하는 방식을 말한다.
언어분석의 입력은 레귤레이터에서 분리된 토큰이다.
<LAE>
<Analyzer language="korean">
<!-- Dictionary attribute: usepreanalysis : y/n (default: n) -->
<Dictionary path="/sf-1-hom/knowledge/korean" />
<Method id="kmaall1" analysis="all" option="" specialchar="#+" />
<Method id="kmaall2" analysis="all" option="" specialchar="" dictionary="/sf-1-home/knowledge/korean2" />
<Method id="kmanoun" analysis="noun" />
<Method id="token"
analysis="token" />
<Method id="bigram" analysis="bigram" />
<Method id="trigram" analysis="bigram" level="3" />
<Method id="matrix" analysis="matrix" begin="y" end="y" />
<Method id="like"
analysis="like" minlength="2" maxlength="6" maxno="256" />
<Method id="ranked" analysis="ranked" />
</Analyzer>
</LAE>
 option attribute: 형태소분석시 세부 옵션을 설정
 C 옵션: 복합명사 분해와 관련된 옵션, 기본 C+
 C* 옵션 사용시 색인 크기가 증가하나, QueryAnalyzer를 사용하지 않을 경우 유용
“C+” option
기업검색엔진  기업, 검색, 엔진
“C*” Option
기업검색엔진  기업, 검색, 엔진, 기업검색, 기업검색엔진, 검색엔진
14
2.2. 언어분석 설정 (5)
2. 언어분석 설정
 언어분석이란 필드 값에 대해서 색인어를 추출하는 방식을 말한다.
언어분석의 입력은 레귤레이터에서 분리된 토큰이다.
<LAE>
<Analyzer language="korean">
<!-- Dictionary attribute: usepreanalysis : y/n (default: n) -->
<Dictionary path="/sf-1-hom/knowledge/korean" />
<Method id="kmaall1" analysis="all" option="" specialchar="#+" />
<Method id="kmaall2" analysis="all" option="" specialchar="" dictionary="/sf-1-home/knowledge/korean2" />
<Method id="kmanoun" analysis="noun" />
<Method id="token"
analysis="token" />
<Method id="bigram" analysis="bigram" />
<Method id="trigram" analysis="bigram" level="3" />
<Method id="matrix" analysis="matrix" begin="y" end="y" />
<Method id="like"
analysis="like" minlength="2" maxlength="6" maxno="256" />
<Method id="ranked" analysis="ranked" />
</Analyzer>
</LAE>
 option attribute: 형태소분석시 세부 옵션을 설정
 R 옵션: 형태소분석 후보군을 몇 개까지 선택할지 결정하는 옵션. 기본 R2
 R1 일 경우 색인 크기는 감소하나 검색 대상이 적어짐
“R2” option
대학생선교회  대학생, 선교회, 대학, 생선, 교회
“R+” Option
R2와 동일
“R1” Option
대학생선교회  대학생, 선교회
15
2.2. 언어분석 설정 (6)
2. 언어분석 설정
 언어분석이란 필드 값에 대해서 색인어를 추출하는 방식을 말한다.
언어분석의 입력은 레귤레이터에서 분리된 토큰이다.
<LAE>
<Analyzer language="korean">
<!-- Dictionary attribute: usepreanalysis : y/n (default: n) -->
<Dictionary path="/sf-1-hom/knowledge/korean" />
<Method id="kmaall1" analysis="all" option="" specialchar="#+" />
<Method id="kmaall2" analysis="all" option="" specialchar="" dictionary="/sf-1-home/knowledge/korean2" />
<Method id="kmanoun" analysis="noun" />
<Method id="token"
analysis="token" />
<Method id="bigram" analysis="bigram" />
<Method id="trigram" analysis="bigram" level="3" />
<Method id="matrix" analysis="matrix" begin="y" end="y" />
<Method id="like"
analysis="like" minlength="2" maxlength="6" maxno="256" />
<Method id="ranked" analysis="ranked" />
</Analyzer>
</LAE>
 option attribute: 형태소분석시 세부 옵션을 설정
 N 옵션: 숫자가 n개 이상인 경우에 색인어로 추출. 기본 N1
“N1” option
123 4 56  123, 4, 56
“N2” Option
123 4 45  123, 56
16
2.2. 언어분석 설정 (7)
2. 언어분석 설정
 언어분석이란 필드 값에 대해서 색인어를 추출하는 방식을 말한다.
언어분석의 입력은 레귤레이터에서 분리된 토큰이다.
<LAE>
<Analyzer language="korean">
<!-- Dictionary attribute: usepreanalysis : y/n (default: n) -->
<Dictionary path="/sf-1-hom/knowledge/korean" />
<Method id="kmaall1" analysis="all" option="" specialchar="#+" />
<Method id="kmaall2" analysis="all" option="" specialchar="" dictionary="/sf-1-home/knowledge/korean2" />
<Method id="kmanoun" analysis="noun" />
<Method id="token"
analysis="token" />
<Method id="bigram" analysis="bigram" />
<Method id="trigram" analysis="bigram" level="3" />
<Method id="matrix" analysis="matrix" begin="y" end="y" />
<Method id="like"
analysis="like" minlength="2" maxlength="6" maxno="256" />
<Method id="ranked" analysis="ranked" />
</Analyzer>
</LAE>
 option attribute: 형태소분석시 세부 옵션을 설정
 B 옵션: 단위성의존명사와 수사와의 결합 여부 옵션. 기본 B B+ 사용시 단위성의존명사에 대한 정확도는 높아지나, 숫자로만은 검색할 수 없음
“B+” option
230명  230명
“B-” Option
230명  230, 명
17
2.2. 언어분석 설정 (8)
2. 언어분석 설정
 언어분석이란 필드 값에 대해서 색인어를 추출하는 방식을 말한다.
언어분석의 입력은 레귤레이터에서 분리된 토큰이다.
<LAE>
<Analyzer language="korean">
<!-- Dictionary attribute: usepreanalysis : y/n (default: n) -->
<Dictionary path="/sf-1-hom/knowledge/korean" />
<Method id="kmaall1" analysis="all" option="" specialchar="#+" />
<Method id="kmaall2" analysis="all" option="" specialchar="" dictionary="/sf-1-home/knowledge/korean2" />
<Method id="kmanoun" analysis="noun" />
<Method id="token"
analysis="token" />
<Method id="bigram" analysis="bigram" />
<Method id="trigram" analysis="bigram" level="3" />
<Method id="matrix" analysis="matrix" begin="y" end="y" />
<Method id="like"
analysis="like" minlength="2" maxlength="6" maxno="256" />
<Method id="ranked" analysis="ranked" />
</Analyzer>
</LAE>
 option attribute: 형태소분석시 세부 옵션을 설정
 V 옵션: 동사에 대한 원형 색인 옵션
“V+” option
시원하다 시원해  시원하다, 시원해, 시원하
“V-” Option
시원하다 시원해  시원하다, 시원해
18
2.2. 언어분석 설정 (9)
2. 언어분석 설정
 언어분석이란 필드 값에 대해서 색인어를 추출하는 방식을 말한다.
언어분석의 입력은 레귤레이터에서 분리된 토큰이다.
<LAE>
<Analyzer language="korean">
<!-- Dictionary attribute: usepreanalysis : y/n (default: n) -->
<Dictionary path="/sf-1-hom/knowledge/korean" />
<Method id="kmaall1" analysis="all" option="" specialchar="#+" />
<Method id="kmaall2" analysis="all" option="" specialchar="" dictionary="/sf-1-home/knowledge/korean2" />
<Method id="kmanoun" analysis="noun" />
<Method id="token"
analysis="token" />
<Method id="bigram" analysis="bigram" />
<Method id="trigram" analysis="bigram" level="3" />
<Method id="matrix" analysis="matrix" begin="y" end="y" />
<Method id="like"
analysis="like" minlength="2" maxlength="6" maxno="256" />
<Method id="ranked" analysis="ranked" />
</Analyzer>
</LAE>
 option attribute: 형태소분석시 세부 옵션을 설정
 S 옵션: 영문자에 대한 스태밍 처리 옵션
“S+” option
unlimited unlimiting  ulimited, unlimiting, unlimit
“S-” Option
unlimited unlimiting  unlimited, unlimiting
19
2. 언어분석 설정
2.2. 언어분석 설정 (10)
 언어분석이란 필드 값에 대해서 색인어를 추출하는 방식을 말한다.
언어분석의 입력은 레귤레이터에서 분리된 토큰이다.
<LAE>
<Analyzer language="korean">
<!-- Dictionary attribute: usepreanalysis : y/n (default: n) -->
<Dictionary path="/sf-1-hom/knowledge/korean" />
<Method id="kmaall1" analysis="all" option="" specialchar="#+" />
<Method id="kmaall2" analysis="all" option="" specialchar="" dictionary="/sf-1-home/knowledge/korean2" />
<Method id="kmanoun" analysis="noun" />
<Method id="token"
analysis="token" />
<Method id="bigram" analysis="bigram" />
<Method id="trigram" analysis="bigram" level="3" />
<Method id="matrix" analysis="matrix" begin="y" end="y" />
<Method id="like"
analysis="like" minlength="2" maxlength="6" maxno="256" />
<Method id="ranked" analysis="ranked" />
</Analyzer>
</LAE>
 analysis attribute
token
검색엔진은
검색엔진은
20
2. 언어분석 설정
2.2. 언어분석 설정 (11)
 언어분석이란 필드 값에 대해서 색인어를 추출하는 방식을 말한다.
언어분석의 입력은 레귤레이터에서 분리된 토큰이다.
<LAE>
<Analyzer language="korean">
<!-- Dictionary attribute: usepreanalysis : y/n (default: n) -->
<Dictionary path="/sf-1-hom/knowledge/korean" />
<Method id="kmaall1" analysis="all" option="" specialchar="#+" />
<Method id="kmaall2" analysis="all" option="" specialchar="" dictionary="/sf-1-home/knowledge/korean2" />
<Method id="kmanoun" analysis="noun" />
<Method id="token"
analysis="token" />
<Method id="bigram" analysis="bigram" />
<Method id="trigram" analysis="bigram" level="3" />
<Method id="matrix" analysis="matrix" begin="y" end="y" />
<Method id="like"
analysis="like" minlength="2" maxlength="6" maxno="256" />
<Method id="ranked" analysis="ranked" />
</Analyzer>
</LAE>
 analysis attribute
검색엔진은
bigram
검색
색엔
엔진
검색엔진은
like
진은
검색
검색엔
색엔
엔진
색엔진
진은
엔진은
21
2. 언어분석 설정
2.2. 언어분석 설정 (12)
 언어분석이란 필드 값에 대해서 색인어를 추출하는 방식을 말한다.
언어분석의 입력은 레귤레이터에서 분리된 토큰이다.
<LAE>
<Analyzer language="korean">
<!-- Dictionary attribute: usepreanalysis : y/n (default: n) -->
<Dictionary path="/sf-1-hom/knowledge/korean" />
<Method id="kmaall1" analysis="all" option="" specialchar="#+" />
<Method id="kmaall2" analysis="all" option="" specialchar="" dictionary="/sf-1-home/knowledge/korean2" />
<Method id="kmanoun" analysis="noun" />
<Method id="token"
analysis="token" />
<Method id="bigram" analysis="bigram" />
<Method id="trigram" analysis="bigram" level="3" />
<Method id="matrix" analysis="matrix" begin="y" end="y" />
<Method id="like"
analysis="like" minlength="2" maxlength="6" maxno="256" />
<Method id="ranked" analysis="ranked" />
</Analyzer>
</LAE>
 analysis attribute
검색엔진은
matrix
검
검색
검색엔
검색엔진 검색엔진은
은
진은
엔진은
색엔진은 검색엔진은
ranked
검색/100 엔진/50
검색
엔진
 가중치는 필드별 랭킹에 합산
22
3. 컬렉션 설정
3.1. 컬렉션 전체 설정
3.2. 컬렉션 설정
3.3. 문서 필드 설정
3.4. 색인 필드 설정
3.5. 컬렉션 고급 설정
3. 컬렉션 설정
3.1. 컬렉션 전체 설정
 컬렉션 설정에는 문서 필드, 색인 필드, 색인 위치 등을 설정한다.
<Collection id="coll1" language="korean" charset="euc-kr" rank="basic_rank">
<Date format="none_time_t" />
<Index>
<Field name="DOCID"
<Field name="Title"
<Field name="BTitle"
<Field name="Content"
summarize="y" />
<Field name="Section"
</Index>
<BasePath
method="token"
method="kmaall1"
method="bigram"
method="kmanoun"
rankscore="1"
rankscore="100"
rankscore="100"
rankscore="30"
method="token"
prefix="a#" />
useoffset="n"
useoffset="y"
useoffset="y"
useoffset="n"
/>
refregulator="R1" />
refregulator="R1" docfield="Title" />
refregulator="R1" highlight="y"
path="/sf-1-home/collection/coll1/" />
<Document>
<Field name="DOCID"
<Field name="DATE"
<Field name="Title"
<Field name="Content"
<Field name="Section"
<Field name="Click"
<Field name="Price"
</Document>
</Collection>
type="varchar"
type="char"
type="varchar"
type="varchar"
type="char"
type="integer"
type="long"
maxlen="1" />
maxlen="20" />
maxlen="1" />
maxlen="1" displaylength="200" />
maxlen="20" />
maxlen="4" fastaccess="y" />
maxlen="8" fastaccess="y" />
24
3.2. 컬렉션 설정 (1)
3. 컬렉션 설정
 컬렉션 설정에는 문서 필드, 색인 필드, 색인 위치 등을 설정한다.
<Collection id="coll1" language="korean" charset="euc-kr" rank="basic_rank">
 Collection attribute
language
charset
rank
multikeyword_rank
proximity_rank
percent_rank
컬렉션의 언어를 설정. Ex) korean, japanese
컬렉션의 SCD 인코딩을 설정. Ex) euc-kr, cp949, utf-8, gb2312, shift-jis
컬렉션의 랭킹 방식을 설정. 기본값은 basic 랭킹의 “kprfmo”.
멀티키워드 랭킹요소를 활성화
인접도 랭킹요소를 활성화
랭킹을 백분율로 표시
25
3. 컬렉션 설정
3.2. 컬렉션 설정 (2)
 컬렉션 설정에는 문서 필드, 색인 필드, 색인 위치 등을 설정한다.
<Date format="none_time_t" />
 Date::formant attribute: 4가지 변환 타입을 지원.
 Document의 Date 필드에만 해당됨. Date 필드는 대소문자를 가리지 않음.
time_t
no convert
none_time_t
YYYY/MM/DD hh:mm:ss
unix time
utc_sec
no_date
current
unix time
1
26
3. 컬렉션 설정
3.2. 컬렉션 설정 (3)
 컬렉션 설정에는 문서 필드, 색인 필드, 색인 위치 등을 설정한다.
<BasePath
path="/sf-1-home/collection/coll1/" />
 색인 디렉토리 설정 element
BasePath
기본 디렉토리 설정. BasePath만 있는 경우 하위 설정은 BasePath를 기본으로 설정
SCDPath
SCD 파일 디렉토리 설정. 하위에는 index, error, backup 등 생성.
UDMPath
UDM 파일 디렉토리 설정. 하위에는 타겟 디렉토리 생성.
TempPath
색인을 생성하기 위한 임시 파일 디렉토리 설정.
DFSPath
원문저장 파일 디렉토리 설정. 하위에는 타겟 디렉토리 생성.
StaticPath
정적색인 파일 디렉토리 설정. 하위에는 타겟 디렉토리 생성.
DynamicPath
동적색인 파일 디렉토리 설정. 하위에는 타겟 디렉토리 생성.
TargetPath
타겟 파일 디렉토리 설정. 본 설정이 되어있는 경우에는 QP의 Target 설정보다 우선
27
3. 컬렉션 설정
3.3. 문서 필드 설정 (1)
 컬렉션 설정에는 문서 필드, 색인 필드, 색인 위치 등을 설정한다.
<Document>
<Field name="DOCID"
<Field name="DATE"
<Field name="Title"
<Field name="Content"
<Field name="Section"
<Field name="Click"
<Field name="Price"
</Document>
type="varchar"
type="char"
type="varchar"
type="varchar"
type="char"
type="integer"
type="long"
maxlen="1" />
maxlen="20" />
maxlen="1" />
maxlen="1" displaylength="200" />
maxlen="20" />
maxlen="4" fastaccess="y" />
maxlen="8" fastaccess="y" />
 Document::Field::type & maxlen attribute: 4가지 필드 타입을 지원.
정수 타입
integer  maxlen: 4
 필드값이 없는 경우 0값을 셋팅
long
 maxlen: 8
 필드값이 없는 경우 0값을 셋팅
텍스트 타입
char
varchar
 maxlen: 설정
 필드가 maxlen을 초과할 경우 maxlen으로 자름
 maxlen: 설정 무시
 필드 전체를 maxlen과 관계없이 저장
28
3. 컬렉션 설정
3.3. 문서 필드 설정 (2)
 컬렉션 설정에는 문서 필드, 색인 필드, 색인 위치 등을 설정한다.
<Document>
<Field name="DOCID"
<Field name="DATE"
<Field name="Title"
<Field name="Content"
<Field name="Section"
<Field name="Click"
<Field name="Price"
</Document>
type="varchar"
type="char"
type="varchar"
type="varchar"
type="char"
type="integer"
type="long"
maxlen="1" />
maxlen="20" />
maxlen="1" />
maxlen="1" displaylength="200" />
maxlen="20" />
maxlen="4" fastaccess="y" />
maxlen="8" fastaccess="y" />
 Document::Field::fastaccess attribute: 고속 데이터 인출을 위한 필드 데이터를 설정.
DFS
 Document::Field::displaylength attribute:
요약문의 길이
VPF
 Document::Field::summarylength attribute:
 원문을 압축하여 저장
요약전 원문을 자를 길이
 사이즈가 증가하면 순차적으로 파일이 생성
FXA
 전체 문서의 fastaccess가 설정된 필드 데이터를 순차적으로 저장
 fastaccess가 설정된 필드 개수만 큼 생성
29
3. 컬렉션 설정
3.3. 문서 필드 설정 (3)
 컬렉션 설정에는 문서 필드, 색인 필드, 색인 위치 등을 설정한다.
<Document>
<Field name="DOCID"
<Field name="DATE"
<Field name="Title"
<Field name="Content"
<Field name="Section"
<Field name="Click"
<Field name="Price"
</Document>
type="varchar"
type="char"
type="varchar"
type="varchar"
type="char"
type="integer"
type="long"
maxlen="1" />
maxlen="20" />
maxlen="1" />
maxlen="1" displaylength="200" />
maxlen="20" />
maxlen="4" fastaccess="y" />
maxlen="8" fastaccess="y" />
 Document::Field::compress attribute: 필드 데이터의 압축 여부를 설정.
type=“varchar”
기본 compress=“n” 기본 compress=“y”
type=“integer/long/char”
compress=“n”
integer
long
char
varchar
compress=“y”
 R-Type 적용 안됨
onlyindexfield=“y”
 R-Type이 아닐 경우 compress를
 색인전용 필드
y로 설정(특히 char)  디스크 공간 절약, I/O 감소
30
3. 컬렉션 설정
3.3. 문서 필드 설정 (4) – DFS 구조
 설정에 정의된 필드 데이터는 1) 고정길이, 2) 고정길이 이면서 압축, 3)
가변길이 순으로 버퍼에 저장되며, 2)과 3)에 해당하는 필드 전체를 압축하여
저장한다. 즉, 가변길이이면서 압축하지 않는 필드는 DFS내에 저장되지
않는다.
FIXED+NO COMPRESS
FIELD
FIXED+COMPRESS
FIELD
VARIABLE+COMPRESS
FIELD
 Buffer
FIXED+NO COMPRESS
FIELD
COMPRESSED
 Buffer
31
3. 컬렉션 설정
3.3. 문서 필드 설정 (5) – DFS 구조
 Fastaccess 파일은 문서의 순서를 유지하면서 고정길이 형태로 저장된다.
이는 고속으로 필드 값을 인출하기 위함이다.
VALUE
VALUE
VALUE
VALUE
VALUE
 File
VALUE
VALUE
VALUE
VALUE
VALUE
 File
32
3.3. 문서 필드 설정 (6) – DFS 파일
3. 색인기 아키텍쳐
 DFS 파일의 구성은 아래와 같다. “0000”은 여러 파일로 분리될 수 있음을
의미한다.
dfs0000.vpf
문서의 전체 필드 데이터
dfs.0000.5.fxa
5번째 필드에 대한 fastaccess 파일
dfs.0000.6.fxa
6번째 필드에 대한 fastaccess 파일
dfs.0000.7.fxa
7번째 필드에 대한 fastaccess 파일
(전체 필드가 6개인 경우 날짜)
dfs.0000.7.fxa
8번째 필드에 대한 fastaccess 파일
(전체 필드가 6개인 경우 문서의 길이)
dfsinfo.info
vpf 파일에 대한 빈 공간 정보
test-0000.vpf.uid
문서에 대한 vpf 정보 (파일의 절대적 위치, 삭제여부 등)
33
3. 컬렉션 설정
3.4. 색인 필드 설정 (1)
 컬렉션 설정에는 문서 필드, 색인 필드, 색인 위치 등을 설정한다.
<Index>
<Field name="DOCID"
<Field name="Title"
<Field name="BTitle"
<Field name="Content"
summarize="y" />
<Field name="Section"
</Index>
method="token"
method="kmaall1"
method="bigram"
method="kmanoun"
rankscore="1"
rankscore="100"
rankscore="100"
rankscore="30"
method="token"
prefix="a#" />
useoffset="n"
useoffset="y"
useoffset="y"
useoffset="n"
/>
refregulator="R1" />
refregulator="R1" docfield="Title" />
refregulator="R1" highlight="y"
 Index::Field::useoffset attribute: 색인어 위치 정보의 저장 여부를 설정.
 EXACT, ORDERED, NEARBY 등의 연산식을 사용하거나, bigram 색인필드에는 “y”로 설정.
34
3. 컬렉션 설정
3.4. 색인 필드 설정 (2)
 컬렉션 설정에는 문서 필드, 색인 필드, 색인 위치 등을 설정한다.
<Index>
<Field name="DOCID"
<Field name="Title"
<Field name="BTitle"
<Field name="Content"
summarize="y" />
<Field name="Section"
</Index>
method="token"
method="kmaall1"
method="bigram"
method="kmanoun"
rankscore="1"
rankscore="100"
rankscore="100"
rankscore="30"
method="token"
prefix="a#" />
useoffset="n"
useoffset="y"
useoffset="y"
useoffset="n"
/>
refregulator="R1" />
refregulator="R1" docfield="Title" />
refregulator="R1" highlight="y"
 Index::Field::prefix attribute: PREFIX 필드 문자를 설정.
 일반 검색 필드의 개수(32개)의 제한을 극복하기 위한 필드
 검색기에서 언어분석이 지원되지 않음
prefix=“#a#”
코리아와이즈넛 #a#코리아와이즈넛
색인 진행 방향
prefix=“#a#”
역파일
#a#코리아와이즈넛코리아와이즈넛
검색 진행 방향
35
3. 컬렉션 설정
3.4. 색인 필드 설정 (3) – 색인 구조
 일반 검색 필드는 고유한 마스크(mask)값을 가지고 검색하며, prefix필드는
prefix문자를 색인어에 붙여서 검색한다.
일반 색인 필드
제목
문서
문서
문서
일반 색인 필드
내용
검색
“제목, 내용” 필드
검색
“내용” 필드
검색
Prefix 색인 필드
부서
연구소
000….0011
000….0010
일반 색인 필드
키워드
문서 검색 엔진
Bit AND
색인
#a#연구소
000….000
검색
000….0110
문서
000…0101
엔진
000…0100
36
3. 색인기 아키텍쳐
3.4. 색인 필드 설정 (4) – 색인 파일
 색인 파일의 구성은 아래와 같다. “0000”은 여러 파일로 분리될 수 있음을
의미하며, XXX는 임의로 붙는 문자열이다.
kidx.kmg.0
static 색인의 색인어 리스트
kidb.kmg.0
static 색인의 색인어별 문서 리스트 정보
del.uid.XXX
삭제된 문서 정보
dynamic.done
dynamic 색인의 세그먼트 정보
idb.dyn.XXX.0000
dynamic 색인의 색인어별 문서 리스트 정보 main
세그먼트
idb.seg.XXX
dynamic 색인의 색인어별 문서 리스트 정보 세그먼트
idx.key.XXX.0000
dynamic 색인의 색인어 리스트
idx.seg.XXX.0000
dynamic 색인의 세그먼트들에 대한 색인어 리스트
37
3. 컬렉션 설정
3.5. 고급 설정 (1)
 DFS 파일 및 색인어를 버퍼링할 사이즈를 설정한다.
<Document>
<PageSize value="8192"/>
<PageFile max="819200000"/>
<MiddleGathererSize value=“4194303” />
</Document>
 Document의 고급 설정
 파일 입출력 단위
 색인어 버퍼링 개수를 설정
MiddleGathererSize  4M개 배수로 설정
필드 분석
색인어 버퍼링
임시
역파일
PageSizePageFile
 파일을 분리할 사이즈
원문저장(DFS)
VPF
#0VPF
#1VPF
#2
필드저장(FXA)
FXA
#0VPF
#1VPF
#2
38
3. 컬렉션 설정
3.5. 고급 설정 (2)
 SCD 파싱에 사용되는 버퍼 설정 및 색인 파일 접근 개수를 설정한다.
<Collection id="coll1" language="korean" charset="euc-kr" rank="basic_rank">
<MaxDocBufSize value="67108864" />
<MaxDocQueueSize value="10000" />
<MaxFileHandleNum value="1" />
</Collection>
 Document의 고급설정
MaxDocBufSize
MaxDocQueueSize
SCD 분석
 문서의 버퍼링 메모리와
개수를 설정
MaxFileHandleNum
DFS
DFS
DFS
DFS
KE
IndexManager
IndexManager
역파일
 파일에 접근할 수 있는
핸들러 개수 확장
 시스템의 리소스 파악 필요
문서버퍼링
39
3. 컬렉션 설정
3.5. 고급 설정 (3)
 동적 색인의 세그먼트 개수를 설정한다.
<Collection id="coll1" language="korean" charset="euc-kr" rank="basic_rank">
<DynSegNum value=“1" />
</Collection>
 DynSegNum element: 동적 색인의 세그먼트 파일의 개수를 설정.
동적색인 세그먼트
DynSegNum
메인 세그먼트세그먼트 abj 세그먼트 2kb
40
4. lautil
4.1. lautil
4. lautil
4.1. LAUTIL (1)
 lautil은 특정 필드 값에 대한 색인/질의 분석 정보를 테스트할 수 있는 보조
도구이다.
indexer.exe -license license.xml -conf ..\config\config-test.xml -mode lautil
Search Formula-1 indexer v4.5.0 (Build 0002 - Debug), Nov 11 2009 13:44:57
Copyright 2001-2009 WISEnut, Inc. All Rights Reserved.
License check succeeded.
Search Formula-1 LA Utility v4.5.0 (Build 0002 - Debug), Nov 11 2009 13:44:57
Copyright 2001-2009 WISEnut, Inc. All Rights Reserved.
initialize la factory…done
lautil MEMU:
help
collection
information
output
input
file
quit
-
print this memu
select collection and index field
print selected collection and index field
select output stream (default: stdout)
analysis text from standard input
analysis text from file
42
4. lautil
4.1. LAUTIL (2)
 lautil은 특정 필드 값에 대한 색인/질의 분석 정보를 테스트할 수 있는 보조
도구이다.
help
도움말
collection
컬렉션 및 대상 분석 필드 설정
information
현재 설정된 정보(컬렉션, 분석필드) 표시
output
출력 방식 설정 (stdout or file)
input
콘솔 입력 테스트
file
파일 입력
quit
프로그램 종료
43
4. lautil
4.3. LAUTIL (3)
 lautil은 특정 필드 값에 대한 색인/질의 분석 정보를 테스트할 수 있는 보조
도구이다.
lautil> col
AVAILABLE COLLECTION SELECTIONS:
0.
test < language=
Specify collection (enter its number): 0
selecting test collection
korean, charset=
euc-kr >
AVAILABLE INDEX FIELD SELECTIONS:
0.
DOCID < method=
token, refregulator=
1.
Title < method=
kmaall1, refregulator=
2.
Content < method=
kmanoun, refregulator=
3.
Section < method=
kmaall1, refregulator=
Specify index field (enter its number): 1
selecting Title index field
lautil MEMU:
help
collection
information
output
input
file
quit
-
,
R4,R5,
R1,
,
prefix=
prefix=
prefix=
prefix=
>
>
>
>
print this memu
select collection and index field
print selected collection and index field
select output stream (default: stdout)
analysis text from standard input
analysis text from file
lautil> inp
input('quit' for quit)> 검색엔진은
* input sentence ---------------------------------------검색엔진은
* regulation tokens ------------------------------------[검색엔진은]
* index keywords ---------------------------------------[검색][엔진][검색엔진은]
* query keywords ---------------------------------------검색엔진은: (검색 엔진)
---------------------------------------------------------
44
5. 색인 배포
5.1. 색인 배포 개념
5.2. 색인 배포 구성의 예
5.3. 배포기 설정
5.4. 배포기 사용시 주의 사항
5. 색인 배포
5.1. 색인 배포 개념
 색인 배포는 동일한 컬렉션을 여러 서버에서 운영하고자 할 경우에 사용된다.
ISC
DISTRIBUTOR
CLIENT
DISTRIBUTOR
SERVER
BRIDGE
INDEXER
 변경된 부분 적용
INDEX
 DFS, 색인 파일 배포
 동적 색인시 변경된 파일만 배포
INDEX
 static/dynamic
색인
46
5. 색인 배포
5.2. 색인 배포 구성의 예
 색인 배포기를 사용하면 각기 다른 플랫폼하고 연동할 수 있다.
ISC
DISTRIBUTOR
CLIENT
INDEX
 HP
ISC
DISTRIBUTOR
CLIENT
INDEX
 Linux
ISC
DISTRIBUTOR
CLIENT
 Linux
ISC
INDEX
DISTRIBUTOR
CLIENT
INDEX
 Solaris
ISC
DISTRIBUTOR
CLIENT
INDEX
 Solaris
DISTRIBUTOR
SERVER
BRIDGE
INDEXER
INDEX
 Windows
47
5. 색인 배포
5.3. 배포기 설정 (1)
 색인 배포기 서버 설정은 클라이언트의 정보 및 컬렉션 별 배포될
클라이언트를 설정한다.
<?xml version="1.0" encoding="UTF-8"?>
<DistributorServer port="7045" concurrence="5">
<TargetClient>
<Client id="idx1" ip="192.168.0.1" port="6045"/>
<Client id="idx2" ip="192.168.0.2" port="6045"/>
<Client id="idx3" ip="192.168.0.3" port="6045"/>
</TargetClient>
<DistributorRule id="dist1" config="/sf-1-home/config/config.xml">
<Distribution colid="coll1,coll2" clientid="idx1,idx2"/>
<Distribution colid="coll3"
clientid="idx3"/>
</DistributorRule>
</DistributorServer>
 192.168.0.1
DISTRIBUTOR
CLIENT
INDEX
 192.168.0.2
DISTRIBUTOR
CLIENT
INDEX
 coll1, coll2  coll1, coll2
INDEX
 192.168.0.3
DISTRIBUTOR
CLIENT
INDEX
 coll3
DISTRIBUTOR
SERVER
48
5.3. 배포기 설정 (2)
5. 색인 배포
 색인 배포기 클라이언트 설정은 서버에서 전송 받을 컬렉션을 정의한다.
<?xml version="1.0" encoding="UTF-8"?>
<DistributorClient port="6045">
<Distribution colid="coll1,coll2" config="/sf-1-home/config/config.xml"/>
<Distribution colid="coll3" config="/sf-1-home/config/config.xml"/>
</DistributorClient>
49
5.4. 배포기 사용시 주의 사항
5. 색인 배포
 색인 배포기에서 동작하는 색인기는 –dfslog를 추가해야 한다.
 DFS 내의 변경된 정보를 기록하기 위함이다. 배포가 필요하지 않은
경우에는 불필요한 작업이기 때문에 기본 옵션으로 설정하지 않는다.
 색인 배포 서버는 클라이언트에 접속을 하기 때문에 서버를 동작시키기 전에
클라이언트를 동작시켜야 한다.
 색인 배포 클라이언트가 구성되어 있는 서버에서는 동적 색인을 돌릴 수
없기 때문에 배포기를 통해서만 동적 색인이 반영될 수 있도록 한다.
 검색을 운영할 수 있는 최소한의 정보만 배포하기 때문이다.
 색인 배포 서버가 구성되어 있는 서버에서 검색기를 구동시킬 때는
–nodelidx 옵션을 추가하여 배포중인 파일을 삭제하지 않도록 한다.
 -nodelidx 옵션이 없는 경우 배포중인 동적 색인 파일을 삭제시킬 수
있기 때문이다.
 컬렉션 전체를 배포할 경우에는 배포 클라이언트 서버의 컬렉션 디렉토리를
삭제한 후 클라이언트와 서버를 차례로 동작시켜야 한다.
50