如何在同一个查询中使用搜索和过滤?
String url = "https://outlook.office.com/api/v2.0/me/messages?$filter=ReceivedDateTime ge 2016-02-22&$select=Subject,From,Body,ReceivedDateTime&$search=\"subject:(Chris Brown OR Michael Jackson)\"";
Run Code Online (Sandbox Code Playgroud)
我需要找到的所有邮件Subject具有或者"克里斯·布朗"或"迈克尔·杰克逊",并邮寄2月22日之后收到的日期,2016年还应该有Subject,From,Body,ReceivedDateTime在REST响应.
有人可以帮忙吗?
仅供参考-我得到的输出,如果它有两种filter或search.但是当一起使用时,我收到"错误请求"错误.
我有这样的文件
{
"_index": "testindex",
"_type": "logs",
"_id": "1",
"_score": 1,
"_source": {
"field1": "data1",
"field2": "data2"
}
}
Run Code Online (Sandbox Code Playgroud)
我需要更改field2为Request.field3
{
"_index": "testindex",
"_type": "logs",
"_id": "1",
"_score": 1,
"_source": {
"field1": "data1",
"Request": {
"field3": "data2"
}
}
}
Run Code Online (Sandbox Code Playgroud)
为此,首先添加了一个到现有索引的字段映射
PUT testindex/_mapping/logs
{
"properties":
{
"Request":
{
"properties":
{
"field3" :
{
"type": "string"
}
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
然后尝试重新索引
POST _reindex
{
"source": {
"index": "testindex"
},
"dest": {
"index": "testindex1"
},
"script": {
"inline": "ctx._source.Request.field3 …Run Code Online (Sandbox Code Playgroud) 我需要 java 正则表达式方面的一些帮助。我有一种下面的字符串,我需要从中提取信息
\n\n\xe2\x80\x9csome information text followed by some price detail like below\n\nAmount: $45.75\nTax: $3.25\nDiscount: -$5.00\nTotal : *$49.00*\n\nfollowed by some other information text\xe2\x80\x9d\nRun Code Online (Sandbox Code Playgroud)\n\n我需要正则表达式来提取所有价格(键,值)对,例如 ( Amount, $45.75), ( Tax, $3.25)
或者也许使用正则表达式来提取所提供密钥的价格。即String amountregex = \xe2\x80\x9cregexstring\xe2\x80\x9d应该给$45.75
有人可以帮忙吗?
\n