Fixed: Update Apache Solr/Lucene to release 6.2.1
(OFBIZ-8316)

Change LongPoint and DoublePoint fields to String field to make solr work in trunk version, and I'll change them back when updating to new release of Solr.

Thanks: Jacques Le Roux for reporting the point fields problem.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1780133 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/plugins/lucene/src/main/java/org/apache/ofbiz/content/search/ProductDocument.java b/plugins/lucene/src/main/java/org/apache/ofbiz/content/search/ProductDocument.java
index d0267eb..d24279c 100644
--- a/plugins/lucene/src/main/java/org/apache/ofbiz/content/search/ProductDocument.java
+++ b/plugins/lucene/src/main/java/org/apache/ofbiz/content/search/ProductDocument.java
@@ -86,12 +86,14 @@
                 this.addTextFieldByWeight(doc, "brandName", product.getString("brandName"), "index.weight.Product.brandName", 0, false, "fullText", delegator);
                 this.addTextFieldByWeight(doc, "description", product.getString("description"), "index.weight.Product.description", 0, false, "fullText", delegator);
                 this.addTextFieldByWeight(doc, "longDescription", product.getString("longDescription"), "index.weight.Product.longDescription", 0, false, "fullText", delegator);
-                //doc.add(new StringField("introductionDate", checkValue(product.getString("introductionDate")), Store.NO));
-//                doc.add(new LongField("introductionDate", quantizeTimestampToDays(product.getTimestamp("introductionDate")), Field.Store.NO));
-                doc.add(new LongPoint("introductionDate", quantizeTimestampToDays(product.getTimestamp("introductionDate"))));
+                // OFBiz-8316, the LongPoint should be reused when updating to Solr 6.4.1 or later
+                doc.add(new StringField("introductionDate", String.valueOf(quantizeTimestampToDays(product.getTimestamp("introductionDate"))), Field.Store.NO));
+//                doc.add(new LongPoint("introductionDate", quantizeTimestampToDays(product.getTimestamp("introductionDate"))));
                 nextReIndex = this.checkSetNextReIndex(product.getTimestamp("introductionDate"), nextReIndex);
+                // OFBiz-8316, the LongPoint should be reused when updating to Solr 6.4.1 or later
 //                doc.add(new LongField("salesDiscontinuationDate", quantizeTimestampToDays(product.getTimestamp("salesDiscontinuationDate")), Field.Store.NO));
-                doc.add(new LongPoint("salesDiscontinuationDate", quantizeTimestampToDays(product.getTimestamp("salesDiscontinuationDate"))));
+                doc.add(new StringField("salesDiscontinuationDate", String.valueOf(quantizeTimestampToDays(product.getTimestamp("salesDiscontinuationDate"))), Field.Store.NO));
+//                doc.add(new LongPoint("salesDiscontinuationDate", quantizeTimestampToDays(product.getTimestamp("salesDiscontinuationDate"))));
                 nextReIndex = this.checkSetNextReIndex(product.getTimestamp("salesDiscontinuationDate"), nextReIndex);
                 doc.add(new StringField("isVariant", product.get("isVariant") != null && product.getBoolean("isVariant") ? "true" : "false", Field.Store.NO));
 
@@ -248,8 +250,10 @@
                     fieldNameSb.append('_');
                     fieldNameSb.append(productPrice.getString("productStoreGroupId"));
                     fieldNameSb.append("_price");
+                    // OFBiz-8316, the DoublePoint should be reused when updating to Solr 6.4.1 or later
 //                    doc.add(new DoubleField(fieldNameSb.toString(), productPrice.getDouble("price"), Field.Store.NO));
-                    doc.add(new DoublePoint(fieldNameSb.toString(), productPrice.getDouble("price")));
+                    doc.add(new StringField(fieldNameSb.toString(), String.valueOf(productPrice.getDouble("price")), Field.Store.NO));
+//                    doc.add(new DoublePoint(fieldNameSb.toString(), productPrice.getDouble("price")));
                 }
 
                 // Index ProductSuppliers
diff --git a/plugins/solr/home/solrdefault/conf/solrconfig.xml b/plugins/solr/home/solrdefault/conf/solrconfig.xml
index a94a3b1..3b2c9bb 100644
--- a/plugins/solr/home/solrdefault/conf/solrconfig.xml
+++ b/plugins/solr/home/solrdefault/conf/solrconfig.xml
@@ -35,7 +35,7 @@
        that you fully re-index after changing this setting as it can

        affect both how text is indexed and queried.

   -->

-  <luceneMatchVersion>5.3.1</luceneMatchVersion>

+  <luceneMatchVersion>6.2.1</luceneMatchVersion>

 

   <!-- <lib/> directives can be used to instruct Solr to load any Jars

        identified and use them to resolve any "plugins" specified in