OFFLINE-SiteSearch & Tailor

Hi guys,

Does anyone have any experience with the OFFLINE SiteSearch and Tailor?
The search works so far but it doesn’t seem to work when I use it in a blueprint with groups.

From the documentation:

# your-blueprint.yaml
siteSearch:
    providerBadge: MyEntry # Display this beside each search result.

    pageName: 'cms-page'   # Filename of the target CMS page, used to build links.
    urlParams:             # Given a page URL: /target-cms-page/:slug/:something
    - slug: $slug          # Use the value of the "slug" field, since it is prefixed with a "$"
    - something: else      # Use the literal string "else", since there is no $-prefix
                           # the output is: /target-cms-page/slug-field-value/else

    # See "Custom URL Resolver" below
    # This is used *instead of* pageName + urlParams
    urlResolver: '\App\Provider::resolveSiteSearchUrl'

    searchFields:          # Fields to search in.
    - title
    - description
    - something_elase

    resultFields:
        title: title       # Use the "title" field as the search result title
        text: description  # Use the "description" field as the search result text

Is it possible to nest the searchFields or something?

Maybe you can help me @OFFLINE-TK

Do you have a blueprint to share?

The search of Tailfor fields happens here: oc-site-search-plugin/TailorResultsProvider.php at develop · OFFLINE-GmbH/oc-site-search-plugin · GitHub

of course. here is my blueprint:

uuid: 206721ee-160c-4167-8162-2bb05aa68e99
handle: Website\Page
type: structure
name: Page
multisite: sync
drafts: true

customMessages:
    buttonCreate: Create new page

primaryNavigation:
    label: Website
    icon: 'bi-window-sidebar'
    order: 100

navigation:
    label: Pages
    icon: 'bi-layout-text-window-reverse'
    parent: Website\Page
    order: 1

siteSearch:
    providerBadge: Page
    urlResolver: '\App\Provider::resolveSiteSearchUrl'
    searchFields:
    - title
    - content
    - answer
    resultFields:
        title: title
        text: content

groups:
    simple:
        name: Simple Page
        fields:
            title:
                placeholder: Page title
            content:
                tab: Content
                label: Content
                type: richeditor
                column: invisible
                scope: false
                span: adaptive
            _seo_fields:
                tab: SEO
                type: mixin
                name: SEO Fields
                source: Website\SEOFields
                column: invisible
                scope: false
            _page_settings:
                tab: Settings
                type: mixin
                name: Page Settings
                source: Website\PageSettings
                permissions: single_page_settings
                column: invisible
                scope: false
    builder:
        name: Dynamic Page
        fields:
            title:
                placeholder: Page title
            _builder:
                tab: Content
                type: mixin
                name: Builder
                source: Website\Builder
                span: adaptive
            _seo_fields:
                tab: SEO
                type: mixin
                name: SEO Fields
                source: Website\SEOFields
                column: invisible
                scope: false
            _page_settings:
                tab: Settings
                type: mixin
                name: Page Settings
                source: Website\PageSettings
                permissions: single_page_settings
                column: invisible
                scope: false

Thanks for your help!

Can you check if this works for you in v1.7.2?

The title and content fields from your example should be search correctly now. I’m not sure where the answer field comes from, so this probably won’t work.

Hi, I just tested it
unfortunately it doesn’t work for me yet.
And yes, the answer field didn’t belong there at all :sweat_smile:

If you dd($fields) here, are your fields present?

so…I did a bit of testing and noticed the following:

The dump shows all fields of the blueprint in which siteSearch was integrated. However, only from one Blueprint. If I comment out the siteSearch in all other blueprints, the search in the content field from the post earlier works. That means… if the siteSearch is integrated in another Blueprint, it no longer works.

Thank you! I was able to reproduce this issue and fix it in v1.7.3.

Could you confirm that the Tailor integration is now working for you?

1 Like

yes, now it works. Thanks!

3 Likes