Query String Query

The query language query allows humans to describe complex queries using a simple syntax.

Terms

Plain terms without any other syntax are interpreted as a match query for the term in the default field. The default field is _allunless overridden in the index mapping.

Example: water will perform a Match Query for the term water.

Phrases

Phrase queries can be accomplished by placing the phrase in quotes.

Example: "light beer" will peform a Match Phrase Query for the phrase light beer.

Field Scoping

You can qualify the field for these searches by prefixing them with the name of the field separated by a colon.

Example: description:water will perform a Match Query for the term water, in the description field.

Required, Optional, and Exclusion

When your query string includes multiple items, by default these are placed into the SHOULD clause of a Boolean Query.

You can change this by prefixing your items with a + or ‘-’. * ‘+’ Prefixing with plus places that item in the MUST portion of the boolean query. * ‘-’ Prefixing with a minus places that item in the MUST NOT portion of the boolean query.

Example: +description:water -light beer will perform a Boolean Query that MUST satisfy the Match Query for the term waterin the description field, MUST NOT satisfy the Match Query for the term light in the default field, and SHOULD satisfy the Match Query for the term beer in the default field. Result documents satisfying the SHOULD clause will score higher than those that do not.

Boosting

You can influence the relative importance of the clauses by suffixing clauses with the ^ operator followed by a number.

Example: description:water name:water^5 will perform Match queries for water in both the name and description fields, but documents having the term in the name field will score higher.

Numeric Ranges

You can perform numeric ranges by using the >, >=, <, and <= operators, followed by a numeric value.

Example: abv:>10 will perform an Numeric Range Query on the abv field for values greater than ten.

Date Ranges

You can perform date range searches by using the >, >=, <, and <= operators, followed by a date value in quotes.

Example: created:>"2016-09-21" will perform an Date Range Query on the created field for values after September 21, 2016.

Escaping

The following quoted string enumerates the characters which may be escaped:

"+-=&|><!(){}[]^\"~*?:\\/ "

NOTE: this list contains the space character.

In order to escape these characters, they are prefixed with the \ (backslash) character. In all cases, using the escaped version produces the character itself and is not interpreted by the lexer.

Example: my\ name will be interpreted as a single argument to a match query with the value “my name”.

Example: "contains a\" character" will be interpreted as a single argument to a phrase query with the value contains a " character.

