Solr 在新字段上没有搜索结果
我向 schema.xml
添加了一个多值字段,如下所示:
<field name="fieldsharedsite" type="string" indexed="true" stored="false" multiValued="true" />
<field name="fieldsharedchannelnew" type="string" indexed="true" stored="false" multiValued="true" />
当我搜索文档内容时,我得到以下结果:
<fieldsharedsite><item key="0">33</item></fieldsharedsite>
<fieldsharedchannelnew><item key="0">52</item></fieldsharedchannelnew>
所以我确信 fieldsharedchannelnew
在结果
中我进行以下搜索: q=fieldsharedsite:33
我确实收到了文件 但当我这样做时 q=fieldsharedchannelnew:52
我没有得到任何结果。
fieldsharedsite
已经存在一段时间了,我正在尝试添加 fieldsharedchannelnew
。 我确实重新索引了所有内容,但对搜索没有帮助。
如果我查看架构浏览器,我会看到 fieldsharedsite
:
Field Type: string
Properties: Indexed, Multivalued, Omit Norms, Sort Missing Last
Schema: Indexed, Multivalued, Omit Norms, Sort Missing Last
Index: (unstored field)
Index Analyzer: org.apache.solr.schema.FieldType$DefaultAnalyzer
Query Analyzer: org.apache.solr.schema.FieldType$DefaultAnalyzer
Docs: 902
和 fieldsharedchannnelnew
我会看到:
Field Type: string
Properties: Indexed, Multivalued, Omit Norms, Sort Missing Last
Index Analyzer: org.apache.solr.schema.FieldType$DefaultAnalyzer
Query Analyzer: org.apache.solr.schema.FieldType$DefaultAnalyzer
在添加 fieldsharedchannelnew
索引时我错过了什么步骤?为什么我搜索时没有返回任何结果?
I added a multivalue field to schema.xml
as follows:
<field name="fieldsharedsite" type="string" indexed="true" stored="false" multiValued="true" />
<field name="fieldsharedchannelnew" type="string" indexed="true" stored="false" multiValued="true" />
When I search for a document contents, I get the following result:
<fieldsharedsite><item key="0">33</item></fieldsharedsite>
<fieldsharedchannelnew><item key="0">52</item></fieldsharedchannelnew>
so I am sure fieldsharedchannelnew
is in the results
When I do the following search:q=fieldsharedsite:33
I do get the document
but when I doq=fieldsharedchannelnew:52
I don't get any results.
fieldsharedsite
has been here for a while and I'm trying to add fieldsharedchannelnew
.
I did reindex all the content but did not help the search.
If I look at the schema browser, I have for fieldsharedsite
:
Field Type: string
Properties: Indexed, Multivalued, Omit Norms, Sort Missing Last
Schema: Indexed, Multivalued, Omit Norms, Sort Missing Last
Index: (unstored field)
Index Analyzer: org.apache.solr.schema.FieldType$DefaultAnalyzer
Query Analyzer: org.apache.solr.schema.FieldType$DefaultAnalyzer
Docs: 902
and for fieldsharedchannnelnew
I have:
Field Type: string
Properties: Indexed, Multivalued, Omit Norms, Sort Missing Last
Index Analyzer: org.apache.solr.schema.FieldType$DefaultAnalyzer
Query Analyzer: org.apache.solr.schema.FieldType$DefaultAnalyzer
What step did I miss in adding the fieldsharedchannelnew
index? Why its not returning any results when I search for it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
fieldsharedchannnelnew 字段的架构浏览器结果并不表明它已填充到文档中。
Docs 信息缺失,对于 fieldsharedsite,它显示它存在于 902 个文档中。
当我搜索文档内容时,得到以下结果:
由于未存储字段,因此字段不会随结果一起返回。
这是您向 Solr 提供的数据吗?它们如何出现在结果中?
您是按原样使用 value 还是想使用 copyfield ?
您可以将字段标记为已存储并重新索引内容并检查它们是否随结果一起返回,并且架构浏览器是否显示文档信息。
如果是这样,您也应该能够搜索它。
The schema browser result for the field fieldsharedchannnelnew does not indicate it is populated in the documents.
the Docs information is missing, as for fieldsharedsite which shows it exists in 902 docs.
When I search for a document contents, I get the following result:
As the fields are not stored, the fields would not be returned with the results.
Is this the data you are feeding Solr ? how do they appear in results ?
Are you using value as is or want to use copyfield ?
You may mark the fields as stored and reindex the contents and check if they are returned with the results and the schema browser shows the Docs information.
If so, you should be able to search it as well.