Bolt\Storage\Query\SearchConfig::parseTaxonomies PHP Method

parseTaxonomies() protected method

Iterates the taxonomies for a given ContentType, then assigns a weighting based on type.
protected parseTaxonomies ( string $contentType, array $taxonomies ) : void
$contentType string
$taxonomies array
return void
    protected function parseTaxonomies($contentType, $taxonomies)
    {
        foreach ((array) $taxonomies as $taxonomy) {
            $taxonomyConfig = $this->config->get('taxonomy/' . $taxonomy);
            if (isset($taxonomyConfig['searchweight'])) {
                $weight = $taxonomyConfig['searchweight'];
            } elseif (isset($taxonomyConfig['behaves_like']) && $taxonomyConfig['behaves_like'] === 'tags') {
                $weight = 75;
            } else {
                $weight = 50;
            }
            $this->searchableTypes[$contentType][$taxonomy] = ['weight' => $weight];
            $this->joins[$contentType][] = $taxonomy;
        }
    }