Solr
  1. Solr
  2. SOLR-2582

Use uniqueKey for error log in UIMAUpdateRequestProcessor

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 3.2
    • Fix Version/s: 3.3, 4.0-ALPHA
    • Component/s: None
    • Labels:
      None

      Description

      In UIMAUpdateRequestProcessor the catch block in processAdd() method can have a StringIndexOutOfBoundsException while composing the error message if the logging field is not set and the text being processed is shorter than 100 chars (...append(text.substring(0, 100))...).

      1. SOLR-2582.patch
        3 kB
        Koji Sekiguchi

        Activity

        Hide
        Tommaso Teofili added a comment -

        A possible fix which still allows an easy debug could be to get the "logging field" property on processor initialization, then if that was not configured it's possible to get the uniquekey from the SolrCore passed in the initialize() method :

        String logFieldName = solrUIMAConfiguration.getLogField()!= null ? solrUIMAConfiguration.getLogField() : solrCore.getSchema().getUniqueKeyField().getName();

        Show
        Tommaso Teofili added a comment - A possible fix which still allows an easy debug could be to get the "logging field" property on processor initialization, then if that was not configured it's possible to get the uniquekey from the SolrCore passed in the initialize() method : String logFieldName = solrUIMAConfiguration.getLogField()!= null ? solrUIMAConfiguration.getLogField() : solrCore.getSchema().getUniqueKeyField().getName();
        Hide
        Koji Sekiguchi added a comment -

        Duplicate of SOLR-2579 ?

        Show
        Koji Sekiguchi added a comment - Duplicate of SOLR-2579 ?
        Hide
        Elmer Garduno added a comment -

        Sorry it seems to me as a duplicate but I see its a different problem. I've removed the link.

        Show
        Elmer Garduno added a comment - Sorry it seems to me as a duplicate but I see its a different problem. I've removed the link.
        Hide
        Tommaso Teofili added a comment -

        I think they're related but the approach proposed here is slightly different since considers the uniquekey instead of the text analyzed as the alternative to the logField. Maybe the best solution is applying the patch in SOLR-2579 and then make the error message more useful with other debugging informations.

        Show
        Tommaso Teofili added a comment - I think they're related but the approach proposed here is slightly different since considers the uniquekey instead of the text analyzed as the alternative to the logField. Maybe the best solution is applying the patch in SOLR-2579 and then make the error message more useful with other debugging informations.
        Hide
        Koji Sekiguchi added a comment -

        it's possible to get the uniquekey from the SolrCore passed in the initialize() method

        Yep, we got solrCore. It was a blind side. I don't know why I passed over it!

        I think they're related but the approach proposed here is slightly different since considers the uniquekey instead of the text analyzed as the alternative to the logField. Maybe the best solution is applying the patch in SOLR-2579 and then make the error message more useful with other debugging informations.

        Will do.

        Show
        Koji Sekiguchi added a comment - it's possible to get the uniquekey from the SolrCore passed in the initialize() method Yep, we got solrCore. It was a blind side. I don't know why I passed over it! I think they're related but the approach proposed here is slightly different since considers the uniquekey instead of the text analyzed as the alternative to the logField. Maybe the best solution is applying the patch in SOLR-2579 and then make the error message more useful with other debugging informations. Will do.
        Hide
        Koji Sekiguchi added a comment -

        Changed the issue type to improvement because the "bug part" of this issue is duplicate of SOLR-2579, which has been fixed.

        Show
        Koji Sekiguchi added a comment - Changed the issue type to improvement because the "bug part" of this issue is duplicate of SOLR-2579 , which has been fixed.
        Hide
        Koji Sekiguchi added a comment -

        I'll commit tomorrow.

        Show
        Koji Sekiguchi added a comment - I'll commit tomorrow.
        Hide
        Koji Sekiguchi added a comment -

        trunk: Committed revision 1135011.
        3x: Committed revision 1135012.

        Show
        Koji Sekiguchi added a comment - trunk: Committed revision 1135011. 3x: Committed revision 1135012.
        Hide
        Robert Muir added a comment -

        Bulk close for 3.3

        Show
        Robert Muir added a comment - Bulk close for 3.3

          People

          • Assignee:
            Koji Sekiguchi
            Reporter:
            Tommaso Teofili
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development