当前位置:网站首页>Difference between KQL and Lucene
Difference between KQL and Lucene
2022-08-09 01:33:00 【IT Knives Out】
Original URL: KQLThe difference between Lucene and Lucene - Programmer Sought Description This article introduces the difference between KQL and Lucene. KQL and Lucene are both query languages supported by Kibana, and there is little difference between the two languages. Website URL KQL syntax: https://www.elastic.co/guide/en/kibana/7.7/kuery-query.html Lucene syntax: Lucene query syntax | Kibana Guide [7.7] | Elastic KQL can get suggestions for fields, values, and operators as you type your query, a feature that doesn't exist when using Lucene.(This feature requires "Basic Tier" or higher.) Look for count greater than or equal to 5 KQL syntax: count:>=5 Lucene syntax: count:[5 TO *] Looks for account_number greater than or equal to 100, but less than 200 KQL syntax: account_number:>=100 and account_number:<200 Lucene syntax: account_number:[100 TO 200} KQL Documentation The bool operators or , and and not . Uppercase versions ( OR , AND and NOT ) also work.The documentation specifies that and has higher precedence than or , which is the usual operator precedence rule. Lucene Documentation Lucene also supports AND , OR and NOT , but only in uppercase.So, if you try to use and , it will be treated as literal. Lucene recommends + (entry must exist) and - (entry cannot exist).For example: brown +fox -news specifies that brown is optional, fox must exist, and news must not exist. Lucene supports && , || and ! .However, the documentation states that all of these operators do not obey the usual operator precedence rules, and recommends parentheses when using multiple operators at the same time. Find documents with field response KQL syntax: response:* Lucene syntax: _exists_:response (response:* also works with Lucene, but may behave differently if the field is an empty string). Types of wildcards KQL: The documentation only mentions the * wildcard, which matches zero or more characters.not mentioned ?. Lucene: * wildcard, matches zero or more characters; ? matches a single character. Escape of wildcards KQL: Wildcards never need to be escaped when using them as wildcards, so we can use something like book.*:(quick or brown). Lucene: Wildcards as part of field names seem to need to be escaped.The example given is book.\*:(quick OR brown) . According to the documentation, the syntax for nested queries differs. The KQL documentation doesn't mention regular expressions, fuzzy searches, and boosting; so they may not be supported.Lucene supports them.Introduction
1. Drop down suggestions
2. Range query
3. Operators
4. Existence query
5. Wildcards
6. Nested queries
7. Extra Features of Lucene
边栏推荐
猜你喜欢
随机推荐
Go-10-模块与包
谷歌翻译软件-免费谷歌翻译
Image denoising based on edge enhancement Diffusion 】 (cEED) and Coherence Enhancing coursing together (cCED) filter to realize image denoising matlab code
企业里Foxmail邮箱问题解决方法汇总
C语言-大端存储和小端存储
任务六 特征衍生 案例分析
4-5 Matplotlib库 散点图
Proe/Creo智能硬件产品结构设计要点「干货分享」
Observer pattern
jetson nano 开机闪一下然后黑屏
日文翻译-在线免费日文翻译软件
4-1 Matplotlib库 数据分析常用图
使用百度EasyDL实现智能垃圾箱
【图像增强】基于Step和Polynomial 滤波实现图像增强附matlab代码
字符串压缩
5-2 Seaborn 分类绘图
数字孪生+燃气管理,开启智慧燃气管理新模式
4-3 Matplotlib库 条形图
Grid布局介绍
Pinctrl 子系统简介