Author: jaz
Date: Sun May 20 21:12:11 2007
New Revision: 540016
URL:
http://svn.apache.org/viewvc?view=rev&rev=540016Log:
added a flag to delete keywords before indexing (if enabed in properties)
Modified:
ofbiz/trunk/applications/product/src/org/ofbiz/product/product/KeywordIndex.java
Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/product/KeywordIndex.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/product/KeywordIndex.java?view=diff&rev=540016&r1=540015&r2=540016==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/product/KeywordIndex.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/product/KeywordIndex.java Sun May 20 21:12:11 2007
@@ -191,6 +191,12 @@
}
if (toBeStored.size() > 0) {
if (Debug.verboseOn()) Debug.logVerbose("[KeywordSearch.induceKeywords] Storing " + toBeStored.size() + " keywords for productId " + product.getString("productId"), module);
+
+ if ("true".equals(UtilProperties.getPropertyValue("prodsearch", "index.delete.on_index", "false"))) {
+ // delete all keywords if the properties file says to
+ delegator.removeByAnd("ProductKeyword", UtilMisc.toMap("productId", product.getString("productId")));
+ }
+
delegator.storeAll(toBeStored);
}
}