solr - Solr 查询中的双引号

标签 solr lucene

我无法找出这个 solr 查询中的双引号的含义。

查询为q=%2B"My+helper+product"+My+helper+product。它是一个 edismax 查询

%2B 代表“+”号,其他 + 号代表空格,因为它是一个 URI 请求,但我不明白双引号和重复是什么。

我是 solr 的新手,一开始它让人不知所措。你能帮我一下吗?

最佳答案

语法因您使用的查询解析器而异,但 edismax 解析器支持标准 lucene 语法(这就是此处使用的语法)。 edismax 处理程序有一个名为 qf 的参数,它告诉 Solr 应搜索哪些字段(即查询 (q) 将针对哪些字段运行)。

query syntax for standard lucene queries explains that the + means该术语需要出现。

The "+" or required operator requires that the term after the "+" symbol exist somewhere in a the field of a single document.

To search for documents that must contain "jakarta" and may contain "lucene" use the query:

+jakarta lucene

报价wraps a sequence of words that should be found - 即按顺序,而不仅仅是单个术语。

You can search any field by typing the field name followed by a colon ":" and then the term you are looking for.

As an example, let's assume a Lucene index contains two fields, title and text and text is the default field. If you want to find the document entitled "The Right Way" which contains the text "don't go this way", you can enter:

title:"The Right Way" AND text:go

其他单词是为了在不按顺序排列的情况下给出命中,但由于第一个术语是必需的,我认为它们的作用只不过是为在外部多次包含该术语的文档提供更高的分数单词按顺序出现的位置。这些单词将出现在仅存在“产品”的位置,或者内容包含product helper my的位置。

关于solr - Solr 查询中的双引号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46682316/

相关文章:

java - 安装Chronix

lucene - 如何提高单字符PrefixQuery性能?

Elasticsearch 通过函数分数提升每个字段

SOLR的XML结果

mongodb - NoSQL (MongoDB) vs Lucene (或 Solr) 作为你的数据库

java - IndexWriter.commit() 不足以更改索引

java - Infinispan 软索引文件存储问题

lucene 短语查询不起作用

java - 当我在字段类型中添加 "spatialContextFactory"属性时,Solr Core 未加载

postgresql - 如何使用CKAN API按多个标签搜索数据集?