Source Fields in Elasticsearch Index are arrays

Created on 5 June 2018, over 7 years ago
Updated 17 January 2024, over 1 year ago

I'm not sure if this is a bug or not but I've installed and enabled both Elasticsearch Connector and Search API, successfully created a few indices.

My issue is that in the elasticsearch index the source fields are arrays as opposed to strings... e.g.:

_source": {
          "type": Array[1][
            "event"
          ],
          "field_end_date": Array[1][
            1519925400
          ],
          "description": Array[1][
            "This talk explores how the speculative worlds of contemporary U.S. superhero comics have addressed the problem of difference and human diversity through stories ab...
           ],

Is this the intended structure?

💬 Support request
Status

RTBC

Version

7.0

Component

Elasticsearch Connector

Created by

🇺🇸United States micheljp

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇩🇪Germany a.dmitriiev

    Patch #18 works for 8.x-7.x. Thank you!

  • 🇮🇳India ushma

    hi... Patch #18 works for 8.x-7.x. when are we planning to commit this?

  • 🇫🇮Finland sokru

    On response to question in the summary "Is this the intended structure? ", I'd say this it is. The comment on related issue ( https://www.drupal.org/project/search_api_opensearch/issues/3274771#comm... 🐛 All fields being indexed as arrays Active ) says "even if we store scalar data in the index, Search API will still pass it around as arrays once retrieved from the index". And close this issue as "won't fix".

    If we'd want to commit this, the current patches would require more work: eg. tests.

  • 🇨🇦Canada mparker17 UTC-4

    Agreed! Adding tests ultimately benefits you, because they ensure that the functionality that you (and your clients) depend on won't regress. Tagging with "Needs tests"

Production build 0.71.5 2024