tomglk commented on a change in pull request #123:
URL: https://github.com/apache/solr/pull/123#discussion_r631641743



##########
File path: solr/contrib/ltr/src/test/org/apache/solr/ltr/TestLTROnSolrCloud.java
##########
@@ -232,32 +230,47 @@ private void createCollection(String name, String config, 
int numShards, int num
     solrCluster.waitForActiveCollection(name, numShards, numShards * 
numReplicas);
   }
 
-
   void indexDocument(String collection, String id, String title, String 
description, int popularity)
     throws Exception{
     SolrInputDocument doc = new SolrInputDocument();
     doc.setField("id", id);
     doc.setField("title", title);
     doc.setField("description", description);
     doc.setField("popularity", popularity);
+    if(popularity != 1) {
+      // check that empty values will be read as default
+      doc.setField("dvIntField", popularity);
+      doc.setField("dvLongField", popularity);
+      doc.setField("dvFloatField", ((float) popularity) / 10);
+      doc.setField("dvDoubleField", ((double) popularity) / 10);
+      doc.setField("dvStrNumField", popularity);
+      doc.setField("dvStrBoolField", popularity % 2 == 0 ? "T" : "F");
+    }
     solrCluster.getSolrClient().add(collection, doc);
   }
 
   private void indexDocuments(final String collection)
        throws Exception {
     final int collectionSize = 8;
-    for (int docId = 1; docId <= collectionSize;  docId++) {
+    // put documents in reversed order to check that advanceExact is working 
correctly
+    for (int docId = collectionSize; docId >= 1;  docId--) {
       final int popularity = docId;
       indexDocument(collection, String.valueOf(docId), "a1", "bloom", 
popularity);
+      if(docId == collectionSize / 2) {
+        // commit in the middle in order to check that everything works fine 
for multi-segment case
+        solrCluster.getSolrClient().commit(collection);
+      }

Review comment:
       Thanks for the suggestion with nextBoolean(), I didn't know that. Used 
it in 4559415.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to