首页 > 其他分享 >bleve搜索引擎是支持基于field搜索的

bleve搜索引擎是支持基于field搜索的

时间:2023-05-31 16:04:11浏览次数:48  
标签:water 搜索引擎 will field bleve query Query Example

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.

标签:water,搜索引擎,will,field,bleve,query,Query,Example
From: https://blog.51cto.com/u_11908275/6387706

相关文章

  • 序列化Java对象重命名字段,@JSONField、@JsonProperty、@SerializedName
    @JSONField主要用于返回出参转换这个注解分别可以注解在实体类的属性、setter和getter方法上publicclassTest{/*注解在属性上的时候可以设置一些序列化、格式化的属性@JSONField(serialize=false)---->序列化的时候忽略这个属性@JSO......
  • resetFields失效与$nextTick
     这个问题会比较常见。我们经常会遇见这么写:update和add共用一个弹窗。update时,表单回显;add时,需要清空表单。  我们可能会用到Element-Ui表单的resetFields()方法,但是如果操作不当,这个resetFields()方法并不会生效。官网对这个方法的定义:resetFields: 对整个表单进行......
  • django之对FileField字段的upload_to的设定
       用django开发,经常要处理用户上传的文件,比如user模型里面如果又个人头像的字段ImageField等等,而django在FielField字段(包括ImageField)的支持和扩展是做的很好的,首先一个问题,是上传的文件,django是放到哪里去了,(note:文件流是不会放到数据库里面的,该字段在数据库中只存储路......
  • 【注解使用】使用@Autowired注解警告Field injection is not recommended
    本文目录一、背景描述二、出现原因2.1不允许声明不可变域2.2容易违反单一职责设计原则2.3与依赖注入容器紧密耦合2.4隐藏依赖关系三、解决方案3.1使用@Resource3.2使用于构造函数的依赖注入3.3使用于Setter的依赖注入3.4个人总结四、参考文档Fieldinjectionisnotrecomm......
  • ElasticSearch搜索引擎
    为什么要用elasticsearch?作用是什么?https://blog.csdn.net/bugeiban001/article/details/126652894安装及使用https://elasticstack.blog.csdn.net/article/details/102728604......
  • django 计算两个TimeField的时差
    在Django中,你可以使用datetime模块来计算两个TimeField字段的时间差。以下是一个示例:fromdatetimeimportdatetime,timedelta#假设有两个TimeField字段time1=obj.time_field1time2=obj.time_field2#将时间字段转换为datetime对象datetime1=datetime......
  • django:DateTimeField如何自动设置为当前时间并且能被修改
    创建django的model时,有DateTimeField、DateField和TimeField三种类型可以用来创建日期字段,其值分别对应着datetime()、date()、time()三中对象。这三个field有着相同的参数auto_now和auto_now_add,表面上看起来很easy,但实际使用中很容易出错,下面是一些注意点。DateTimeField.auto_no......
  • Field userClient in com.demo.order.service.OrderService required a bean of type'
    在SpringCloud项目中使用Feign进行远程调用遇到的错误。原因是因为UserClient在com.demo.feign.clients包下面,而order-service的@EnableFeignClientd注解却在com.demo.order包下面,这两个不在同一个包下,无法扫描到UserClient。解决方法有两种1.指定Feign应该扫描的包@EnableFeig......
  • Solr搜索引擎的简介
     Solr是一个基于Lucene的搜索引擎,它能够快速、可靠、强大地处理大量数据。Solr提供了一个HTTP接口,可以通过Java、Python、PHP等多种编程语言进行访问。Solr是一个开源的项目,由Apache软件基金会维护。Solr的主要特点包括:快速:Solr使用Lucene的索引技术,能够快速地处理大量的数据......
  • Solr搜索引擎的简介
     Solr是一个基于Lucene的搜索引擎,它能够快速、可靠、强大地处理大量数据。Solr提供了一个HTTP接口,可以通过Java、Python、PHP等多种编程语言进行访问。Solr是一个开源的项目,由Apache软件基金会维护。Solr的主要特点包括:快速:Solr使用Lucene的索引技术,能够快速地处理大量的数据......