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

SolrJ LukeResponse support dynamic fields

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 6.2.1
    • 6.4
    • SolrJ
    • None

    Description

      LukeRequestHandler (/admin/luke), when invoked with the show=schema parameter, returns a list static fields and dynamic fields.

      For instance on my local machine http://localhost:8983/solr/collection1/admin/luke?show=schema returns something like this:

      <response>
        ...
        <lst name="schema">
          <lst name="fields">
            <lst name="foo">
              <str name="type">string</str>
              <str name="flags">I-S-----OF-----l</str>
            </lst>
            ...
          </lst>
          <lst name="dynamicFields">
            <lst name="bar_*">
              <str name="type">string</str>
              <str name="flags">I-------OF------</str>
            </lst>
            ...
          </lst>
        </lst>
        ...
      </response>
      

      However, when processing a LukeRequest in SolrJ, only static fields are parsed and made available to the client application through lukeResponse.getFieldInfo(). There does not seem to be a way for the client application to get the dynamic fields.

      Maybe we could parse dynamic fields and make them accessible ? Possibly something like this:

      public class MyClass {
        public static void main(String[] args) throws Exception {
          SolrClient client = new HttpSolrClient("http://localhost:8983/solr/collection1");
          LukeRequest request = new LukeRequest();
          request.setShowSchema(true);
          LukeResponse response = request.process(client);
          Map<String, FieldInfo> staticFields = response.getFieldInfo(); // SolrJ already provides this.
          Map<String, FieldInfo> dynamicFields = response.getDynamicFieldInfo(); // Proposed improvement.
        }
      }
      

      Attachments

        1. SOLR-9666.patch
          3 kB
          Fengtan
        2. SOLR-9666.patch
          4 kB
          Fengtan

        Activity

          People

            krisden Kevin Risden
            Fengtan Fengtan
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: