6
查询对整数数组数据类型有多复杂?这是我在Python类以注入数据elasticsearch
:使用python_dsl查询elasticsearch中的数组数据类型
class Paragraph(DocType):
body = Text(analyzer="standard")
published_from = Date()
lines = Integer()
n_paragraph = Integer()
capture = Integer()
class Meta:
index = "my_index"
def save(self, **kwargs):
self.lines = len(self.body.split())
return super(Paragraph, self).save(**kwargs)
我注射整数的捕获阵列。这是一个有趣行:
paragraph.capture = [1, 0, 5, 7]
我设法查询,如果一个号码在列表::
cnx = Search().using(client) s = cnx.query("match", capture=5)
为@val说,我们可以添加包含总和来查询另一场总和
如何查询特定索引例如paragraph.capture[1] >= 1
?
我们看到Elasticsearch query on array index是相关的,但我无法建立链接。