sphinxapi BuildExcerpts(创建高亮文本摘要) 方法参数说明
                                                                
                17-08-02 10:34
                字数 1214
                阅读 6333
                                已编辑
                                            
            首先官方参数说明
public array SphinxClient::buildExcerpts ( array $docs , string $index , string $words [, array $opts ] )$docs Array of strings with documents' contents.
$index Index name.
$words Keywords to highlight.
$opts 如下
| Option | Description | 
|---|---|
| "before_match" | A string to insert before a keyword match. Default is "". | 
| "after_match" | A string to insert after a keyword match. Default is "". | 
| "chunk_separator" | A string to insert between snippet chunks (passages). Default is " ... ". | 
| "limit" | Maximum snippet size, in symbols (codepoints). Integer, default is 256. | 
| "around" | How much words to pick around each matching keywords block. Integer, default is 5. | 
| "exact_phrase" | Whether to highlight exact query phrase matches only instead of individual keywords. Boolean, default is FALSE. | 
| "single_passage" | Whether to extract single best passage only. Boolean, default is FALSE. | 
中文解释
$docs 为包含各文档内容的数组。【注意!如果数组里里有int类型需要转换成string。如:(string) 1】
$index 为索引名。
$words 为包含需要高亮的关键字的字符串。
下面是$opts可选参数。
before_match和 after_match 就不说了,就是匹配的keyword前后要插入的字符串。
chunk_separator 在摘要词组(段落)之间插入的字符串。默认为" ... "。
limit 摘要最多包含的符号(codepoints)数。这个codeopints是什么意思具体可以百度下,不做深入说明,因为我也不太明白 。
around 每个关键词块左右选取的词的数量。整数,默认为 5.
exact_phrase 是否突出显示精确的查询短语匹配而不是单个关键字。布尔值,默认值为FALSE。【这货有点奇怪,在我使用coreseek时如果这个设置为true会导致无法高亮关键词,并抛出下面的异常received zero-sized searchd response】
single_passage 是否仅提取匹配到的最佳的一个区块。布尔值,默认为false.
0人点赞>
                    请登录后发表评论
        
        相关推荐
        
    文章归档
    2025-09
                
                    1 篇
                
            
                    
                2025-08
                
                    7 篇
                
            
                    
                2025-07
                
                    1 篇
                
            
                    
                2025-05
                
                    2 篇
                
            
                    
                2024-11
                
                    1 篇
                
            
                                展开剩余 72 条
                            
                    2024-06
                    
                        1 篇
                    
                
                            
                    2024-05
                    
                        2 篇
                    
                
                            
                    2024-04
                    
                        2 篇
                    
                
                            
                    2024-03
                    
                        2 篇
                    
                
                            
                    2024-01
                    
                        1 篇
                    
                
                            
                    2023-10
                    
                        1 篇
                    
                
                            
                    2023-09
                    
                        1 篇
                    
                
                            
                    2023-08
                    
                        1 篇
                    
                
                            
                    2023-06
                    
                        1 篇
                    
                
                            
                    2023-04
                    
                        1 篇
                    
                
                            
                    2022-12
                    
                        2 篇
                    
                
                            
                    2022-06
                    
                        1 篇
                    
                
                            
                    2022-04
                    
                        4 篇
                    
                
                            
                    2022-03
                    
                        3 篇
                    
                
                            
                    2022-01
                    
                        6 篇
                    
                
                            
                    2021-12
                    
                        2 篇
                    
                
                            
                    2021-11
                    
                        2 篇
                    
                
                            
                    2021-10
                    
                        2 篇
                    
                
                            
                    2021-09
                    
                        1 篇
                    
                
                            
                    2021-08
                    
                        2 篇
                    
                
                            
                    2021-07
                    
                        4 篇
                    
                
                            
                    2021-06
                    
                        1 篇
                    
                
                            
                    2021-05
                    
                        3 篇
                    
                
                            
                    2021-04
                    
                        3 篇
                    
                
                            
                    2021-01
                    
                        2 篇
                    
                
                            
                    2020-11
                    
                        1 篇
                    
                
                            
                    2020-10
                    
                        3 篇
                    
                
                            
                    2020-09
                    
                        2 篇
                    
                
                            
                    2020-08
                    
                        1 篇
                    
                
                            
                    2020-07
                    
                        5 篇
                    
                
                            
                    2020-06
                    
                        5 篇
                    
                
                            
                    2020-05
                    
                        1 篇
                    
                
                            
                    2020-04
                    
                        1 篇
                    
                
                            
                    2020-03
                    
                        2 篇
                    
                
                            
                    2020-02
                    
                        3 篇
                    
                
                            
                    2020-01
                    
                        1 篇
                    
                
                            
                    2019-11
                    
                        5 篇
                    
                
                            
                    2019-10
                    
                        10 篇
                    
                
                            
                    2019-09
                    
                        12 篇
                    
                
                            
                    2019-08
                    
                        17 篇
                    
                
                            
                    2019-07
                    
                        8 篇
                    
                
                            
                    2019-05
                    
                        3 篇
                    
                
                            
                    2019-04
                    
                        8 篇
                    
                
                            
                    2019-03
                    
                        7 篇
                    
                
                            
                    2019-02
                    
                        8 篇
                    
                
                            
                    2019-01
                    
                        5 篇
                    
                
                            
                    2018-12
                    
                        7 篇
                    
                
                            
                    2018-11
                    
                        8 篇
                    
                
                            
                    2018-10
                    
                        4 篇
                    
                
                            
                    2018-09
                    
                        7 篇
                    
                
                            
                    2018-08
                    
                        12 篇
                    
                
                            
                    2018-07
                    
                        9 篇
                    
                
                            
                    2018-06
                    
                        6 篇
                    
                
                            
                    2018-05
                    
                        11 篇
                    
                
                            
                    2018-04
                    
                        18 篇
                    
                
                            
                    2018-03
                    
                        1 篇
                    
                
                            
                    2018-02
                    
                        2 篇
                    
                
                            
                    2018-01
                    
                        10 篇
                    
                
                            
                    2017-12
                    
                        14 篇
                    
                
                            
                    2017-11
                    
                        44 篇
                    
                
                            
                    2017-10
                    
                        13 篇
                    
                
                            
                    2017-09
                    
                        4 篇
                    
                
                            
                    2017-08
                    
                        12 篇
                    
                
                            
                    2017-07
                    
                        5 篇
                    
                
                            
                    2017-06
                    
                        4 篇
                    
                
                            
                    2017-05
                    
                        2 篇
                    
                
                            
                    2017-04
                    
                        3 篇
                    
                
                            
                    2017-03
                    
                        9 篇
                    
                
                            
                    2017-02
                    
                        3 篇
                    
                
                            
                    2017-01
                    
                        2 篇
                    
                
                            
                    2016-12
                    
                        10 篇
                    
                
                            
                    2016-11
                    
                        4 篇
                    
                
                        最新文章
        最受欢迎
    09-04 16:48
                    08-26 17:01
                    08-26 00:10
                    08-16 00:23
                    08-15 16:15
                    13 评论
                    11 评论
                    10 评论
                     
         
                 
     
     
                                
我:'exact_phrase' => true
这个设置true,报下面错误,请问你解决了吗?
报错:searchd error: exact_phrase is deprecated, use phrase search operator with query_mode=1