简体   繁体   English

如何在 TYPO3 SOLR 中未填写字段值或字段的方面

[英]How do I facet for a field value OR field not filled in TYPO3 SOLR

My problem is the following:我的问题如下:

I have some courses as solr documents and there I have a multi value field in solr, that contains degree requirements for those courses (requirements_stringM).我有一些课程作为 solr 文档,并且在 solr 中有一个多值字段,其中包含这些课程的学位要求 (requirements_stringM)。 In this field I have values like 'diploma', 'master', 'bachelor' etc.. So a course has listet all the possible requirements, which enable a user to take part.在这个领域,我有“文凭”、“硕士”、“单身汉”等值。因此,一门课程列出了所有可能的要求,使用户能够参与。 Beside this I have courses without any requirement -> the field is empty, so it doesn't exist in the certain course document.除此之外,我还有没有任何要求的课程-> 该字段为空,因此它不存在于某个课程文档中。

Now I need to facet for the requirements in the way, that someone checks one or more of those requirements and in the result I have all the courses the user can attend.现在我需要以某种方式处理要求,有人检查其中一项或多项要求,结果我拥有用户可以参加的所有课程。 This means: All courses, where the selection meets the field values of requirements_stringM AND all courses without any requirement (means no requirements_stringM field in the solr document at all)!这意味着:所有课程,其中选择满足 requirements_stringM 的字段值所有没有任何要求的课程(意味着 solr 文档中根本没有 requirements_stringM 字段)!

In a plain SOLR query I would write it this way: -(-requirements_stringM:diploma -requirements_stringM:master requirements_stringM:*) .在一个简单的 SOLR 查询中,我会这样写: -(-requirements_stringM:diploma -requirements_stringM:master requirements_stringM:*)

How can I achieve this with TYPO3 ext:solr?如何使用 TYPO3 ext:solr 实现这一点?

PS: I wanted to write my own facet, but in the current version the composition of those facet filter values happens in the central Faceting modifier instead of within a special facet type class. PS:我想编写自己的构面,但在当前版本中,这些构面过滤器值的组合发生在中央构面修饰符中,而不是在特殊构面类型类中。 So I would have to overwrite this modifier to change stuff this way.所以我必须覆盖这个修饰符才能以这种方式改变东西。

Thank you for answers谢谢你的回答

TYPO3 v10 ext:solr v11.0.4 SOLR v8.5.2 TYPO3 v10 ext:solr v11.0.4 SOLR v8.5.2

What about adding all variants to those documents which don't have any requirement?将所有变体添加到那些没有任何要求的文档中怎么样? Additionally I would add a custom field which can be used in the template to differ between having requirements or not此外,我会添加一个自定义字段,可在模板中使用该字段来区分是否有要求

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

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