Solr-如何在所有字段中搜索而不传递查询字段? [英] Solr - How to search in all fields without passing query field?

查看:289
本文介绍了Solr-如何在所有字段中搜索而不传递查询字段?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试了以下方法,

<field name="collector" type="text_general" indexed="true" stored="false"  multiValued="true" />

并将我的所有字段复制到 copyField ,如下所示,

and copy all my fields to copyField as below,

<copyField source="fullname" dest="collector"/>
<copyField source="email" dest="collector"/>
<copyField source="city" dest="collector"/>

并且我已经将所有 copyField 标签放在

and also I have put all copyField tags below

<fields>

</fields>

标签.但是我无法在所有领域进行搜索.我必须先通过全名进行查询,

tags. But I cant search in all fields. I have to pass fullname before query like,

q=fullname:Mayur

我要搜索依据,

q=Mayur

我应该搜索所有包含 Mayur 字词的字段.

And I should search all fields contains Mayur word.

请帮助我

推荐答案

确保字段已存储= true

make sure the fields have stored=true

<field name="field_name" type="text_general" indexed="true" stored="true"/>

确定在搜索过程中是否可以检索该字段的值.

True if the value of the field should be retrievable during a search.

使用默认搜索字段: Solr在解析查询以标识应为哪个字段名称时使用 在未使用显式字段名称的查询中搜索.

Use the Default Search Field : The 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.

<defaultSearchField>collector</defaultSearchField>

在您的schema.xml中

in your schema.xml

这篇关于Solr-如何在所有字段中搜索而不传递查询字段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