Ad

Solr And TYPO3 Faceting

- 1 answer

I've created a field called "international" in my TYPO3 project. This field is a checkbox and is displayed on my backend with an associated label.

'international' => [
    'exclude' => FALSE,
    'label' => 'LLL:EXT:projects/Resources/Private/Language/locallang_db.xlf:tx_projects_domain_model_requestprojects.international',
    'config' => [
        'type' => 'check',
        'items' => [
            // label, value
            ['LLL:EXT:projects/Resources/Private/Language/locallang_db.xlf:tx_projects_domain_model_requestprojects.international.items.1', 1],
        ],
    ]
],

If I go to my frontend, the faceting is indeed showing the field as link to filter my content thanks to this :

fieldRenderingInstructions {

    international =< plugin.tx_solr.search.faceting.facets.international.renderingInstruction
    international.field = international_intS
}

faceting {
  facets.international {
    label.data = LLL:EXT:skin/Resources/Private/Language/locallang.xlf:tx_projects_domain_model_requestprojects.international
    field = international_intS
    renderingInstruction = TEXT
    renderingInstruction {
        field = optionValue
        wrap = {LLL:EXT:projects/Resources/Private/Language/locallang_db.xlf:tx_projects_domain_model_requestprojects.international.items.|}
        insertData = 1
    }
  }
}

Starting with this, I have 2 questions:

  1. Why does my content which have the field "international" not selected are triggering an "extra faceting" this the name of my root page?

If I have 2 "international" and 3 "international" not checked, my facets returns "international (2)" and "root page (3)" ? (the 3 have an empty value)

  1. How can I hide this facet, but keep getting the value that was set to my content ?

I need to hide this facet on front (but probably I will have to fix the "bug" from 1), but keep the given value.

Ad

Answer

That was quite simple, actually.

Just added this in my facet

  includeInAvailableFacets = 0
Ad
source: stackoverflow.com
Ad