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

dataimporter.functions.encodeUrl throughs Unable to encode expression: field.name with value: null

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Not A Problem
    • Affects Version/s: 4.0
    • Fix Version/s: None
    • Labels:
      None
    • Environment:

      Windows 7

      Description

      For some reason dataimporter.functions.encoude URL stopped work after update to solr 4.0 from 3.5.
      Here is the error

      Full Import failed:java.lang.RuntimeException: java.lang.RuntimeException: org.apache.solr.handler.dataimport.DataImportHandlerException: Unable to encode expression: attach.name with value: null Processing Document # 1
      

      Here is the data import config snippet:

      ...
                  <entity name="account"
                          query="select name from accounts where account_id = '${attach.account_id}'">
      
                          <entity name="img_index" processor="TikaEntityProcessor" 
                                  dataSource="bin"
                                  format="text" 
                                  url="http://example.com/data/${account.name}/attaches/${attach.item_id}/${dataimporter.functions.encodeUrl(attach.name)}">
      
                                  <field column="text" name="body" />
                          </entity> 
                  </entity>
      ...
      

      When I'm changing it to not use dataimporter.functions.encodeUrl it works but I need to url encode file names as they have special chars in theirs names.

        Attachments

        1. db.sql
          3 kB
          Igor Dobritskiy
        2. db-data-config.xml
          0.8 kB
          Igor Dobritskiy
        3. schema.xml
          2 kB
          Igor Dobritskiy
        4. solrconfig.xml
          5 kB
          Igor Dobritskiy

          Issue Links

            Activity

              People

              • Assignee:
                jdyer James Dyer
                Reporter:
                dobryy Igor Dobritskiy
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: