Skip to content
Snippets Groups Projects
Commit 44698db7 authored by Shinsuke Sugaya's avatar Shinsuke Sugaya
Browse files

#2584 improve search on description

parent 0c860aca
No related branches found
No related tags found
No related merge requests found
......@@ -94,7 +94,13 @@ public class DataConfigService extends FessAppService {
cb.query().setHandlerName_Wildcard(wrapQuery(dataConfigPager.handlerName));
}
if (StringUtil.isNotBlank(dataConfigPager.description)) {
cb.query().setDescription_Wildcard(wrapQuery(dataConfigPager.description));
if (dataConfigPager.description.startsWith("*")) {
cb.query().setDescription_Wildcard(dataConfigPager.description);
} else if (dataConfigPager.description.endsWith("*")) {
cb.query().setDescription_Prefix(dataConfigPager.description.replaceAll("\\*$", StringUtil.EMPTY));
} else {
cb.query().setDescription_MatchPhrase(dataConfigPager.description);
}
}
// TODO Long, Integer, String supported only.
......
......@@ -103,7 +103,13 @@ public class FileConfigService extends FessAppService {
cb.query().setPaths_Wildcard(wrapQuery(fileConfigPager.paths));
}
if (StringUtil.isNotBlank(fileConfigPager.description)) {
cb.query().setDescription_Wildcard(wrapQuery(fileConfigPager.description));
if (fileConfigPager.description.startsWith("*")) {
cb.query().setDescription_Wildcard(fileConfigPager.description);
} else if (fileConfigPager.description.endsWith("*")) {
cb.query().setDescription_Prefix(fileConfigPager.description.replaceAll("\\*$", StringUtil.EMPTY));
} else {
cb.query().setDescription_MatchPhrase(fileConfigPager.description);
}
}
// TODO Long, Integer, String supported only.
......
......@@ -111,7 +111,13 @@ public class WebConfigService extends FessAppService {
cb.query().setUrls_Wildcard(wrapQuery(webConfigPager.urls));
}
if (StringUtil.isNotBlank(webConfigPager.description)) {
cb.query().setDescription_Wildcard(wrapQuery(webConfigPager.description));
if (webConfigPager.description.startsWith("*")) {
cb.query().setDescription_Wildcard(webConfigPager.description);
} else if (webConfigPager.description.endsWith("*")) {
cb.query().setDescription_Prefix(webConfigPager.description.replaceAll("\\*$", StringUtil.EMPTY));
} else {
cb.query().setDescription_MatchPhrase(webConfigPager.description);
}
}
// TODO Long, Integer, String supported only.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment