SOLR-278 - modify LukeRequest/Response to handle show=schema

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@551971 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Ryan McKinley 2007-06-29 17:32:55 +00:00
parent 63e36e5f9c
commit 7230a8eb3f
3 changed files with 46 additions and 0 deletions

View File

@ -0,0 +1,31 @@
Apache Solr - solrj Version 1.3-dev
Release Notes
Introduction
------------
solrj is a java client for the solr search engine.
$Id$
================== Release 1.3-dev ==================
Status
------
This is the first release since Solrj was added to the main solr distribution.
The following changes list changes since the code was introduced, not since
the first official release.
Detailed Change List
--------------------
New Features
Changes in runtime behavior
1. SOLR-278: Modify LukeRequest/Response to support SOLR-266 schema display.
(Will Johnson via ryan)
Bug Fixes
Other Changes

View File

@ -39,6 +39,7 @@ public class LukeRequest extends RequestBase
{
private List<String> fields;
private int count = -1;
private boolean showSchema = false;
public LukeRequest()
{
@ -64,6 +65,14 @@ public class LukeRequest extends RequestBase
//---------------------------------------------------------------------------------
//---------------------------------------------------------------------------------
public boolean isShowSchema() {
return showSchema;
}
public void setShowSchema(boolean showSchema) {
this.showSchema = showSchema;
}
public Collection<ContentStream> getContentStreams() {
return null;
}
@ -76,6 +85,9 @@ public class LukeRequest extends RequestBase
if( count >= 0 ) {
params.add( "count", count+"" );
}
if (showSchema) {
params.add("show", "schema");
}
return params;
}

View File

@ -111,6 +111,9 @@ public class LukeResponse extends SolrResponseBase
indexInfo = (NamedList<Object>)res.get( "index" );
NamedList<Object> flds = (NamedList<Object>)res.get( "fields" );
if (flds==null) {
flds = (NamedList<Object>) ((NamedList<Object>)res.get( "schema" )).get("fields");
}
if( flds != null ) {
fieldInfo = new HashMap<String,FieldInfo>( );
for( Map.Entry<String, Object> field : flds ) {