假设我有以下字段的文档:
{field1, field2, ... fieldn}
我需要运行一些查询,其中一些条件需要在两个或多个字段之间进行比较.喜欢fieldX = fieldY
在标准SQL中,示例可以是:
SELECT * FROM Table1 WHERE farePrice>100 AND originRegion = destinationRegion
Run Code Online (Sandbox Code Playgroud)
我一直在阅读一些文档,看起来"脚本"可能是实现这一目标的唯一方法吗?或者还有其他选择吗?
我正在使用 RabbitMQ River Plugin for Elasticsearch 将数据插入/删除到我们的 ElasticSearch 索引。River 插件仅支持 Bulk API。我们当前的数据使用多个索引,按日期索引,类似于“indexName_yyyymmdd”
删除给定的 ID 时,我们不知道该 ID 可以定位到哪个索引。我们认为我们将能够使用通配符格式,例如“indexName*”,就像您在搜索中所做的那样。
我们尝试了不同的组合,但看起来要么我们没有使用正确的语法,要么肯定不支持通配符???
Examples we have tried:
// using default index in the url …
POST /mybestfares_gb*/bestfares_data/_bulk
{ "delete": {"_id": " AUry2F0Mu2oVvm5kYHaK " }}
// index in the meta section …
POST /_bulk
{ "delete": {"_index":"mybestfares_gb*", "_type":"bestfares_data","_id": "AUry2F0Mu2oVvm5kYHaP" }}
Run Code Online (Sandbox Code Playgroud)
在这两种情况下,我们都会收到以下错误:
"error": "InvalidIndexNameException[[mybestfares_gb*] Invalid index name [mybestfares_gb*], must not contain the following characters [\\, /, *, ?, \", <, >, |, , ,]]"
在 ElasticSeach 文档中提到了这一点: …