Author: shijh
Date: Wed Jan 25 03:09:48 2017 New Revision: 1780133 URL: http://svn.apache.org/viewvc?rev=1780133&view=rev Log: 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. Modified: ofbiz/trunk/plugins/lucene/src/main/java/org/apache/ofbiz/content/search/ProductDocument.java ofbiz/trunk/plugins/solr/home/solrdefault/conf/solrconfig.xml Modified: ofbiz/trunk/plugins/lucene/src/main/java/org/apache/ofbiz/content/search/ProductDocument.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/plugins/lucene/src/main/java/org/apache/ofbiz/content/search/ProductDocument.java?rev=1780133&r1=1780132&r2=1780133&view=diff ============================================================================== --- ofbiz/trunk/plugins/lucene/src/main/java/org/apache/ofbiz/content/search/ProductDocument.java (original) +++ ofbiz/trunk/plugins/lucene/src/main/java/org/apache/ofbiz/content/search/ProductDocument.java Wed Jan 25 03:09:48 2017 @@ -86,12 +86,14 @@ public class ProductDocument implements 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 @@ public class ProductDocument implements 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 Modified: ofbiz/trunk/plugins/solr/home/solrdefault/conf/solrconfig.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/plugins/solr/home/solrdefault/conf/solrconfig.xml?rev=1780133&r1=1780132&r2=1780133&view=diff ============================================================================== --- ofbiz/trunk/plugins/solr/home/solrdefault/conf/solrconfig.xml (original) +++ ofbiz/trunk/plugins/solr/home/solrdefault/conf/solrconfig.xml Wed Jan 25 03:09:48 2017 @@ -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 |
Free forum by Nabble | Edit this page |