Uploaded image for project: 'Solr Search Provider'
  1. Solr Search Provider
  2. MGNLEESOLR-111

Multivalue JCR fields saved to Multivalue field in SOLR as String

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Blocker
    • None
    • None

    Description

      Hi, in my opinion, saving multivalue fields (JCR) to SOLR as String (separated by comma) is very not correct.

      If in SOLR schema field is configured as multivalue, it should be saved as array, but Magnolia
      info.magnolia.search.solrsearchprovider.logic.indexer.SolrIndexerImpl class expects all "things" to be String (Map<String,String> things).

      Because of that info.magnolia.search.solrsearchprovider.logic.indexer.BasicSolrIndexService turns String[] into String:

      else if(o instanceof String[])

      { value = StringUtils.join((String[])((String[])o), ", "); }

      Because of that value is stored in solr like:

      "articleOldUrls": [
      "text, another, yet-another"
      ]

      instead of:

      "articleOldUrls": [
      "text",
      "another",
      "yet-another"
      ]

      That makes solr search unusable, I can't do query:

      http://localhost:8983/solr/vinl_collection/select?q=articleOldUrls%3Ayet-another&wt=json&indent=true

      because it won't return any results.

      When I did some hacking, and passed String[] array to SolrInputDocument and then I saved it using standard magnoliaSolrBrigde, it works fine.

      I think this should be fixed.

      Regards
      Mariusz

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

                Unassigned Unassigned
                mchruscielewski Mariusz Chruscielewski
                Federico Navarro
                Nucleus
                Votes:
                2 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                  Created:
                  Updated:

                  Checklists

                    Bug DoR
                    Task DoD