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是相關的,但我無法建立鏈接。