SOLR-6633 field name changed from _src to _src_ by populafr demand

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1644100 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Noble Paul 2014-12-09 16:13:58 +00:00
parent 3a102c548a
commit 5929d5b436
3 changed files with 9 additions and 9 deletions

View File

@ -277,7 +277,7 @@ public class JsonLoaderTest extends SolrTestCaseJ4 {
" \"f1\": \"v2\",\n" +
" \"f2\": null\n" +
" }\n";
SolrQueryRequest req = req("srcField","_src");
SolrQueryRequest req = req("srcField","_src_");
req.getContext().put("path","/update/json/docs");
SolrQueryResponse rsp = new SolrQueryResponse();
BufferingRequestProcessor p = new BufferingRequestProcessor(null);
@ -304,7 +304,7 @@ public class JsonLoaderTest extends SolrTestCaseJ4 {
" \"f2\": \"v2\",\n" +
" \"f3\": null\n" +
" }\n";
req = req("srcField","_src");
req = req("srcField","_src_");
req.getContext().put("path","/update/json/docs");
rsp = new SolrQueryResponse();
p = new BufferingRequestProcessor(null);
@ -313,7 +313,7 @@ public class JsonLoaderTest extends SolrTestCaseJ4 {
assertEquals( 2, p.addCommands.size() );
String content = (String) p.addCommands.get(0).solrDoc.getFieldValue("_src");
String content = (String) p.addCommands.get(0).solrDoc.getFieldValue("_src_");
assertNotNull(content);
Map obj = (Map) ObjectBuilder.fromJSON(content);
assertEquals(Boolean.TRUE, obj.get("bool"));
@ -322,7 +322,7 @@ public class JsonLoaderTest extends SolrTestCaseJ4 {
assertNotNull(obj.get("array"));
assertNotNull(obj.get("boosted"));
content = (String) p.addCommands.get(1).solrDoc.getFieldValue("_src");
content = (String) p.addCommands.get(1).solrDoc.getFieldValue("_src_");
assertNotNull(content);
obj = (Map) ObjectBuilder.fromJSON(content);
assertEquals("v1", obj.get("f1"));
@ -330,7 +330,7 @@ public class JsonLoaderTest extends SolrTestCaseJ4 {
assertTrue(obj.containsKey("f3"));
doc = "[{'id':'1'},{'id':'2'}]".replace('\'', '"');
req = req("srcField","_src");
req = req("srcField","_src_");
req.getContext().put("path","/update/json/docs");
rsp = new SolrQueryResponse();
p = new BufferingRequestProcessor(null);
@ -338,11 +338,11 @@ public class JsonLoaderTest extends SolrTestCaseJ4 {
loader.load(req, rsp, new ContentStreamBase.StringStream(doc), p);
assertEquals( 2, p.addCommands.size() );
content = (String) p.addCommands.get(0).solrDoc.getFieldValue("_src");
content = (String) p.addCommands.get(0).solrDoc.getFieldValue("_src_");
assertNotNull(content);
obj = (Map) ObjectBuilder.fromJSON(content);
assertEquals("1", obj.get("id"));
content = (String) p.addCommands.get(1).solrDoc.getFieldValue("_src");
content = (String) p.addCommands.get(1).solrDoc.getFieldValue("_src_");
assertNotNull(content);
obj = (Map) ObjectBuilder.fromJSON(content);
assertEquals("2", obj.get("id"));

View File

@ -156,7 +156,7 @@
<field name="content_type" type="string" indexed="true" stored="true" multiValued="true"/>
<field name="last_modified" type="date" indexed="true" stored="true"/>
<field name="links" type="string" indexed="true" stored="true" multiValued="true"/>
<field name="_src" type="string" indexed="false" stored="true"/>
<field name="_src_" type="string" indexed="false" stored="true"/>
<!-- Main body of document extracted by SolrCell.
NOTE: This field is not indexed by default, since it is also copied to "text"

View File

@ -1054,7 +1054,7 @@
<initParams path="/update/json/docs">
<lst name="defaults">
<!--this ensures that the entire json doc will be stored verbatim into one field-->
<str name="srcField">_src</str>
<str name="srcField">_src_</str>
<!--This means a the uniqueKeyField will be extracted from the fields and
all fields go into the 'df' field. In this config df is already configured to be 'text'
-->