`

Solr:Performing queries and handling results

    博客分类:
  • Solr
 
阅读更多

The anatomy of a Solr request

Request handlers

Request handlers are the entry points for essentially all requests to Solr. Their job is to receive a request, perform some function, and return a response to the client.



 

 

http://localhost:8983/solr/collection1/select/
http://localhost:8983/solr/collection1/update/
http://localhost:8983/solr/collection1/replication/
http://localhost:8983/solr/collection1/private/search/

 

Search components

Search components are configurable processing steps that occur within the lifetime of a search handler. Search components allow a search handler to chain together reusable pieces of functionality that can be executed with a single search request.Search components are configured in solrconfig.xml



 



 

 

Out of all the search components in the search handler, the query component is the most important, as it’s responsible for initially running the query and making the results available in the response (and for other search components to make use of afterward). The query component makes use of a query parser to interpret the incoming query from the request to the search handler.

 

Query parsers

Query parsers are used to interpret a search syntax into a Lucene query for finding a desired set of documents.



 ------------------------------------------------------------------------------------------------------------------------------------

Working with query parsers

When executing a search, QueryComponent handles the primary user query (the q parameter) by passing its value along to a query parser. As mentioned in  lathest section, LuceneQParserPlugin is the default query parser in Solr.

 

Specifying a query parser

The default query parser type to be used for the QueryComponent can be modified using the defType parameter on the search request:

/select?defType=edismax&q=...
/select?defType=term&q=...

/select?q={!edismax}hello world
/select?q={!term}hello
/select?q={!edismax}hello world OR {!lucene}title:"my title"

 

Local params

Local params provide the ability to localize request parameters to a specific context.Typically you will pass request parameters to Solr on the URL, but sometimes you may only want some parameters to be applied to certain parts of the query. Within the context of a query, local params allow you to pass request parameters only to the specific query parser that you want to consider them, as opposed to making all request parameters global.

LOCAL PARAMS SYNTAX
{!param1=value1 param2=value2 ... paramN=valueN}

 

/select?q=hello world&defType=edismax&qf=title^10 text&q.op=AND
||
/select?q={!defType=edismax qf="title^10 text" q.op=AND}hello world

The real difference between these two queries is that, in the first example, all of the request parameters are global.

PARAMETER DEREFERENCING
/select?q={!edismax v=$userQuery}&userQuery="hello world"
----------------------------------------------------------------------------------------------------------------------------------
Queries and filters
A search in Solr is composed of two main operations—finding the documents that match the request parameters and ordering those documents so that only the top matches need to be returned.
The fq and q parameters
what is the difference between the q and fq parameters? fq serves a single purpose: to limit your results to a set of matching documents.The q parameter, in contrast, serves two purposes:
  1. To limit your results to a set of matching documents
  2. To supply the relevancy algorithm with a list of terms to be used for relevancy scoring
 

 
The default query parser (Lucene query parser)
The default query parser in Solr is confusingly called the Lucene query parser (implemented in the class LuceneQParserPlugin)
  1. The Lucene query parser includes an expressive syntax for creating arbitrarily complex Boolean queries, but it has a few major drawbacks that make it less than ideal for handling user queries. The most problematic of these is that the Lucene query parser expects a strict syntax that, if broken, will throw an exception. Because it’s often unreasonable to expect your users to understand and always enter perfect Lucene query syntax when typing in their keywords, this relegates the Lucene query parser to not being user-friendly enough for many applications.
  2. An additional drawback of the Lucene query parser is its inability to search across multiple fields by default.

-----------------------------------------------------------------------------------------------------------------------------------

Handling user queries (eDisMax query parser)

The eDisMax query parser is essentially a combination of two other query parsers, the Lucene query parser and Disjunction Max (DisMax) query parser.

 

 

 

 

 

 

 

 

 


 

 

 

 

 

 

 

 

 

 

 

 

 

  • 大小: 76 KB
  • 大小: 41.5 KB
  • 大小: 74.8 KB
  • 大小: 40.7 KB
  • 大小: 68.9 KB
  • 大小: 101.7 KB
分享到:
评论

相关推荐

    node-solr:Node.js 的 Solr 模块

    Node.js 的 Solr 模块参考Node.js: : Solr: : 使用npm test运行测试。 如果您没有在 127.0.0.1:8983 上运行 Solr,请编辑“test/common.js”。使用示例请参阅使用测试。 这是一个快速示例: var solr = require ( ...

    Solr in action.mobi

    7 ■ Performing queries and handling results 197 8 ■ Faceted search 250 9 ■ Hit highlighting 281 10 ■ Query suggestions 306 11 ■ Result grouping/field collapsing 330 12 ■ Taking Solr to ...

    puppet-ispconfig_solr:在 IspConfig 环境中使用的 solr 包装器

    == 定义:ispconfig_solr::instance 这个定义是 solr::instance 的包装器。 它创建一个 solr 实例并配置它以在 IspConfig 环境中使用 == 参数: [ instance_name ] solr 实例的名称。 实例将被称为 solr-$...

    docker-solr:用于Solr的Docker构建,用于管理官方Docker Hub solr映像

    什么是Apache Solr:trade_mark:? Apache Solr具有高度的可靠性,可扩展性和容错性,可提供分布式索引,复制和负载平衡查询,自动故障转移和恢复,集中式配置等。 Solr为许多世界上最大的互联网站点提供搜索和导航...

    solr:Allegro Common Lisp与Solr的接口

    这是Allegro CL的Solr绑定。 Solr是来自Apache Lucene项目的开源自由文本索引/搜索平台。 有关详细信息,请参见以下URL。 该软件包允许Allegro CL应用程序与正在运行的Solr服务器通信,添加和删除文档以及运行查询以...

    lucene-solr:Apache Lucene和Solr开源搜索软件

    Solr: : 用Gradle构建 建筑Lucene 参见 。 建筑太阳能 首先,您需要设置开发环境(OpenJDK 11或更高版本)。 我们假设您知道如何获取和设置JDK-如果您不了解,那么我们建议您从开始并进一步了解

    solr -8.11.1.zip 文件

    solr -8.11.1.zip 文件

    docker-compose 构建以solr8.11.1为基础的含中文分词器的镜像

    以solr8.11.1为基础镜像,使用docker-compose构建含中文分词器的新的镜像 文件夹内含有docker-compose.yml脚本、Dockerfile脚本以及构建镜像所需中文分词器ik-analyzer-8.5.0.jar、所有扩展词和停用词相关的配置文件...

    solr笔记solr笔记

    2. 解压 Solr:解压 Solr 的安装包,包括 Bin、Contrib、Dist、Docs、Example、Solr、Multicore、Webapps、Licenses 等目录。 3. 安装 SolrCore:SolrCore 是 Solr 的核心组件,需要安装和配置 SolrCore。 4. 配置 ...

    mir-solr:MIR SOLR配置

    "mir-solr:MIR SOLR配置"是一个与Solr相关的项目,可能涉及到在MIR(可能是某种特定的系统或框架)中集成和配置Apache Solr的细节。Apache Solr是一个开源的全文搜索引擎,常用于大数据量、高性能的搜索应用。在MIR...

    mod_search_solr:用于 Solr 支持的 Zotonic 模块

    它内置了 Solr:只需安装此模块即可。 设置完成后,Zotonic 会将其保存的每个资源推送到 Solr,以便可以查询数据库。 要将整个站点重新索引到 Solr,请按管理员中的“重建搜索索引”按钮。 安装 您需要为每个要为...

    java8看不到源码-ansible-role-solr:yauh.solr-用于设置Solr的Ansible角色

    看不到源码Solr 引导程序 设置 Solr 搜索平台的 Ansible 角色 要求 系统上需要有Java,推荐角色yauh.java8。 角色变量 以下变量可与 solr 角色一起使用: solr_source: http://apache.openmirror.de/lucene/solr # ...

    solr5.4.0完整包

    Solr 依存于Lucene,因为Solr底层的核心技术是使用Lucene 来实现的,Solr和Lucene的本质区别有以下三点:搜索服务器,企业级和管理。...所以说,一句话概括 Solr: Solr是Lucene面向企业搜索应用的扩展。

    data_solr:CreateIndexBySolr

    本项目"**data_solr:CreateIndexBySolr**"聚焦于如何使用Solr的Java客户端库SolrJ来创建索引,并进行搜索操作。我们将深入探讨这个过程中的关键概念和技术细节。 首先,让我们了解**Solr**的基本概念。Solr是基于...

    Solr:将solr与spring boot一起使用

    Spring Boot和Solr 在这个示例中,我们看到如何将spring boot与solr一起用作数据库: Sprint Boot平板电脑索尔我们要做的第一件事是在solr de vehicle中创建模式以保存车辆的信息。 使用此命令,我们将使用bash脚本...

    Laravel-4-Solr:Apache Solr简单查询客户端

    Laravel 4 Apache Solr Laravel 4软件包提供了一个接口,用于通过其静态接口使用(查询) 。安装首先通过Composer安装此软件包。 编辑项目的composer.json文件,以要求davispeixoto/laravel-4-solr 。 "require": {...

    nodebb-plugin-solr:使用Apache Solr全文搜索NodeBB

    Solr搜索NodeBB : Solr(发音为“ solar”)是来自Apache Lucene项目的开源企业搜索平台。 它的主要功能包括全文搜索,命中突出显示,多面搜索,动态聚类,数据库集成以及丰富的文档(例如Word,PDF)处理。 此...

    cl-solr:用于 Common Lisp 的 Apache Solr API

    "cl-solr:用于 Common Lisp 的 Apache Solr API" 这个标题揭示了我们讨论的主题是一个名为 "cl-solr" 的软件库,它为 Common Lisp 编程语言提供了与 Apache Solr 的接口。Apache Solr 是一个流行的开源搜索引擎,...

    solr:Apache Solr开源搜索软件

    阿帕奇·索尔(Apache Solr) Apache Solr是一个用Java编写并使用的企业搜索平台。 主要功能包括全文搜索,索引复制和分片以及结果分面和突出显示。在线文件此自述文件仅包含基本的安装说明。 有关更全面的文档,请...

    spring-data-solr:通过spring对solr数据的增删该查,进行封装

    **Spring Data Solr:通过Spring对Solr数据的增删改查封装** Spring Data Solr是Spring Data项目的一部分,它为Apache Solr搜索引擎提供了一种简单而强大的集成方式。Spring Data Solr允许开发者利用Spring框架的...

Global site tag (gtag.js) - Google Analytics