在不指定字段名称的情况下查询Solr [英] Querying Solr without specifying field names
问题描述
我是Solr的新手,我一定很想念东西.
I'm new to using Solr, and I must be missing something.
我在示例架构中还没有涉及太多内容,因此我导入了一些示例数据.我还设置了LocalSolr
,这似乎运行良好.
I didn't touch much in the example schema yet, and I imported some sample data. I also set up LocalSolr
, and that seems to be working well.
我的问题只是查询Solr
.我有一个文档,其中名称字段设置为 tom .我一直在查看配置文件,但无法弄清楚哪里出错了.一堆字段已被索引并存储,我可以在admin中看到这些值,但无法获得查询以使其正常工作.我尝试了各种查询( http://server.com/solr/select/?q=值),结果如下:
My issue is just with querying Solr
in general. I have a document where the name field is set to tom. I keep looking at the config files, and I just can't figure out where I'm going awry. A bunch of fields are indexed and stored, and I can see the values in the admin, but I can't get querying to work properly. I've tried various queries (http://server.com/solr/select/?q=value), and here are the results:
**Query:** ?q=tom
**Result:** No results
**Query:** q=\*:\*
**Result:** 10 docs returned
**Query:** ?q=*:tom
**Result:** No results
**Query:** ?q=name:tom
**Result:** 1 result (the doc with name : tom)
我想让第一种情况(?q=tom)
工作.对于可能出问题的任何输入以及我如何纠正它的任何输入,我们将不胜感激.
I want to get the first case (?q=tom)
working. Any input on what might be going wrong, and how I can correct it, would be appreciated.
推荐答案
设置 <defaultSearchField>
在您的schema.xml中从a>到name
<defaultSearchField>
用于 解析查询以识别时进行Solr 应该在哪个字段名称中搜索 查询显式字段名称的位置 尚未使用.
The
<defaultSearchField>
Is used by Solr when parsing queries to identify which field name should be searched in queries where an explicit field name has not been used.
您可能还想查看(e)dismax .
这篇关于在不指定字段名称的情况下查询Solr的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!