Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-12403

CSVLoader cannot split fields that contain new lines

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 7.3
    • Fix Version/s: None
    • Component/s: update
    • Labels:
      None

      Description

      It is possible to import CSV that contains newlines in the field content, it just needs to be escaped.

      However, if that field is split, any content from lines after the first is lost. It does not matter if the split character is new line or anything else, existing or not.

      Example

      id,text1,text2
      1,"t1.line1
      t1.line2
      t1.line3",t2
      2,t1.oneline,t2.oneline
      
      // bin/solr create -c splittest
      // bin/post -c splittest test.csv (creates "text1":["t1.line1\nt1.line2\nt1.line3"])
      // bin/post -c splittest -params "f.text1.split=true&f.text1.separator=^" test.csv (creates "text1":["t1.line1"])
      

        Attachments

          Activity

            People

            • Assignee:
              arafalov Alexandre Rafalovitch
              Reporter:
              arafalov Alexandre Rafalovitch
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: