Implemented: Update Apache Solr/Lucene to release 6.2.1
(OFBIZ-8316) Upgraded Apache Solr/Lucene from 5.3.1 to 6.2.1. Thanks: Michael Brohl and Cao PengAn for the contribution. git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@1776930 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -32,11 +32,12 @@ import org.apache.ofbiz.entity.condition.EntityOperator;
|
||||
import org.apache.ofbiz.entity.util.EntityQuery;
|
||||
import org.apache.ofbiz.entity.util.EntityUtil;
|
||||
import org.apache.ofbiz.entity.util.EntityUtilProperties;
|
||||
|
||||
import org.apache.lucene.document.Document;
|
||||
import org.apache.lucene.document.DoubleField;
|
||||
//import org.apache.lucene.document.DoubleField;
|
||||
import org.apache.lucene.document.DoublePoint;
|
||||
import org.apache.lucene.document.Field;
|
||||
import org.apache.lucene.document.LongField;
|
||||
//import org.apache.lucene.document.LongField;
|
||||
import org.apache.lucene.document.LongPoint;
|
||||
import org.apache.lucene.document.StringField;
|
||||
import org.apache.lucene.document.TextField;
|
||||
import org.apache.lucene.index.Term;
|
||||
@@ -88,9 +89,11 @@ public class ProductDocument implements LuceneDocument {
|
||||
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 LongField("introductionDate", quantizeTimestampToDays(product.getTimestamp("introductionDate")), Field.Store.NO));
|
||||
doc.add(new LongPoint("introductionDate", quantizeTimestampToDays(product.getTimestamp("introductionDate"))));
|
||||
nextReIndex = this.checkSetNextReIndex(product.getTimestamp("introductionDate"), nextReIndex);
|
||||
doc.add(new LongField("salesDiscontinuationDate", quantizeTimestampToDays(product.getTimestamp("salesDiscontinuationDate")), Field.Store.NO));
|
||||
// doc.add(new LongField("salesDiscontinuationDate", 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));
|
||||
|
||||
@@ -247,7 +250,8 @@ public class ProductDocument implements LuceneDocument {
|
||||
fieldNameSb.append('_');
|
||||
fieldNameSb.append(productPrice.getString("productStoreGroupId"));
|
||||
fieldNameSb.append("_price");
|
||||
doc.add(new DoubleField(fieldNameSb.toString(), productPrice.getDouble("price"), Field.Store.NO));
|
||||
// doc.add(new DoubleField(fieldNameSb.toString(), productPrice.getDouble("price"), Field.Store.NO));
|
||||
doc.add(new DoublePoint(fieldNameSb.toString(), productPrice.getDouble("price")));
|
||||
}
|
||||
|
||||
// Index ProductSuppliers
|
||||
|
||||
@@ -41,7 +41,7 @@ public final class SearchWorker {
|
||||
|
||||
public static final String module = SearchWorker.class.getName();
|
||||
|
||||
private static final Version LUCENE_VERSION = Version.LUCENE_5_3_1;
|
||||
private static final Version LUCENE_VERSION = Version.LUCENE_6_2_1;
|
||||
|
||||
private SearchWorker() {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user