2015-11-09 45 views
2

我正在使用ES 1.7.2。我分析仪filled_by_suggest场完成提示TokenStream扩展错误

"company_analyzer": { 
    "tokenizer": "whitespace", 
    "filter": [ 
     "shingle_filter" 
    ] 
    } 

鹅卵石过滤

"shingle_filter": { 
    "type": "shingle", 
    "min_shingle_size": 2, 
    "max_shingle_size": 5 
    } 

映射现场

"filed_by_suggest" : {"type" : "completion", "analyzer" : "company_analyzer"} 

当我做

PUT my_index/my_type/1 
{ 
    "filed_by_suggest": "timothy M Hogan - AZ Ctr for Law in the Public Interest" 
} 

我获得以下错误

{ 
    "error": "IllegalArgumentException[TokenStream expanded to 1793 finite strings. Only <= 256 finite strings are supported]", 
    "status": 500 
} 

但是,当我试图指数较大的字符串像

PUT my_index/my_type/1 
{ 
    "filed_by_suggest": "alliance telecommunications corp., hector communications corporation, golden west telecommunications cooperative, inc., splitrock telecom coop., inc., ollig utilities co., sioux valley telephone co., hills telephone co. inc., sleepy eye te" 
} 

此操作是成功的。我知道一些关于完成建议者内部使用的FST

任何人都可以请解释如何扩展令牌,以及如何解决这个问题?

+0

我有同样的问题。你有没有找到解决办法? –

+0

@usef_ksa不,我无法解决问题,我实际上已将分析器更改为“关键字”,因为“完成建议器”仅从字符串开头起作用,[this](https://www.bountysource.com/issues/8973242-tokenstream-error-only-256-finite-strings-are-supported)可能很有用 – ChintanShah25

回答

0

这取决于你的分析仪。

输入字符串将被分析器分成令牌,您可以使用API​​测试并计数令牌。