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

@Amin does this search your builder mixin?

I’m trying to sort out a similar thing. I have a similar setup to you initially, but my Builder mixin has more groups/mixins in it. These are what I’d like to be searched but I’m not sure if it’s possible.

I’ve tried adding ‘builder’ to the searchFields property, but I just get a column not found in database error. Which makes sense.

Any advice on what I need to do to be able to search through these nested mixins?

Here are my blueprints.

# Page.yaml

handle: Content\Page
type: structure
name: Pages

primaryNavigation:
  label: Pages & Menus
  icon: ph ph-browsers
  order: 140

siteSearch:
  providerBadge: Builder
  pageName: 'page'
  urlParams:
    fullslug: $slug
  searchFields:
    - title
    - content
  resultFields:
    - title
    - content

groups:

  builder:
    name: Builder
    fields:
      builder:
        tab: Edit
        type: mixin
        name: Builder
        source: Content\Builder
      seo_fields:
        tab: Manage
        type: mixin
        name: SEO Fields
        source: Content\SEOFields

  simple:
    name: Simple Page
    fields:
      content:
        label: Content
        tab: Edit
        type: richeditor
        span: adaptive
        column: false
        scope: false
      seo_fields:
        tab: Manage
        type: mixin
        name: SEO Fields
        source: Content\SEOFields
# Builder.yaml

handle: Content\Builder
type: mixin
name: Builder

fields:
  builder:
    type: repeater
    label: Builder
    displayMode: builder
    span: adaptive

    groups:

      hero:
        name: Hero
        icon: icon-window-maximize
        description: A section with a background image
        useTabs: true
        fields:
          hero:
            type: mixin
            source: Content\Hero

      cards:
        name: Cards
        icon: icon-columns
        description: A row of cards
        useTabs: true
        fields:
          grid:
            type: mixin
            source: Content\Cards

      media_panel:
        name: Media Panel
        icon: icon-clone
        description: White panel on image or video
        useTabs: true
        fields:
          media_panel:
            type: mixin
            source: Content\MediaPanel

      banner:
        name: Banner
        icon: icon-flag-o
        description: A branded banner section
        useTabs: true
        fields:
          banner:
            type: mixin
            source: Content\Banner

      accordion:
        name: Accordion
        icon: ph ph-caret-double-down
        description: FAQ Style accordion
        useTabs: true
        fields:
          accordion:
            type: mixin
            source: Content\Accordion