You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by moshebla <gi...@git.apache.org> on 2018/11/18 13:19:17 UTC
[GitHub] lucene-solr pull request #501: SOLR-5211
GitHub user moshebla opened a pull request:
https://github.com/apache/lucene-solr/pull/501
SOLR-5211
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/moshebla/lucene-solr SOLR-5211
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/lucene-solr/pull/501.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #501
----
commit 8ac3b3ff8da0fcc4f257afff39394c082e2cd335
Author: Moshe <mo...@...>
Date: 2018-11-18T09:44:25Z
SOLR-5211: applied previous patch
commit f25cd228e4632e49018c9c2b6cce19a097366886
Author: Moshe <mo...@...>
Date: 2018-11-18T13:05:54Z
SOLR-5211: minor refactors
----
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[GitHub] lucene-solr pull request #501: SOLR-5211
Posted by moshebla <gi...@git.apache.org>.
Github user moshebla commented on a diff in the pull request:
https://github.com/apache/lucene-solr/pull/501#discussion_r235247891
--- Diff: solr/core/src/test/org/apache/solr/BlockUpdateTest.java ---
@@ -0,0 +1,125 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.solr;
+
+import java.util.List;
+
+import org.apache.solr.SolrJettyTestBase;
+import org.apache.solr.client.solrj.SolrClient;
+import org.apache.solr.client.solrj.SolrQuery;
+import org.apache.solr.common.SolrDocument;
+import org.apache.solr.common.SolrDocumentList;
+import org.apache.solr.common.SolrException;
+import org.apache.solr.common.SolrInputDocument;
+import org.apache.solr.common.params.CommonParams;
+import org.junit.BeforeClass;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+
+import static org.hamcrest.CoreMatchers.is;
+
+public class BlockUpdateTest extends SolrJettyTestBase {
--- End diff --
Right,
I renamed it to RootFieldTest.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[GitHub] lucene-solr pull request #501: SOLR-5211
Posted by moshebla <gi...@git.apache.org>.
Github user moshebla commented on a diff in the pull request:
https://github.com/apache/lucene-solr/pull/501#discussion_r234872041
--- Diff: solr/core/src/java/org/apache/solr/update/AddUpdateCommand.java ---
@@ -194,20 +197,33 @@ public String getHashableId() {
return null; // caller should call getLuceneDocument() instead
}
- String rootId = getHashableId();
-
- boolean isVersion = version != 0;
+ final String rootId = getHashableId();
+ final boolean hasVersion = version != 0;
+ final SolrInputField versionSif = hasVersion? solrDoc.get(CommonParams.VERSION_FIELD): null;
--- End diff --
OK I changed this and ran SolrExampleTests which seem to pass.
I'm currently running the solr-core test suite.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[GitHub] lucene-solr pull request #501: SOLR-5211
Posted by moshebla <gi...@git.apache.org>.
Github user moshebla commented on a diff in the pull request:
https://github.com/apache/lucene-solr/pull/501#discussion_r234882621
--- Diff: solr/core/src/test/org/apache/solr/search/TestPseudoReturnFields.java ---
@@ -126,7 +126,7 @@ public void testAllRealFields() throws Exception {
,"//result/doc/str[@name='ssto']"
,"//result/doc/str[@name='subject']"
- ,"//result/doc[count(*)=4]"
+ ,"//result/doc[count(*)=5]"
--- End diff --
The numbers were changed since now _root_ is also added to the doc,
increasing the field count by 1.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[GitHub] lucene-solr pull request #501: SOLR-5211
Posted by dsmiley <gi...@git.apache.org>.
Github user dsmiley commented on a diff in the pull request:
https://github.com/apache/lucene-solr/pull/501#discussion_r234495484
--- Diff: solr/core/src/java/org/apache/solr/update/AddUpdateCommand.java ---
@@ -96,12 +96,21 @@ public SolrInputDocument getSolrInputDocument() {
* Any changes made to the returned Document will not be reflected in the SolrInputDocument, or future calls to this
* method.
* Note that the behavior of this is sensitive to {@link #isInPlaceUpdate()}.
+ * @param withBlockId If true, then block id is forcibly added to the doc
*/
- public Document getLuceneDocument() {
+ Document getLuceneDocument(boolean withBlockId) {
--- End diff --
can we call this addRootField ?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[GitHub] lucene-solr issue #501: SOLR-5211
Posted by dsmiley <gi...@git.apache.org>.
Github user dsmiley commented on the issue:
https://github.com/apache/lucene-solr/pull/501
Also please rename "block" terminology to "nested" where possible.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[GitHub] lucene-solr issue #501: SOLR-5211
Posted by dsmiley <gi...@git.apache.org>.
Github user dsmiley commented on the issue:
https://github.com/apache/lucene-solr/pull/501
Nice.
Do we even need the test config / schema at all? If they don't add anything, we shouldn't have them. Also I see there is still some "Block" terminology added here we can avoid to prefer "Nested".
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[GitHub] lucene-solr pull request #501: SOLR-5211
Posted by dsmiley <gi...@git.apache.org>.
Github user dsmiley commented on a diff in the pull request:
https://github.com/apache/lucene-solr/pull/501#discussion_r234496047
--- Diff: solr/core/src/java/org/apache/solr/update/AddUpdateCommand.java ---
@@ -96,12 +96,21 @@ public SolrInputDocument getSolrInputDocument() {
* Any changes made to the returned Document will not be reflected in the SolrInputDocument, or future calls to this
* method.
* Note that the behavior of this is sensitive to {@link #isInPlaceUpdate()}.
+ * @param withBlockId If true, then block id is forcibly added to the doc
*/
- public Document getLuceneDocument() {
+ Document getLuceneDocument(boolean withBlockId) {
--- End diff --
actually I'm not sure we actually need to overload getLuceneDocument with this boolean after all. if "isInPlaceUpdate()" then don't add root but otherwise add it. That'll be fine; right?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[GitHub] lucene-solr pull request #501: SOLR-5211
Posted by moshebla <gi...@git.apache.org>.
Github user moshebla commented on a diff in the pull request:
https://github.com/apache/lucene-solr/pull/501#discussion_r234639274
--- Diff: solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java ---
@@ -975,6 +976,14 @@ private void updateDocOrDocValues(AddUpdateCommand cmd, IndexWriter writer) thro
}
}
+ boolean forciblyAddBlockId() {
--- End diff --
The change described above causes BlockUpdateTest#testLegacyBlockProcessing to fail.
Should I remove it, I noticed you mentioned this being a burden going forward, or should I create a new solrconfig and test case to test this works in older solr versions?
Wouldn't this be a problem if _root_ is not defined in the collection's schema?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[GitHub] lucene-solr pull request #501: SOLR-5211
Posted by moshebla <gi...@git.apache.org>.
Github user moshebla commented on a diff in the pull request:
https://github.com/apache/lucene-solr/pull/501#discussion_r236074413
--- Diff: solr/core/src/test/org/apache/solr/cloud/TestRandomFlRTGCloud.java ---
@@ -70,6 +70,9 @@
/** Always included in fl so we can vet what doc we're looking at */
private static final FlValidator ID_VALIDATOR = new SimpleFieldValueValidator("id");
+
+ /** Since nested documents are not tested, when _root_ is declared in schema, it is always the same as id */
+ private static final FlValidator ROOT_VALIDATOR = new RenameFieldValueValidator("id" , "_root_");
--- End diff --
Added a validator for _root_, which is now added automatically since the schema used here declares _root_.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[GitHub] lucene-solr pull request #501: SOLR-5211
Posted by moshebla <gi...@git.apache.org>.
Github user moshebla commented on a diff in the pull request:
https://github.com/apache/lucene-solr/pull/501#discussion_r234636103
--- Diff: solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java ---
@@ -975,6 +976,14 @@ private void updateDocOrDocValues(AddUpdateCommand cmd, IndexWriter writer) thro
}
}
+ boolean forciblyAddBlockId() {
--- End diff --
I made this happen only if luceneMatchVersion >= 0.
Hopefully I understood you correctly.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[GitHub] lucene-solr pull request #501: SOLR-5211
Posted by dsmiley <gi...@git.apache.org>.
Github user dsmiley commented on a diff in the pull request:
https://github.com/apache/lucene-solr/pull/501#discussion_r234646277
--- Diff: solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java ---
@@ -975,6 +976,14 @@ private void updateDocOrDocValues(AddUpdateCommand cmd, IndexWriter writer) thro
}
}
+ boolean forciblyAddBlockId() {
--- End diff --
Come to think of it, who cares if root is populated or not for "old" schemas? Lets just do it always; no conditional test. If someone doesn't want root to be populated, that same person probably doesn't have child docs and should just as well omit the root field from their schema.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[GitHub] lucene-solr pull request #501: SOLR-5211
Posted by dsmiley <gi...@git.apache.org>.
Github user dsmiley commented on a diff in the pull request:
https://github.com/apache/lucene-solr/pull/501#discussion_r234869970
--- Diff: solr/core/src/java/org/apache/solr/update/AddUpdateCommand.java ---
@@ -194,20 +197,33 @@ public String getHashableId() {
return null; // caller should call getLuceneDocument() instead
}
- String rootId = getHashableId();
-
- boolean isVersion = version != 0;
+ final String rootId = getHashableId();
+ final boolean hasVersion = version != 0;
+ final SolrInputField versionSif = hasVersion? solrDoc.get(CommonParams.VERSION_FIELD): null;
--- End diff --
What I meant was that *if* the solrDoc has a \_version\_ then we can copy it to all nested children. We need not examine this.version at all. At least this is my understanding of reading the code; it'd be good to ensure tests pass.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[GitHub] lucene-solr pull request #501: SOLR-5211
Posted by dsmiley <gi...@git.apache.org>.
Github user dsmiley commented on a diff in the pull request:
https://github.com/apache/lucene-solr/pull/501#discussion_r234496354
--- Diff: solr/core/src/java/org/apache/solr/update/AddUpdateCommand.java ---
@@ -194,20 +203,22 @@ public String getHashableId() {
return null; // caller should call getLuceneDocument() instead
}
- String rootId = getHashableId();
-
- boolean isVersion = version != 0;
-
+ final String rootId = getHashableId();
for (SolrInputDocument sdoc : all) {
- sdoc.setField(IndexSchema.ROOT_FIELD_NAME, rootId);
- if(isVersion) sdoc.setField(CommonParams.VERSION_FIELD, version);
- // TODO: if possible concurrent modification exception (if SolrInputDocument not cloned and is being forwarded to replicas)
- // then we could add this field to the generated lucene document instead.
+ addBlockId(sdoc, rootId);
}
return () -> all.stream().map(sdoc -> DocumentBuilder.toDocument(sdoc, req.getSchema())).iterator();
}
+ private void addBlockId(SolrInputDocument sdoc, String rootId) {
+ boolean isVersion = version != 0;
+ sdoc.setField(IndexSchema.ROOT_FIELD_NAME, rootId);
+ if(isVersion) sdoc.setField(CommonParams.VERSION_FIELD, version);
--- End diff --
needs a comment as said in JIRA why we add the version here
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[GitHub] lucene-solr pull request #501: SOLR-5211
Posted by dsmiley <gi...@git.apache.org>.
Github user dsmiley commented on a diff in the pull request:
https://github.com/apache/lucene-solr/pull/501#discussion_r234496573
--- Diff: solr/core/src/java/org/apache/solr/update/DirectUpdateHandler2.java ---
@@ -975,6 +976,14 @@ private void updateDocOrDocValues(AddUpdateCommand cmd, IndexWriter writer) thro
}
}
+ boolean forciblyAddBlockId() {
--- End diff --
this is here in part so that we can test _not_ doing this (i.e. current behavior)... but I don't think it's worth it. If we want to _not_ do it conditionally then it could be via luceneMatchVersion but I don't care either way as it's minor to add it unconditionally.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[GitHub] lucene-solr pull request #501: SOLR-5211
Posted by dsmiley <gi...@git.apache.org>.
Github user dsmiley commented on a diff in the pull request:
https://github.com/apache/lucene-solr/pull/501#discussion_r235001356
--- Diff: solr/core/src/test/org/apache/solr/BlockUpdateTest.java ---
@@ -0,0 +1,125 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.solr;
+
+import java.util.List;
+
+import org.apache.solr.SolrJettyTestBase;
+import org.apache.solr.client.solrj.SolrClient;
+import org.apache.solr.client.solrj.SolrQuery;
+import org.apache.solr.common.SolrDocument;
+import org.apache.solr.common.SolrDocumentList;
+import org.apache.solr.common.SolrException;
+import org.apache.solr.common.SolrInputDocument;
+import org.apache.solr.common.params.CommonParams;
+import org.junit.BeforeClass;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+
+import static org.hamcrest.CoreMatchers.is;
+
+public class BlockUpdateTest extends SolrJettyTestBase {
--- End diff --
Here's that "Block" terminology again. Can the tests here merge with another test for nested docs? (one you made?)
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[GitHub] lucene-solr pull request #501: SOLR-5211
Posted by dsmiley <gi...@git.apache.org>.
Github user dsmiley commented on a diff in the pull request:
https://github.com/apache/lucene-solr/pull/501#discussion_r234496324
--- Diff: solr/core/src/java/org/apache/solr/update/AddUpdateCommand.java ---
@@ -194,20 +203,22 @@ public String getHashableId() {
return null; // caller should call getLuceneDocument() instead
}
- String rootId = getHashableId();
-
- boolean isVersion = version != 0;
-
+ final String rootId = getHashableId();
for (SolrInputDocument sdoc : all) {
- sdoc.setField(IndexSchema.ROOT_FIELD_NAME, rootId);
- if(isVersion) sdoc.setField(CommonParams.VERSION_FIELD, version);
- // TODO: if possible concurrent modification exception (if SolrInputDocument not cloned and is being forwarded to replicas)
- // then we could add this field to the generated lucene document instead.
+ addBlockId(sdoc, rootId);
}
return () -> all.stream().map(sdoc -> DocumentBuilder.toDocument(sdoc, req.getSchema())).iterator();
}
+ private void addBlockId(SolrInputDocument sdoc, String rootId) {
--- End diff --
Can we rename this addRootField? and separate out the version part to addVersionField which should _not_ be called by this method; the caller should. addVersionField only needs to be called for the nested case, not by getLuceneDocument.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[GitHub] lucene-solr pull request #501: SOLR-5211
Posted by dsmiley <gi...@git.apache.org>.
Github user dsmiley commented on a diff in the pull request:
https://github.com/apache/lucene-solr/pull/501#discussion_r235022057
--- Diff: solr/core/src/test/org/apache/solr/BlockUpdateTest.java ---
@@ -0,0 +1,125 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.solr;
+
+import java.util.List;
+
+import org.apache.solr.SolrJettyTestBase;
+import org.apache.solr.client.solrj.SolrClient;
+import org.apache.solr.client.solrj.SolrQuery;
+import org.apache.solr.common.SolrDocument;
+import org.apache.solr.common.SolrDocumentList;
+import org.apache.solr.common.SolrException;
+import org.apache.solr.common.SolrInputDocument;
+import org.apache.solr.common.params.CommonParams;
+import org.junit.BeforeClass;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+
+import static org.hamcrest.CoreMatchers.is;
+
+public class BlockUpdateTest extends SolrJettyTestBase {
--- End diff --
I think it tests with / without root field then, so it's name could reflect _that_. e.g. RootFieldTest
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[GitHub] lucene-solr pull request #501: SOLR-5211
Posted by moshebla <gi...@git.apache.org>.
Github user moshebla commented on a diff in the pull request:
https://github.com/apache/lucene-solr/pull/501#discussion_r234882891
--- Diff: solr/core/src/test/org/apache/solr/search/TestReload.java ---
@@ -36,13 +36,13 @@ public void testGetRealtimeReload() throws Exception {
assertU(commit("softCommit","true")); // should cause a RTG searcher to be opened
- assertJQ(req("qt","/get","id","1")
+ assertJQ(req("qt","/get","id","1", "fl", "id,_version_")
,"=={'doc':{'id':'1','_version_':" + version + "}}"
);
h.reload();
- assertJQ(req("qt","/get","id","1")
+ assertJQ(req("qt","/get","id","1", "fl", "id,_version_")
--- End diff --
_root_ is also added to the doc so I added fl param to filter it,
since, IMO, testing _root_ seemed out of scope for this test.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[GitHub] lucene-solr pull request #501: SOLR-5211
Posted by moshebla <gi...@git.apache.org>.
Github user moshebla commented on a diff in the pull request:
https://github.com/apache/lucene-solr/pull/501#discussion_r235613814
--- Diff: solr/core/src/test/org/apache/solr/cloud/TestCloudPseudoReturnFields.java ---
@@ -194,7 +194,7 @@ public void testAllRealFields() throws Exception {
SolrDocumentList docs = assertSearch(params("q", "*:*", "rows", "10", "fl",fl));
// shouldn't matter what doc we pick...
for (SolrDocument doc : docs) {
- assertEquals(fl + " => " + doc, 4, doc.size());
+ assertEquals(fl + " => " + doc, 5, doc.size());
--- End diff --
Doc size increased by 1 since _root_ is also returned by queries.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[GitHub] lucene-solr pull request #501: SOLR-5211
Posted by dsmiley <gi...@git.apache.org>.
Github user dsmiley commented on a diff in the pull request:
https://github.com/apache/lucene-solr/pull/501#discussion_r234498494
--- Diff: solr/core/src/java/org/apache/solr/update/AddUpdateCommand.java ---
@@ -194,20 +203,22 @@ public String getHashableId() {
return null; // caller should call getLuceneDocument() instead
}
- String rootId = getHashableId();
-
- boolean isVersion = version != 0;
-
+ final String rootId = getHashableId();
for (SolrInputDocument sdoc : all) {
- sdoc.setField(IndexSchema.ROOT_FIELD_NAME, rootId);
- if(isVersion) sdoc.setField(CommonParams.VERSION_FIELD, version);
- // TODO: if possible concurrent modification exception (if SolrInputDocument not cloned and is being forwarded to replicas)
- // then we could add this field to the generated lucene document instead.
+ addBlockId(sdoc, rootId);
}
return () -> all.stream().map(sdoc -> DocumentBuilder.toDocument(sdoc, req.getSchema())).iterator();
}
+ private void addBlockId(SolrInputDocument sdoc, String rootId) {
+ boolean isVersion = version != 0;
+ sdoc.setField(IndexSchema.ROOT_FIELD_NAME, rootId);
+ if(isVersion) sdoc.setField(CommonParams.VERSION_FIELD, version);
--- End diff --
although it may be a slight bit of scope creep; I think this logic would be more clear why it's needed if it merely propagated the SolrInputField from the root doc to the child docs. My understanding is that this will wind up being equivalent to what happens now, which is very non-obvious; it took a bunch of digging on my part to see.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[GitHub] lucene-solr pull request #501: SOLR-5211
Posted by moshebla <gi...@git.apache.org>.
Github user moshebla commented on a diff in the pull request:
https://github.com/apache/lucene-solr/pull/501#discussion_r235012194
--- Diff: solr/core/src/test/org/apache/solr/BlockUpdateTest.java ---
@@ -0,0 +1,125 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.solr;
+
+import java.util.List;
+
+import org.apache.solr.SolrJettyTestBase;
+import org.apache.solr.client.solrj.SolrClient;
+import org.apache.solr.client.solrj.SolrQuery;
+import org.apache.solr.common.SolrDocument;
+import org.apache.solr.common.SolrDocumentList;
+import org.apache.solr.common.SolrException;
+import org.apache.solr.common.SolrInputDocument;
+import org.apache.solr.common.params.CommonParams;
+import org.junit.BeforeClass;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+
+import static org.hamcrest.CoreMatchers.is;
+
+public class BlockUpdateTest extends SolrJettyTestBase {
--- End diff --
Um I think it would be a problem since this test uses either a schema with or without _root_ declared.
I could rename it though.
Perhaps RootFieldUpdateTest would suffice?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org