Commit be04608f by 侯昆

添加从自定义词库搜索

1 parent b7f01ebc
......@@ -18,10 +18,7 @@ import com.dookay.cihai.core.aip.AipWordUtilBean;
import com.dookay.cihai.core.theme.domain.ThemeDomain;
import com.dookay.cihai.core.theme.query.ThemeQuery;
import com.dookay.cihai.core.theme.service.IThemeService;
import com.dookay.cihai.core.word.domain.CustomDictionaryDomain;
import com.dookay.cihai.core.word.domain.WordDomain;
import com.dookay.cihai.core.word.query.CustomDictionaryQuery;
import com.dookay.cihai.core.word.query.WordQuery;
import com.dookay.cihai.core.word.service.ICustomDictionaryService;
import com.dookay.cihai.core.word.service.IWordService;
import com.dookay.coral.common.web.controller.BaseController;
......@@ -72,8 +69,16 @@ public class HomeController extends BaseController {
@ResponseBody
public JsonResult search(String keyword) {
System.out.println("进入搜索");
String result = null;
CustomDictionaryQuery query1 = new CustomDictionaryQuery();
query1.setWord(keyword);
try {
String result = aipWordUtilBean.extractQueryKeyword(keyword);
int count = customDictionaryService.count(query1);
if (count > 0) {
result = keyword;
} else {
result = aipWordUtilBean.extractQueryKeyword(keyword);
}
ThemeQuery query = new ThemeQuery();
query.setKeyword(result);
ThemeDomain themeDomain = themeService.getFirst(query);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!