1

I am trying to inspect a solr schema using LukeRequest. I am able to browse the schema using solr admin schema browser. However when I try to retrieve it using the following piece of code it returns an empty field info map

String url = "<host>:<port>/solr/";
SolrServer server = new HttpSolrServer(url);
     LukeRequest luke = new LukeRequest();
        luke.setShowSchema(false);
        final LukeResponse process = luke.process(server);
        final Map<String, FieldInfo> fieldInfo = process.getFieldInfo();
        for(String key: fieldInfo.keySet()){
            FieldInfo info = fieldInfo.get(key);
            System.out.println(key + ":" + info.getType());
        }

(the fieldInfo variable gets an empty map) I am using solr 3.6

subodh
  • 337
  • 2
  • 6
  • 18

2 Answers2

0

Strangely this has started to work once again, if I figure what had gone wrong I will update this question

subodh
  • 337
  • 2
  • 6
  • 18
0

Please try to change luke.setShowSchema(true) and than try it should work.

Soner Gönül
  • 97,193
  • 102
  • 206
  • 364