简体   繁体   English

Solr 为 Typo3:不在动态字段中搜索

[英]Solr for Typo3: not searching in dynamic fields

I'm using the Typo3 Solr Extension 2.8.3 and added some dynamic fields into the typoscripts definition.我正在使用 Typo3 Solr Extension 2.8.3 并在错别字定义中添加了一些动态字段。

So for example, there is a dynamic field defined for plugin.tx_solr.index.queue.tx_news.author_stringS = author among the other typical definitons.因此,例如,在其他典型定义中,有一个为plugin.tx_solr.index.queue.tx_news.author_stringS = author定义的动态字段。

It seems that the dynamic fields are not put into the index automatically.似乎动态字段没有自动放入索引中。

Is there a way to tell solr how to index dynamic fields too?有没有办法告诉 solr 如何索引动态字段? - But using the typoscripts config ONLY. - 但仅使用错别字配置。 I don't like to touch the schema definition.我不想触及架构定义。

Did you initialize the index queue after adding your dynamic field? 添加动态字段后,您是否初始化了索引队列? If so, check in your Solr Admin if the field was added and if there is any content in it. 如果是这样,请在Solr Admin中检查是否添加了该字段以及其中是否包含任何内容。

Adding fields without changing the schema definitely works out of the box. 在不更改架构的情况下添加字段绝对是开箱即用的。

EDIT: 编辑:

Adding fields to the Solr index doesn't mean that they are used for the search query. 将字段添加到Solr索引并不意味着它们用于搜索查询。 You must include your dynamic field also to the query using TypoScript. 您还必须使用TypoScript将动态字段包括在查询中。

See the official documentation: 请参阅官方文档:

http://forge.typo3.org/projects/extension-solr/wiki/Tx_solrsearch#queryfields http://forge.typo3.org/projects/extension-solr/wiki/Tx_solrsearch#queryfields

That should do the trick:这应该够了吧:

plugin.tx_solr.search.query.queryFields = author_stringS^10.0

I suggest you use author_textS to make it more flexible in the search.我建议您使用author_textS使其在搜索中更加灵活。 *_stringS is exact and case sensitive. *_stringS 准确且区分大小写。

If you set queryFields don't forget to add every other fields you want to be included in the search:如果您设置queryFields ,请不要忘记添加您希望包含在搜索中的所有其他字段:

plugin.tx_solr.search.query.queryFields = content^40.0, title^5.0, keywords^2.0, tagsH1^5.0, tagsH2H3^3.0, tagsH4H5H6^2.0, tagsInline^1.0, description^4.0, author_textS^10.0

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM