Add search option for boostdoc
This commit is contained in:
parent
0147dbc3ca
commit
5e8b6c20b3
5 changed files with 46 additions and 6 deletions
|
@ -20,6 +20,7 @@ import java.util.List;
|
|||
import javax.annotation.Resource;
|
||||
|
||||
import org.codelibs.core.beans.util.BeanUtil;
|
||||
import org.codelibs.core.lang.StringUtil;
|
||||
import org.codelibs.fess.Constants;
|
||||
import org.codelibs.fess.app.pager.BoostDocPager;
|
||||
import org.codelibs.fess.es.config.cbean.BoostDocumentRuleCB;
|
||||
|
@ -69,8 +70,11 @@ public class BoostDocumentRuleService {
|
|||
}
|
||||
|
||||
protected void setupListCondition(final BoostDocumentRuleCB cb, final BoostDocPager boostDocumentRulePager) {
|
||||
if (boostDocumentRulePager.id != null) {
|
||||
cb.query().docMeta().setId_Equal(boostDocumentRulePager.id);
|
||||
if (StringUtil.isNotBlank(boostDocumentRulePager.urlExpr)) {
|
||||
cb.query().setUrlExpr_Wildcard(boostDocumentRulePager.urlExpr);
|
||||
}
|
||||
if (StringUtil.isNotBlank(boostDocumentRulePager.boostExpr)) {
|
||||
cb.query().setBoostExpr_Wildcard(boostDocumentRulePager.boostExpr);
|
||||
}
|
||||
// TODO Long, Integer, String supported only.
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@ public class AdminBoostdocAction extends FessAdminAction {
|
|||
RenderDataUtil.register(data, "boostDocumentRuleItems", boostDocumentRuleService.getBoostDocumentRuleList(boostDocPager)); // page navi
|
||||
|
||||
// restore from pager
|
||||
copyBeanToBean(boostDocPager, form, op -> op.include("id"));
|
||||
copyBeanToBean(boostDocPager, form, op -> op.include("urlExpr", "boostExpr"));
|
||||
}
|
||||
|
||||
// ===================================================================================
|
||||
|
@ -279,7 +279,7 @@ public class AdminBoostdocAction extends FessAdminAction {
|
|||
RenderDataUtil.register(data, "boostDocumentRuleItems", boostDocumentRuleService.getBoostDocumentRuleList(boostDocPager));
|
||||
}).useForm(SearchForm.class, setup -> {
|
||||
setup.setup(form -> {
|
||||
copyBeanToBean(boostDocPager, form, op -> op.include("id"));
|
||||
copyBeanToBean(boostDocPager, form, op -> op.include("urlExpr", "boostExpr"));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -21,6 +21,8 @@ package org.codelibs.fess.app.web.admin.boostdoc;
|
|||
*/
|
||||
public class SearchForm {
|
||||
|
||||
public String id;
|
||||
public String urlExpr;
|
||||
|
||||
public String boostExpr;
|
||||
|
||||
}
|
||||
|
|
|
@ -18,6 +18,9 @@ package org.codelibs.fess.app.web.api.admin.boostdoc;
|
|||
import org.codelibs.fess.app.web.api.admin.BaseSearchBody;
|
||||
|
||||
public class SearchBody extends BaseSearchBody {
|
||||
public String id;
|
||||
|
||||
public String urlExpr;
|
||||
|
||||
public String boostExpr;
|
||||
|
||||
}
|
||||
|
|
|
@ -36,6 +36,37 @@
|
|||
</la:info>
|
||||
<la:errors />
|
||||
</div>
|
||||
<la:form action="/admin/boostdoc/"
|
||||
styleClass="form-horizontal">
|
||||
<div class="form-group">
|
||||
<label for="urlExpr" class="col-sm-2 control-label"><la:message
|
||||
key="labels.boost_document_rule_url_expr" /></label>
|
||||
<div class="col-sm-10">
|
||||
<la:text styleId="urlExpr" property="urlExpr" styleClass="form-control" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="boostExpr" class="col-sm-2 control-label"><la:message
|
||||
key="labels.boost_document_rule_boost_expr" /></label>
|
||||
<div class="col-sm-10">
|
||||
<la:text styleId="boostExpr" property="boostExpr" styleClass="form-control" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<button type="submit" class="btn btn-primary" id="submit"
|
||||
name="search"
|
||||
value="<la:message key="labels.crud_button_search" />">
|
||||
<em class="fa fa-search"></em>
|
||||
<la:message key="labels.crud_button_search" />
|
||||
</button>
|
||||
<button type="submit" class="btn btn-default" name="reset"
|
||||
value="<la:message key="labels.crud_button_reset" />">
|
||||
<la:message key="labels.crud_button_reset" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</la:form>
|
||||
<%-- List --%>
|
||||
<c:if test="${boostDocPager.allRecordCount == 0}">
|
||||
<div class="row top10">
|
||||
|
|
Loading…
Add table
Reference in a new issue