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. BT中的磁力链接(转)

    注意:磁力链接不是迅雷的,而是BT网络中的一种协议. 磁力链接与种子文件 磁力链接并不是一个新概念,早在2002年,相关的标准草稿就已经制定了.但直到2012年海盗湾为规避版权问题删除了站点上的所有T ...

  2. 详解JavaScript变量提升

    变量在程序中随处可见.它们是一些始终在相互影响,相互作用的的数据和逻辑.正是这些互动使应用程序活了起来. 在JavaScript中使用变量很重要的一方面就是变量的提升 —— 它决定了一个变量何时可以被 ...

  3. SpringUtils写法

    @Componentpublic class SpringUtils implements ApplicationContextAware { @Override public void setApp ...

  4. Go -- socket read的内容以16进制输出

    buf := make([]) reqLen, err := conn.Read(buf) // 遍历, 转为16进制 buffer := new(bytes.Buffer) for _, b := ...

  5. python 使用cx-freeze打包程序

    python环境 3.6.5      win7   linux环境同理 先尝试了PyInstaller   ,打包时一直提示 no module named gtk   而gtk 又依赖pygobj ...

  6. 从SDCard获取的图片按分辨率处理的方法

    前段时间公司开发的Launcher要做主题切换的功能,但切换主题时须要从sdcard中获取要切换的图片资源,拿到后图片的大小不正常. 后来查找原因是:系统对不同分辨率拿到的图片资源会自己主动的做转化, ...

  7. Win7安装软件,界面上中文显示乱码的解决方案

    “Control panel”->"Clock,Language and Region"->"Region and Language"->第四 ...

  8. 求助大神!怎样除去XML节点反复的值的数据

    <?xml version="1.0" encoding="utf-8"? > <UpdCfg> <Upgrade> < ...

  9. 以goroutine为例看协程的相关概念

    转自  http://wangzhezhe.github.io/blog/2016/02/17/golang-scheduler/ 基本上是网上相关文章的梳理,初衷主要是想了解下golang中的gor ...

  10. 无法获取html元素宽高度的问题

    今天遇到了xxx.style.width无法获取元素宽度的问题,原来一直没有注意到这个小细节: 1)如果width:120px:是写在样式表里面的,获取宽度或者高度的方法是: xxx.offsetWi ...