Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FR: matrix fields #26

Open
bartrylant opened this issue Nov 29, 2022 · 6 comments
Open

FR: matrix fields #26

bartrylant opened this issue Nov 29, 2022 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@bartrylant
Copy link

Any idea when support for Matrix fields would come? Most of my sites have a matrix field per entry, where content editors can add block for subtitles, quotes, body text,… I'd love to send it all to Algolia, but I don't like manual configuration with php files :-)

@markmiddleton
Copy link
Contributor

Any idea when support for Matrix fields would come? Most of my sites have a matrix field per entry, where content editors can add block for subtitles, quotes, body text,… I'd love to send it all to Algolia, but I don't like manual configuration with php files :-)

I'd love to discuss your specific use case, so we make the update in a way that is useful.

For a matrix, it'll be a multidimensional array with the keys as the name(s) of the field(s). This shouldn't be too crazy to implement, I just want to make sure it's what you're looking for.

@markmiddleton markmiddleton added the enhancement New feature or request label Nov 29, 2022
@markmiddleton markmiddleton self-assigned this Nov 29, 2022
@markmiddleton
Copy link
Contributor

I'm using this as a sample set of data:

[
{
  "objectID": "sample-record-1",
  "slug": "sample-record-one",
  "postDate": 1667339760,
  "MatrixField": [
    {"TextFieldName": "Sample Text YYY"},
    {"ArrayOfNumbers": [0,1,2]},
    {"ArrayOfWords": ["one-a","two-a","three-a"]}
  ]
},
{
  "objectID": "sample-record-2",
  "slug": "sample-record-two",
  "postDate": 1667858580,
  "MatrixField": [
    {"TextFieldName": "Sample Text ZZZ"},
    {"ArrayOfNumbers": [0,1,2]},
    {"ArrayOfWords": ["one-b","two-b","three-b"]}
  ]
}
]

It looks like you can then target the Algolia configuration on MatrixField.TextFieldName or MatrixField.ArrayOfWords or whatever. I'll work on it this week and give you an update when I have something ready to test.

@bartrylant
Copy link
Author

bartrylant commented Nov 30, 2022

My use case is this:

section 1

  • title
  • intro
  • mainImage
  • body (= matrix field)
    --- subtitle
    --- quote
    --- text
    --- video
    --- table
    --- assets

section 2

  • title
  • mainImage
  • newsBody (= matrix field)
    --- subtitle
    --- quote
    --- text
    --- video
    --- table
    --- assets

section 3

  • title
  • image
  • text

It would be nice if there would be a control panel page, where I can just select which fields to sync to Algolia. E.g. I could select (with a checkbox)
section 1: title, intro, body with blocks of type subtitle, text, table
Or something similar

@markmiddleton
Copy link
Contributor

perfect. Ya, the control panel page for field selection is on the short roadmap... it's near the top of the list

@fgd007
Copy link

fgd007 commented Oct 19, 2023

Is there any update on this feature? I would love to include matrix fields as well to search index since it contains the majority of the content of a entry in my setup

@robinbeatty
Copy link

+1 for matrix support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants