Compare commits
11
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
061252a80e | ||
|
|
929dddf0e6 | ||
|
|
9d8a41d3e8 | ||
|
|
f627d97d14 | ||
|
|
829e1ca535 | ||
|
|
fae9da9aa1 | ||
|
|
3e76bb7193 | ||
|
|
305f2c5abb | ||
|
|
f000c69a0d | ||
|
|
d0f98efd7d | ||
|
|
b5663ec6c2 |
@@ -28,4 +28,5 @@ under the License.
|
||||
<SecurityGroupPermission fromDate="2001-05-13 12:00:00.0" groupId="ASSETMAINTTECH" permissionId="ASSETMAINT_UPDATE"/>
|
||||
|
||||
<SecurityGroupPermission fromDate="2001-05-13 12:00:00.0" groupId="FULLADMIN" permissionId="ASSETMAINT_ADMIN"/>
|
||||
<SecurityGroupPermission fromDate="2001-01-01 00:00:00.0" groupId="VIEWADMIN" permissionId="ASSETMAINT_VIEW"/>
|
||||
</entity-engine-xml>
|
||||
|
||||
@@ -60,7 +60,7 @@ under the License.
|
||||
</entity-one>
|
||||
<!-- parameters for the performFind service -->
|
||||
<set field="parameters.forumId" from-field="parameters.forumId" default-value="${parameters.contentId}"/>
|
||||
<set field="viewIndex" from-field="parameters.VIEW_INDEX" type="Integer"/>
|
||||
<set field="viewIndex" from-field="parameters.VIEW_INDEX" type="Integer" default-value="0" />
|
||||
<set field="viewSizeDefaultValue" value="${groovy: modelTheme.getDefaultViewSize()}" type="Integer"/>
|
||||
<set field="viewSize" from-field="parameters.VIEW_SIZE" type="Integer" default-value="${viewSizeDefaultValue}"/>
|
||||
<entity-condition entity-name="ContentAssocViewTo" list="forumMessages" >
|
||||
@@ -95,7 +95,7 @@ under the License.
|
||||
<parameter param-name="forumId" from-field="parameters.forumId"/>
|
||||
<parameter param-name="forumMessageIdTo" value=""/>
|
||||
<parameter param-name="threadView" from-field="parameters.threadView"/>
|
||||
<parameter param-name="VIEW_INDEX" from-field="parameters.VIEW_INDEX"/>
|
||||
<parameter param-name="VIEW_INDEX" from-field="viewIndex"/>
|
||||
</link>
|
||||
</widgets>
|
||||
</section>
|
||||
|
||||
@@ -206,6 +206,7 @@ under the License.
|
||||
</drop-down>
|
||||
</field>
|
||||
<field name="exampleName" title="${uiLabelMap.FormFieldTitle_exampleName}" required-field="true"><text /></field>
|
||||
<field name="exampleName" title="${uiLabelMap.FormFieldTitle_exampleName}" required-field="true" widget-style="required"><text placeholder="${uiLabelMap.FormFieldTitle_exampleName}"/></field>
|
||||
<field name="description" title="${uiLabelMap.CommonDescription}"/>
|
||||
<field name="longDescription" title="${uiLabelMap.ExampleLongDescription}"/>
|
||||
<field name="anotherText">
|
||||
|
||||
+6
-5
@@ -17,9 +17,10 @@
|
||||
* under the License.
|
||||
*/
|
||||
dependencies {
|
||||
// Remember to change the version number in SearchWorker class when upgrading.
|
||||
// Also Solr et Lucene should use the same version, luceneMatchVersion should be updated in solrconfig.xml
|
||||
pluginLibsCompile 'org.apache.lucene:lucene-core:8.9.0'
|
||||
pluginLibsCompile 'org.apache.lucene:lucene-queryparser:8.9.0'
|
||||
pluginLibsCompile 'org.apache.lucene:lucene-analyzers-common:8.9.0'
|
||||
// 1. Remember to change the version LUCENE_VERSION in SearchWorker class when upgrading.
|
||||
// 2. luceneMatchVersion should be updated in solrconfig.xml
|
||||
// 3. Also Solr et Lucene should use the same version,
|
||||
pluginLibsCompile 'org.apache.lucene:lucene-core:8.11.2'
|
||||
pluginLibsCompile 'org.apache.lucene:lucene-queryparser:8.11.2'
|
||||
pluginLibsCompile 'org.apache.lucene:lucene-analyzers-common:8.11.2'
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ public final class SearchWorker {
|
||||
|
||||
public static final String module = SearchWorker.class.getName();
|
||||
|
||||
private static final Version LUCENE_VERSION = Version.LUCENE_8_9_0;
|
||||
private static final Version LUCENE_VERSION = Version.LUCENE_8_11_2;
|
||||
|
||||
private SearchWorker() {}
|
||||
|
||||
|
||||
+4
-3
@@ -17,9 +17,10 @@
|
||||
* under the License.
|
||||
*/
|
||||
dependencies {
|
||||
// Remember to change the version number in SearchWorker class when upgrading.
|
||||
// Also Solr et Lucene should use the same version, luceneMatchVersion should be updated in solrconfig.xml
|
||||
pluginLibsCompile 'org.apache.solr:solr-core:8.9.0'
|
||||
// 1. Remember to change the version LUCENE_VERSION in SearchWorker class when upgrading.
|
||||
// 2. luceneMatchVersion should be updated in solrconfig.xml
|
||||
// 3. Also Solr et Lucene should use the same version,
|
||||
pluginLibsCompile 'org.apache.solr:solr-core:8.11.2'
|
||||
pluginLibsCompile 'com.google.guava:guava:28.0-jre'
|
||||
}
|
||||
|
||||
|
||||
@@ -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>8.9.0</luceneMatchVersion>
|
||||
<luceneMatchVersion>8.11.2</luceneMatchVersion>
|
||||
|
||||
<!-- <lib/> directives can be used to instruct Solr to load any Jars
|
||||
identified and use them to resolve any "plugins" specified in
|
||||
|
||||
@@ -78,7 +78,8 @@ public abstract class SolrProductSearch {
|
||||
String solrIndexName = (String) context.get("indexName");
|
||||
|
||||
if (SolrUtil.isSolrEcaEnabled()) {
|
||||
// Debug.logVerbose("Solr: addToSolr: Running indexing for productId '" + productId + "'", module);
|
||||
System.setProperty("SolrDispatchFilter", "runsAfterControlFilter");
|
||||
// Debug.logVerbose("Solr: addToSolr: Running indexing for productId '" + productId + "'", MODULE);
|
||||
try {
|
||||
GenericValue product = EntityQuery.use(delegator).from("Product").where("productId", productId).queryOne();
|
||||
Map<String, Object> dispatchContext = ProductUtil.getProductContent(product, dctx, context);
|
||||
@@ -109,6 +110,7 @@ public abstract class SolrProductSearch {
|
||||
Debug.logError(e, e.getMessage(), module);
|
||||
result = ServiceUtil.returnError(e.toString());
|
||||
}
|
||||
System.clearProperty("SolrDispatchFilter");
|
||||
} else {
|
||||
final String statusMsg = "Solr ECA indexing disabled; skipping indexing for productId '" + productId + "'";
|
||||
if (Debug.verboseOn()) Debug.logVerbose("Solr: addToSolr: " + statusMsg, module);
|
||||
|
||||
@@ -20,10 +20,10 @@
|
||||
|
||||
package org.apache.ofbiz.solr.test;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.ofbiz.entity.GenericValue;
|
||||
import org.apache.ofbiz.entity.util.EntityQuery;
|
||||
@@ -75,11 +75,14 @@ public class SolrTests extends OFBizTestCase {
|
||||
throw new Exception(errorMessage);
|
||||
}
|
||||
assertTrue("Could not query search index", ServiceUtil.isSuccess(sresp));
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void testAddToSolrIndex() throws Exception{
|
||||
/**
|
||||
* Test add to solr index.
|
||||
* @throws Exception the exception
|
||||
*/
|
||||
public void testAddToSolrIndex() throws Exception {
|
||||
System.setProperty("SolrDispatchFilter", "runsAfterControlFilter");
|
||||
context = new HashMap<>();
|
||||
context.put("productId", validTestProductId);
|
||||
response = dispatcher.runSync("addToSolrIndex", context);
|
||||
@@ -89,9 +92,15 @@ public class SolrTests extends OFBizTestCase {
|
||||
}
|
||||
assertTrue("Could not add Product to Index", ServiceUtil.isSuccess(
|
||||
response));
|
||||
System.clearProperty("SolrDispatchFilter");
|
||||
}
|
||||
|
||||
public void testAddToSolrIndex_invalidProduct() throws Exception {
|
||||
/**
|
||||
* Test add to solr index invalid product.
|
||||
* @throws Exception the exception
|
||||
*/
|
||||
public void testAddToSolrIndexInvalidProduct() throws Exception {
|
||||
System.setProperty("SolrDispatchFilter", "runsAfterControlFilter");
|
||||
context = new HashMap<>();
|
||||
context.put("productId", invalidTestProductId);
|
||||
response = dispatcher.runSync("addToSolrIndex", context);
|
||||
@@ -101,9 +110,11 @@ public class SolrTests extends OFBizTestCase {
|
||||
}
|
||||
assertTrue("Could not test the addition of an invalid product to the Solr index", ServiceUtil.isSuccess(
|
||||
response));
|
||||
System.clearProperty("SolrDispatchFilter");
|
||||
}
|
||||
|
||||
public void testAddListToSolrIndex() throws Exception {
|
||||
System.setProperty("SolrDispatchFilter", "runsAfterControlFilter");
|
||||
List<Map<String, Object>> products = new ArrayList<>();
|
||||
Map<String, Object> product_1 = new HashMap<>();
|
||||
Map<String, Object> product_2 = new HashMap<>();
|
||||
@@ -124,10 +135,15 @@ public class SolrTests extends OFBizTestCase {
|
||||
throw new Exception(errorMessage);
|
||||
}
|
||||
assertTrue("Could not add products to index", ServiceUtil.isSuccess(response));
|
||||
|
||||
System.clearProperty("SolrDispatchFilter");
|
||||
}
|
||||
|
||||
public void testAddListToSolrIndex_invalidProducts() throws Exception {
|
||||
/**
|
||||
* Test add list to solr index invalid products.
|
||||
* @throws Exception the exception
|
||||
*/
|
||||
public void testAddListToSolrIndexInvalidProducts() throws Exception {
|
||||
System.setProperty("SolrDispatchFilter", "runsAfterControlFilter");
|
||||
List<Map<String, Object>> products = new ArrayList<>();
|
||||
Map<String, Object> product_1 = new HashMap<>();
|
||||
Map<String, Object> product_2 = new HashMap<>();
|
||||
@@ -151,7 +167,7 @@ public class SolrTests extends OFBizTestCase {
|
||||
throw new Exception(errorMessage);
|
||||
}
|
||||
assertTrue("Could not test adding invalid products to index", ServiceUtil.isSuccess(response));
|
||||
|
||||
System.clearProperty("SolrDispatchFilter");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -66,9 +66,8 @@ public class OFBizSolrContextFilter extends SolrDispatchFilter {
|
||||
*/
|
||||
public void init(FilterConfig config) throws ServletException {
|
||||
Properties props = System.getProperties();
|
||||
props.setProperty("solr.log.dir", UtilProperties.getPropertyValue("solrconfig", "solr.log.dir", "runtime/logs/solr"));
|
||||
props.setProperty("solr.log.level", UtilProperties.getPropertyValue("solrconfig", "solr.log.level", "INFO"));
|
||||
props.setProperty("solr/home", UtilProperties.getPropertyValue("solrconfig", "solr/home"));
|
||||
String ofbizHome = (String) props.get("ofbiz.home");
|
||||
config.getServletContext().setAttribute(SOLRHOME_ATTRIBUTE, ofbizHome + props.getProperty("solr/home"));
|
||||
super.init(config);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user