Solr
  1. Solr
  2. SOLR-4226

Extract fl parsing code out of ReturnFields constructor

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 4.0
    • Fix Version/s: 4.1, 6.0
    • Labels:
      None

      Description

      I would like to have my own QueryComponent, and have a more limited syntax for return fields. Unfortunately the ReturnFields constructor currently does parsing.

      If we extract the parsing code into a static method of ReturnFields, then the class can be a simple container, and I can have my alternate parsing code to fill it.

      1. SOLR-4226.patch
        46 kB
        Robert Muir
      2. SOLR-4226.patch
        46 kB
        Ryan Ernst

        Activity

        Hide
        Ryan Ernst added a comment -

        This patch makes ReturnFields an abstract class, moving the parsing code into a new SolrReturnFields class.

        Show
        Ryan Ernst added a comment - This patch makes ReturnFields an abstract class, moving the parsing code into a new SolrReturnFields class.
        Hide
        Robert Muir added a comment -

        Thanks Ryan: here's an updated patch. I added javadocs (since its a new abstract class).

        Also i just made all the members abstract: having some of the concrete stuff might be confusing to subclasses and cause strange things to happen (e.g. if they forget to set _wantsAllFields but returned null from getLuceneFieldNames). So I think this is less error-prone.

        Show
        Robert Muir added a comment - Thanks Ryan: here's an updated patch. I added javadocs (since its a new abstract class). Also i just made all the members abstract: having some of the concrete stuff might be confusing to subclasses and cause strange things to happen (e.g. if they forget to set _wantsAllFields but returned null from getLuceneFieldNames). So I think this is less error-prone.
        Hide
        Commit Tag Bot added a comment -

        [trunk commit] Robert Muir
        http://svn.apache.org/viewvc?view=revision&revision=1429935

        SOLR-4226: Extract fl parsing code out of ReturnFields constructor

        Show
        Commit Tag Bot added a comment - [trunk commit] Robert Muir http://svn.apache.org/viewvc?view=revision&revision=1429935 SOLR-4226 : Extract fl parsing code out of ReturnFields constructor
        Hide
        Robert Muir added a comment -

        Thanks Ryan!

        Show
        Robert Muir added a comment - Thanks Ryan!
        Hide
        Commit Tag Bot added a comment -

        [branch_4x commit] Robert Muir
        http://svn.apache.org/viewvc?view=revision&revision=1429955

        SOLR-4226: Extract fl parsing code out of ReturnFields constructor

        Show
        Commit Tag Bot added a comment - [branch_4x commit] Robert Muir http://svn.apache.org/viewvc?view=revision&revision=1429955 SOLR-4226 : Extract fl parsing code out of ReturnFields constructor

          People

          • Assignee:
            Robert Muir
            Reporter:
            Ryan Ernst
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development