1
我在EC2实例上使用elasticsearch 0.20.2(16GB RAM,未启用交换)。我有很多索引文件,当我尝试做方面的结果时,我得到了堆空间错误,然后elasticsearch服务器无法使用。我正在增加java的堆内存,但没有任何帮助。所以我的问题是我能限制哪些方面将被应用的文件数量。elasticsearch facet limit
这里是我的设置和映射:
my_settings = {
'settings': {
'analysis': {
'analyzer': {
'text_analyzer': {
'tokenizer': 'standard',
'filter': ['standard', 'lowercase']
},
'suggestions_analyzer': {
'tokenizer': 'standard',
'filter': ['suggestions_shingle']
}
},
'filter': {
'suggestions_shingle': {
'type': 'shingle',
'min_shingle_size': 2,
'max_shingle_size': 5
}
}
}
}
}
my_mapping = {
'test-type':{
'properties':{
'publish_datetime': {'type': 'date'},
'text': {
'type': 'multi_field',
'fields': {
'text': {'type': 'string', 'analyzer': 'text_analyzer', 'include_in_all': True},
'suggestions': {'type': 'string', 'analyzer': 'suggestions_analyzer', 'include_in_all': False}
}
}
}
}
}
,我的搜索查询是:
query = {
'filtered': {
'filter' : {
'limit' : {'value' : 10}
},
'query':{
'prefix':{
'text.suggestions': 'wha'
}
},
},
'facets':{
'text_suggestions':{
'terms':{
'field':'text.suggestions',
'regex':'^%s.*' % 'wha',
'size': 5
}
}
},
'size': 0
}
是有人成功限制文件号码将被小让与我们分享。
所以你告诉我,查询结果的数量是输入的方面。所以,如果这是正确的,当我把大小限制到查询部分,那么我没有得到任何方面的结果,我知道有查询结果导致相同的查询与给定的大小和独立执行结果。 'query':{ 'prefix':{ 'text.suggestions':'wha' },'size':100 }, –