'extension'에 해당되는 글 2건

  1. 2021.07.06 [Elasticsearch] arirang dictionary 에 영어+한글 복합어 분해 추가.
  2. 2008.07.21 php 모듈 추가하기 - Installation of PECL extensions

[Elasticsearch] arirang dictionary 에 영어+한글 복합어 분해 추가.

Elastic/Elasticsearch 2021. 7. 6. 14:59

그냥 작은 운영 팁 정도 입니다.

 

영어+한글로 작성된 경우 둘 다 사전에 등록 되어 있지 않다고 하면 아래와 같이 등록을 하면 됩니다.

 

예) kr모터스

extension.dic 에 한글 "모터스" 만 등록 합니다.

모터스,100000000X

 

POST http://localhost:10800/_analyze

Request)

{

"tokenizer": "arirang_tokenizer",

"filter": [

"arirang_filter"

],

"text": "kr모터스"

}

 

Response)

{

"tokens": [

{

"token": "kr모터스",

"start_offset": 0,

"end_offset": 5,

"type": "korean",

"position": 0

},

{

"token": "kr",

"start_offset": 0,

"end_offset": 2,

"type": "word",

"position": 0

},

{

"token": "모터스",

"start_offset": 2,

"end_offset": 5,

"type": "korean",

"position": 1

}

]

}

:

php 모듈 추가하기 - Installation of PECL extensions

ITWeb/개발일반 2008. 7. 21. 12:59
제가 테스트한 샘플 코드 입니다.
APC 추가 하기 (php 5.2.6 이랑 apache 2.2.9 입니다.)

1. /home/php/bin/pecl download apc
2. tar -xvzf APC-3.0.19.tgz
3. cd APC-3.0.19
4. /home/php/bin/phpize
4. ./configure --enable-apc-mmap --with-apxs=/home/apache/bin/apxs --with-php-config=/home/php/bin/php-config
5. make
6. make install
    이렇게 하시면 기본적으로 php 의 extension 모듈 위치로 복사 됩니다.
7. 또는 이렇게 하셔도 됩니다. cp ././libs/apc.so /usr/local/lib
    이 부분도 역시 php extension 위치로 복사해서 넣으시면 됩니다.
8. php.ini 수정하기
    extension_dir=설정한위치로적용하세요.
       예) /home/php/lib/php/extensions/no-debug-zts-20060613/apc.so 가 있습니다.
          extension_dir=/home/php/lib/php/extensions
          extension="no-debug-zts-20060613/apc.so" 이렇게 넣으시면 됩니다.
          dir 은..적절히 조절 하시면 됩니다.
    enble_dl=on

    extension="apc.so"
    apc.enabled=1
    apc.shm_segments=1
    apc.shm_size=256
    apc.ttl=7200
    apc.user_ttl=7200
    apc.num_files_hint=1024
    apc.mmap_file_mask=/tmp/apc.XXXXXX
    apc.enable_cli=1
    apc.include_once_override=1



ref. http://kr2.php.net/manual/en/install.pecl.php

php 설치 과정과 비슷 합니다.
보시면 아시겠지만 make install 과정 빼고 동일하죠.
make 하면 실제 build 까지 다 해주니 우리는 그냥 필요한 확장 모듈을 extension 에 복사 해주고 설정만 잡아 준 후 apache restart 시키면.. 끝.. ^^*

1. $ pecl install extname-beta
2. $ cd extname
$ phpize
$ ./configure
$ make
# make install

3. $ cd /your/phpsrcdir/ext
$ pecl download extname
$ gzip -d < extname.tgz | tar -xvf -
$ mv extname-x.x.x extname

$ cd /your/phpsrcdir
$ rm configure
$ ./buildconf --force
$ ./configure --help
$ ./configure --with-extname --enable-someotherext --with-foobar
$ make
$ make install

- 잘모르겠다 싶으면.. help ㅎㅎ
$ ./configure --help | grep extname
: