- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
应用程序版本
Elasticsearch:v.7.1
Laravel:v5.8
操作系统版本:Ubuntu 18(服务器)/ Windows 10(开发PC)
Elasticsearch搜索API的“query_string”查询返回诸如“Lexical error”之类的错误消息-告诉查询中存在错误。
重现的步骤:
一种。我们使用的“query_string”查询包含 4629个字符(包括字母和符号,例如括号和双引号)
b。当我们使用PHP和Python应用程序进行查询时,会弹出标题中提到的错误
主要问题
我是在这里做错什么,还是应用程序级错误/错误?一直在尝试使用“simple_query_string”之类的替代方法,但是它具有不同的行为,因此我们非常热衷于使用Elasticsearch的 query_string 查询
这是查询
"query_string" => [
"fields" => ['title', 'content'],
"query" => """
(("Salvador "Sal" San Buenaventura Panelo")) OR ("Christopher Lawrence Go") OR ("DILG Undersecretary Epimaco Densing") OR ("Rodolfo Fariñas") OR ("Francis Tolentino" AND ("De Lima" OR "Leila De Lima")) OR ("Reynaldo V. Umali" AND ("De Lima" OR "Leila De Lima")) OR ("Bong Revilla") OR (("Jose "Joe" Callangan Calida")) OR ("Gus S. Tambunting" OR "GusTambunting" AND ("De Lima" OR "Leila De Lima")) OR ("Ramon Bong Revilla" OR "Bong Revilla" AND ("De Lima" OR "Leila De Lima")) OR (Lacson) OR ("Francis Ng Tolentino") OR ("Jose Calida") OR ("José Ruperto Martín Marfori Andanar") OR ("Prospero Pichay Jr.") OR ("Pantaleon Alvarez" AND ("De Lima" OR "Leila De Lima")) OR ("Prospero Pichay" AND ("De Lima" OR "Leila De Lima")) OR ("Senator Vicente Sotto") OR ("Paolo "Pulong" Zimmerman Duterte") OR ("Prospero Arreza Pichay Jr.") OR ("Rudy Fariñas" AND ("De Lima" OR "Leila De Lima")) OR ("Paolo Duterte") OR ("Rudy Fariñas") OR ("Fredenil Castro") OR ("Salvador B. Belaro Jr.") OR ("Sen. Imee Marcos") OR ("Manny Pacquiao") OR ("Senator Aquilino "Koko" Pimentel III" OR "Sen. Aquilino "Koko" Pimentel III") OR ("Senator Aquilino Pimentel III" OR "Sen. Aquilino Pimentel III" OR "Senator Aquilino Pimentel") OR ("Senator Vicente C. Sotto III") OR ("Tito Sotto") OR ("Bato dela Rosa") OR ("Sen. Bato") OR ("Hon. Reynaldo V. Umali") OR ("Gus S. Tambunting") OR ("Tito Sotto" OR "Senator Vicente Sotto" AND ("De Lima" OR "Leila De Lima")) OR ("Bato dela Rosa" OR "Senator Ronald "Bato" dela Rosa"("De Lima" OR "Leila De Lima")) OR ("Bong Go" OR "Christopher Lawrence Go" AND ("De Lima" OR "Leila De Lima")) OR ("Paolo Duterte" AND ("De Lima" OR "Leila De Lima")) OR ("Fredenil H. Castro" OR "Fredenil Castro" AND ("De Lima" OR "Leila De Lima")) OR ("Koko Pimentel") OR ("Paolo Zimmerman Duterte") OR ("Pantaleon Diaz Alvarez") OR ("Salvador Belaro" AND ("De Lima" OR "Leila De Lima")) OR ("Ramon Revilla") OR ("Senator Bong Go") OR (Panfilo) OR ("Jose Callangan Calida") OR ("Salvador San Buenaventura Panelo") OR ("Pantaleon "Bebot" Diaz Alvarez") OR ("Fredenil H. Castro" OR "Fredenil Castro") OR ("Salvador Belaro Jr.") OR ("Salvador Belaro") OR ("Reynaldo V. Umali") OR ("Senator Koko Pimentel III) OR ("Sen. AND Koko AND Pimentel AND III" OR "Sen. AND Koko AND Pimentel") OR ("Bong AND Go") OR ("Ramon AND Bong AND Revilla") OR ("Senator AND Panfilo AND Lacson" OR "Panfilo AND Lacson" OR "Ping AND Lacson" ("De AND Lima" OR "Leila AND De AND Lima")) OR ("Manny AND Pacquiao" OR "Senator AND Manny AND Pacquiao" ("De AND Lima" OR "Leila AND De AND Lima")) OR ("Salvador AND Panelo" ("De AND Lima" OR "Leila AND De AND Lima")) OR ("Epimaco AND Densing" ("De AND Lima" OR "Leila AND De AND Lima")) OR ("Senator AND Sotto") OR ("Vicente AND Sotto") OR ("Panfilo AND Lacson" OR "Ping AND Lacson") OR ("Ronald AND dela AND Rosa") OR ("Senator AND Revilla") OR ("Prospero AND Pichay") OR ("Jose AND Calida" ("De AND Lima" OR "Leila AND De AND Lima")) OR ("Senator AND Francis AND Tolentino") OR ("Senator AND Ronald AND dela AND Rosa") OR ("Menardo AND Guevarra" OR "Menardo AND I. AND Guevarra") OR ("Rodolfo AND "Rudy" AND Castro AND Fariñas") OR ("Senator AND Imee AND Marcos" OR "Imee AND Marcos" ("De AND Lima" OR "Leila AND De AND Lima")) OR ("Gus AND S. AND Tambunting" ("De AND Lima" OR "Leila AND De AND Lima")) OR ("Ronald AND “Bato” AND dela AND Rosa") OR ("Senator AND Bato AND dela AND Rosa") OR ("Senator AND Ramon AND Revilla AND Jr.") OR ("Sen. AND Francis AND Tolentino") OR ("Francis AND Tolentino") OR (("María AND Imelda AND Josefa AND "Imee" AND Romualdez AND Marcos")) OR ("Pulong AND Duterte") OR ("Rodolfo AND Castro AND Fariñas") OR ("Menardo AND Guevarra" OR "Menardo AND I. AND Guevarra"("De AND Lima" OR "Leila AND De AND Lima")) OR ("Christopher AND Lawrence AND “Bong” AND Go") OR ("Senator AND Imee AND Marcos") OR ("Justice AND Secretary AND Menardo AND Guevarra" OR "Justice AND Secretary AND Menardo AND I. AND Guevarra") OR ("Epimaco AND Densing") OR ("Fredenil AND "Fred" AND H. AND Castro") OR ("Koko AND Pimentel" OR "Senator AND Aquilino AND Pimentel AND III" OR "Sen. AND Aquilino AND Pimentel AND III" OR "Senator AND Aquilino AND Pimentel" ("De AND Lima" OR "Leila AND De AND Lima")) OR ("Martín AND Andanar" ("De AND Lima" OR "Leila AND De AND Lima")) OR ("Senator AND Ronald AND "Bato" AND dela AND Rosa") OR ("Christopher AND Lawrence AND "Bong" AND Tesoro AND Go") OR ("Senator AND Christopher AND Lawrence AND "Bong" AND Tesoro AND Go") OR ("Senator AND Panfilo AND Lacson") OR ("Senator AND Manny AND Pacquiao") OR ("Salvador AND Panelo") OR ("Martín AND Andanar") OR ("Pantaleon AND Alvarez")
"""
最佳答案
删除""
中的双引号(query
),然后尝试如下操作,希望它以后可以使用。
关于我的索引的工作示例:
GET locations/_search
{
"size": 1,
"sort": [
{
"_score": {
"order": "desc"
}
},
{
"property_count": {
"order": "desc"
}
}
],
"query": {
"bool": {
"must": [
{
"match": {
"country_code.keyword": "IT"
}
},
{
"query_string": {
"fields": ["display","content"],
"query": "((Salvador Sal San Buenaventura Panelo)) OR (Christopher Lawrence Go) OR (DILG Undersecretary Epimaco Densing) OR (Rodolfo Fariñas) OR (Francis Tolentino AND (De Lima OR Leila De Lima)) OR (Reynaldo V. Umali AND (De Lima OR Leila De Lima)) OR (Bong Revilla) OR ((Jose Joe Callangan Calida)) OR (Gus S. Tambunting OR GusTambunting AND (De Lima OR Leila De Lima)) OR (Ramon Bong Revilla OR Bong Revilla AND (De Lima OR Leila De Lima)) OR (Lacson) OR (Francis Ng Tolentino) OR (Jose Calida) OR (José Ruperto Martín Marfori Andanar) OR (Prospero Pichay Jr.) OR (Pantaleon Alvarez AND (De Lima OR Leila De Lima)) OR (Prospero Pichay AND (De Lima OR Leila De Lima)) OR (Senator Vicente Sotto) OR (Paolo Pulong Zimmerman Duterte) OR (Prospero Arreza Pichay Jr.) OR (Rudy Fariñas AND (De Lima OR Leila De Lima)) OR (Paolo Duterte) OR (Rudy Fariñas) OR (Fredenil Castro) OR (Salvador B. Belaro Jr.) OR (Sen. Imee Marcos) OR (Manny Pacquiao) OR (Senator Aquilino Koko Pimentel III OR Sen. Aquilino Koko Pimentel III) OR (Senator Aquilino Pimentel III OR Sen. Aquilino Pimentel III OR Senator Aquilino Pimentel) OR (Senator Vicente C. Sotto III) OR (Tito Sotto) OR (Bato dela Rosa) OR (Sen. Bato) OR (Hon. Reynaldo V. Umali) OR (Gus S. Tambunting) OR (Tito Sotto OR Senator Vicente Sotto AND (De Lima OR Leila De Lima)) OR (Bato dela Rosa OR Senator Ronald Bato dela Rosa(De Lima OR Leila De Lima)) OR (Bong Go OR Christopher Lawrence Go AND (De Lima OR Leila De Lima)) OR (Paolo Duterte AND (De Lima OR Leila De Lima)) OR (Fredenil H. Castro OR Fredenil Castro AND (De Lima OR Leila De Lima)) OR (Koko Pimentel) OR (Paolo Zimmerman Duterte) OR (Pantaleon Diaz Alvarez) OR (Salvador Belaro AND (De Lima OR Leila De Lima)) OR (Ramon Revilla) OR (Senator Bong Go) OR (Panfilo) OR (Jose Callangan Calida) OR (Salvador San Buenaventura Panelo) OR (Pantaleon Bebot Diaz Alvarez) OR (Fredenil H. Castro OR Fredenil Castro) OR (Salvador Belaro Jr.) OR (Salvador Belaro) OR (Reynaldo V. Umali) OR (Senator Koko Pimentel III) OR (Sen. AND Koko AND Pimentel AND III OR Sen. AND Koko AND Pimentel) OR (Bong AND Go) OR (Ramon AND Bong AND Revilla) OR (Senator AND Panfilo AND Lacson OR Panfilo AND Lacson OR Ping AND Lacson (De AND Lima OR Leila AND De AND Lima)) OR (Manny AND Pacquiao OR Senator AND Manny AND Pacquiao (De AND Lima OR Leila AND De AND Lima)) OR (Salvador AND Panelo (De AND Lima OR Leila AND De AND Lima)) OR (Epimaco AND Densing (De AND Lima OR Leila AND De AND Lima)) OR (Senator AND Sotto) OR (Vicente AND Sotto) OR (Panfilo AND Lacson OR Ping AND Lacson) OR (Ronald AND dela AND Rosa) OR (Senator AND Revilla) OR (Prospero AND Pichay) OR (Jose AND Calida (De AND Lima OR Leila AND De AND Lima)) OR (Senator AND Francis AND Tolentino) OR (Senator AND Ronald AND dela AND Rosa) OR (Menardo AND Guevarra OR Menardo AND I. AND Guevarra) OR (Rodolfo AND Rudy AND Castro AND Fariñas) OR (Senator AND Imee AND Marcos OR Imee AND Marcos (De AND Lima OR Leila AND De AND Lima)) OR (Gus AND S. AND Tambunting (De AND Lima OR Leila AND De AND Lima)) OR (Ronald AND “Bato” AND dela AND Rosa) OR (Senator AND Bato AND dela AND Rosa) OR (Senator AND Ramon AND Revilla AND Jr.) OR (Sen. AND Francis AND Tolentino) OR (Francis AND Tolentino) OR ((María AND Imelda AND Josefa AND Imee AND Romualdez AND Marcos)) OR (Pulong AND Duterte) OR (Rodolfo AND Castro AND Fariñas) OR (Menardo AND Guevarra OR Menardo AND I. AND Guevarra(De AND Lima OR Leila AND De AND Lima)) OR (Christopher AND Lawrence AND “Bong” AND Go) OR (Senator AND Imee AND Marcos) OR (Justice AND Secretary AND Menardo AND Guevarra OR Justice AND Secretary AND Menardo AND I. AND Guevarra) OR (Epimaco AND Densing) OR (Fredenil AND Fred AND H. AND Castro) OR (Koko AND Pimentel OR Senator AND Aquilino AND Pimentel AND III OR Sen. AND Aquilino AND Pimentel AND III OR Senator AND Aquilino AND Pimentel (De AND Lima OR Leila AND De AND Lima)) OR (Martín AND Andanar (De AND Lima OR Leila AND De AND Lima)) OR (Senator AND Ronald AND Bato AND dela AND Rosa) OR (Christopher AND Lawrence AND Bong AND Tesoro AND Go) OR (Senator AND Christopher AND Lawrence AND Bong AND Tesoro AND Go) OR (Senator AND Panfilo AND Lacson) OR (Senator AND Manny AND Pacquiao) OR (Salvador AND Panelo) OR (Martín AND Andanar) OR (Pantaleon AND Alvarez)"
}
}
]
}
},
"_source": [
"location_id",
"display",
"parent_path",
"parent_location_id",
"country",
"country_code",
"east",
"west",
"north",
"south",
"category"
]
}
关于elasticsearch - Elasticsearch “query_string”查询错误显示为 “Lexical error”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58024791/
我正在阅读有关 C# 和闭包的各种信息 articles ,Jon Skeet 的精彩“C# in Depth”,我看到像“C# 和 ruby 实现词法闭包”这样的陈述。 为什么作者要包含“词汇”
我有两个编辑器实例。一个是可编辑的第二个只读,用于预览用户输入的内容我在这些编辑器之间复制了编辑器状态 - 没有任何问题但我想当第一个编辑器为空时隐藏第二个编辑器。我正在尝试类似的方法,但它总是返回
我正在使用 Flex 构建自己的语言,但我想知道一些事情: 为什么要使用词法分析器? 他们会帮我做点什么吗? 他们是强制性的吗? 最佳答案 词法分析有助于简化解析,因为词位可以被视为抽象实体而不是具体
考虑到一个二进制数据(视频/图像/音频/可执行文件)可以看作是一长串随机字节, 当数据采用特殊格式(SQL、数据库中的 BOLB、MP3、JSON、XML 等)时,解析器如何知道特殊字符(或字符序列,
我对 javascript 中的 this 有疑问。 https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operato
我使用术语“词法编码”是因为我没有更好的编码。 与字母相反,单词可以说是交流的基本单位。 Unicode 尝试为所有已知字母表的每个字母分配一个数值。对一种语言来说是字母,对另一种语言来说是字形。 U
我一直在用 Java 编写一个语音识别程序,只是为了看看它是如何工作的。直到一天前一切都工作得很好。我不知道发生了什么,因为我没有更改代码中的任何内容。 由于出现词汇错误,我想我只需要粘贴我的语法文件
在调试一些较旧的 perl 代码时,我使用 perl critic 来发现错误。我经常偶然发现这个“循环迭代器不是词法”策略: Perl::Critic::Policy::Variables::Req
在 perdoc Socket页,他们使用全局文件句柄作为套接字。 但是如果我在子进程调用的子例程中创建一个套接字,使用词法文件句柄仍然使用 Socket 是否更好? 像这样: use strict;
我正在尝试为我出于个人原因而设计的 C/C++/C#/Java/D 之类的编程语言编写扫描仪。对于这个任务,我使用 Ragel 来生成我的扫描仪。我无法准确理解许多操作符何时触发 Action ,可能
我是 AI 学生,我们使用 JavaCC。 我是新手。我正在尝试简单的例子,但我有一些错误。 1)我从它的网站下载了 JavaCC 0.6 2)我把它解压到C盘 3)我将此代码写在扩展名为“.jj”的
在@lexical/react中,在没有依赖数组的useEffect中注册编辑器命令是否会带来重大损失(性能或其他)? useEffect(() => { const unsubscribe =
我有一个词法编辑器,需要将其序列化为 html,以便我可以将其嵌入到电子邮件模板中。 使用 $generateHtmlFromNodes 函数时,我不断遇到以下错误: Error: Unable to
在经典的编译器理论中,前两个阶段是词法分析和语法分析。他们正在筹备中。词法分析将标记识别为解析的输入。 但是我遇到了一些在词法分析中很难被正确识别的情况。例如下面关于C++模板的代码: map> >>
let textBytes = ctypes.uint8_t("hello"); let a = new SECItem; a.type = siBuffer; a.data = textBytes.
我有4条规则 rule1: match variable rule2: match Float rule3: match Integer rule4: [ \t] ; //skipping space
如果您查看 original Wordnet search并选择“显示选项:显示词汇文件信息”,您将看到一个非常有用的单词分类,称为 词汇文件 .例如,对于“填充”,我们有: S: (n) fi
我已经多次看到术语“词法变量”,主要是在闭包的上下文中。 Paul Graham 在他关于 Lisp 的书中使用这个术语来指代使用 let 表达式定义的变量。 我知道词法作用域是静态作用域的另一个名称
应用程序版本 Elasticsearch:v.7.1 Laravel:v5.8 操作系统版本:Ubuntu 18(服务器)/ Windows 10(开发PC) Elasticsearch搜索API的“
我想以 myObj 作为其运行范围来调用 myObj.sayHello。我了解绑定(bind),它工作得很好。 var myObj = {"name1":"BP", "sayHell
我是一名优秀的程序员,十分优秀!