我正在寻找适合的Elasticsearch查询,
SELECT col1,col2 FROM myTable WHERE col1="value1" AND col2 = "value2"
例如: 这是我的映射,
{
"mapping": {
"doc": {
"properties": {
"book": {
"properties": {
"name": {
"type": "text"
},
"price": {
"type": "integer"
},
"booktype": {
"properties": {
"booktype": {
"type": "text"
}
}
}
}
}
}
}
}
}
我正在尝试编写一个查询,该查询将给我price
和name
,其中有booktype=Fiction
答案 0 :(得分:0)
尝试一下:
GET myTable/_search
{
"size": 1000,
"_source": [
"price",
"name"
],
"query": {
"bool": {
"must": [
{
"match": {
"booktype.booktype": "Fiction"
}
}
]
}
}
}
注意:您可能需要调整“大小”以适合您的需求。