Skip to content

Adding ACF Flexible Content Layout fields to schema #11

@joshuaiz

Description

@joshuaiz

Hello,

The bulk of the content on the site I'm working on is in ACF Flexible Content Layout fields on Posts and Pages.

I'm assuming I would have to add the schema for these fields for them to be indexed in search. I have roughly 20 layouts, each with its own subfields. What is the best way to include all of these fields in the schema?

Additionally, what are the options for type in this fields array:

'fields' => [
    [ 'name' => 'post_content', 'type' => 'string' ],
    [ 'name' => 'post_title', 'type' => 'string' ],
    [ 'name' => 'post_type', 'type' => 'string' ],
    [ 'name' => 'post_author', 'type' => 'string' ],
    [ 'name' => 'comment_count', 'type' => 'int64' ],
    [ 'name' => 'is_sticky', 'type' => 'int32' ],
    [ 'name' => 'post_excerpt', 'type' => 'string' ],
    [ 'name' => 'post_date', 'type' => 'string' ],
    [ 'name' => 'post_id', 'type' => 'string' ],
    [ 'name' => 'post_modified', 'type' => 'string' ],
    [ 'name' => 'id', 'type' => 'string' ],
    [ 'name' => 'permalink', 'type' => 'string' ],
    [ 'name' => 'post_thumbnail', 'type' => 'string' ],
    [ 'name' => 'genre', 'type' => 'string[]', 'facet' => true ]
],
// ...

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions