2012-05-28 4 views
1

Postgresql의 GIN 또는 GiST 색인을 사용할 때 일치 검색 키워드를 강조 표시하는 방법이 내장되어 있습니까? 그렇지 않다면 Postgresql 밖에서이 작업을 수행 할 수 있습니까?Postgresql GIN/GiST를 사용하여 검색 결과 강조 표시

PHP 5.3.10 및 PostgreSQL 9.1.3을 사용하고 있습니다.

모든 아이디어에 감사드립니다.

답변

2

ts_headline 기능 ts_headline에서 확인하십시오.

SELECT ts_headline('english', 
    'The most common type of search 
is to find all documents containing given query terms 
and return them in order of their similarity to the 
query.', 
    to_tsquery('query & similarity')); 
         ts_headline       
------------------------------------------------------------ 
containing given <b>query</b> terms 
and return them in order of their <b>similarity</b> to the 
<b>query</b>. 
+0

마찬가지로 쉽습니다. 훌륭해, 고마워! – ptrn

관련 문제