bleve搜索引擎是支持基于field搜索的的更多相关文章

  1. php根据汉字获取拼音(php基于拼音搜索实现原理)

    php根据汉字获取拼音(php基于拼音搜索实现原理) 代码一:获取字符串汉字首字母,兼容GBK和UTF-8 <?php function getfirstchar($s0){   //获取单个汉 ...

  2. delphi不同版本字符串类型的演化(要支持基于firemonkey的app调用,字符串最好使用olevariant类型)

    string,DELPHI2009以前的版本string=ansistring,一个字符占一个字节,DELPHI2009及以上版本string=unicodestring,一个字符占二个字节. cha ...

  3. Python分布式爬虫打造搜索引擎完整版-基于Scrapy、Redis、elasticsearch和django打造一个完整的搜索引擎网站

    Python分布式爬虫打造搜索引擎 基于Scrapy.Redis.elasticsearch和django打造一个完整的搜索引擎网站 https://github.com/mtianyan/Artic ...

  4. 基于Elasticsearch搜索平台设计

    背景 随着公司业务的高速发展以及数据爆炸式的增长,当前公司各产线都有关于搜索方面的需求,但是以前的搜索服务系统由于架构与业务上的设计,不能很好的满足各个业务线的期望,主要体现下面三个问题: 不能支持对 ...

  5. Lucene搜索引擎+HDFS+MR完成垂直搜索

    介于上一篇的java实现网络爬虫基础之上,这一篇的思想是将网络收集的数据保存到HDFS和数据库(Mysql)中:然后用MR对HDFS的数据进行索引处理,处理成倒排索引:搜索时先用HDFS建立好的索引来 ...

  6. 基于搜狗搜索的微信公众号爬虫实现(C#版本)

    Author: Hoyho Luo Email: luohaihao@gmail.com Source Url:http://here2say.me/11/ 转载请保留此出处 本文介绍基于搜狗的微信公 ...

  7. 【沽泡学院07】基于ElasticSearch搜索附近的人

    1. 为什么要选择ElasticSearch 1)ElasticSearch 优点: 分布式.实时的.Push replication 完全支持Apache Lucene的接近实时的搜索 处理多租户( ...

  8. THINKPHP_(8)_修改TP源码,支持基于多层关联的任一字段进行排序

    之前博文 前述博文THINKPHP_(1)_修改TP源码,支持对中文字符串按拼音进行排序,其解决的主要问题是,对于查询出的think\collection数据,按指定字段对数据进行排序,从而在页面上进 ...

  9. C# 嵌入dll 动软代码生成器基础使用 系统缓存全解析 .NET开发中的事务处理大比拼 C#之数据类型学习 【基于EF Core的Code First模式的DotNetCore快速开发框架】完成对DB First代码生成的支持 基于EF Core的Code First模式的DotNetCore快速开发框架 【懒人有道】在asp.net core中实现程序集注入

    C# 嵌入dll   在很多时候我们在生成C#exe文件时,如果在工程里调用了dll文件时,那么如果不加以处理的话在生成的exe文件运行时需要连同这个dll一起转移,相比于一个单独干净的exe,这种形 ...

随机推荐

  1. MySQL的1067错误

    1.打开my.ini文件,找到default-storage-engine=InnoDB这一行,把它改成default-storage-engine=MyISAM.*** my.ini必须为ansi格 ...

  2. iOS -- MBProgressHUB

    高级: http://www.jianshu.com/p/485b8d75ccd4 //只有小菊花 - (void)indeterminateExample { // Show the HUD on ...

  3. 如何模拟alert/confirm/prompt实现阻断程序运行

    场景:在执行js的时候,我们希望运行到某处,进行用户交互,根据交互的内容,运行下面的程序:下面的js程序需要用的和用户交互的内容,所以,和用户交互时,后面的程序必须停止运行 方案: 1. 原生的ale ...

  4. DICOM医学图像处理:Deconstructed PACS之Orthanc,Modification & Anonymization

    背景: 上篇博文为引子,介绍了一款神奇的开源PACS系统——Orthanc.本篇开始解读官方Cookbook中的相关内容,对于简单的浏览.访问和上传请阅读前篇博文.在常规的PACS系统中还未出现对于D ...

  5. 【Todo】各种语言里面的for循环 & loop

    会的语言多了,不同语言的语法就会混淆.整理了一下. Java里面: 普通的for循环之外: 有以下格式: for (int x : intarr) { } JS里面: }; for (x in per ...

  6. Six ways to think like a journalist!

    Journalists have the ability to state a thing more clearly. What can we learn from them to help us r ...

  7. tempdb 相关总结

    /* -- 0. 高速压缩tempdb为初始值 USE tempdb DBCC SHRINKFILE(2,TRUNCATEONLY); */ -- 1. tempdb以下未回收的暂时表 ,某些版本号可 ...

  8. Jenkins系列之-—08 实现SQL脚本批量执行

    公司内部推广DevOps,所有目前在维护阶段和开发阶段项目全部配置上了自动发布.采用Jenkins+SVN+ANT,之后批量执行SQL语句的实现提上日程 一.环境 Linux环境 安装ANT工具,且下 ...

  9. 工作总结 mvc外键 public virtual SysUser TransferUser { get; set; } 必须要加 virtual 否则 TransferUser 值为null 还要加[ForeignKey("TransferUser")] Bind 和 ScaffoldColumn(转)

    [Table("T_SYS_TRANSFERUSER")] public class SysTransferUser : DbSetBase { [ForeignKey(" ...

  10. OpenCV for Python 学习笔记 二

    今天主要看了OpenCV中的事件以及回调函数,这么说可能不准确,主要是下面这两个函数(OpenCV中还有很多这些函数,可以在 http://docs.opencv.org/trunk/modules/ ...