|
1 | 1 | package org.ansj.elasticsearch.cat; |
2 | 2 |
|
| 3 | +import org.ansj.library.*; |
3 | 4 | import org.elasticsearch.action.admin.indices.analyze.AnalyzeRequest; |
4 | 5 | import org.elasticsearch.action.admin.indices.analyze.AnalyzeResponse; |
5 | 6 | import org.elasticsearch.client.node.NodeClient; |
|
13 | 14 | import org.elasticsearch.rest.action.cat.AbstractCatAction; |
14 | 15 | import org.nlpcn.commons.lang.util.StringUtil; |
15 | 16 |
|
| 17 | +import java.util.Arrays; |
| 18 | +import java.util.HashSet; |
| 19 | +import java.util.Set; |
| 20 | + |
16 | 21 | /** |
17 | 22 | * 分词的cat |
18 | 23 | * Created by zhangqinghua on 16/2/2. |
@@ -89,6 +94,15 @@ protected Table getTableWithHeader(RestRequest restRequest) { |
89 | 94 | return table; |
90 | 95 | } |
91 | 96 |
|
| 97 | + @Override |
| 98 | + protected Set<String> responseParams() { |
| 99 | + Set<String> responseParams = new HashSet<>(super.responseParams()); |
| 100 | + responseParams.addAll(Arrays.asList("text", "analyzer", "tokenizer", "type", "key", |
| 101 | + "isNameRecognition", "isNumRecognition", "isQuantifierRecognition", "isRealName", "isSkipUserDefine", |
| 102 | + CrfLibrary.DEFAULT, DicLibrary.DEFAULT, AmbiguityLibrary.DEFAULT, StopLibrary.DEFAULT, SynonymsLibrary.DEFAULT)); |
| 103 | + return responseParams; |
| 104 | + } |
| 105 | + |
92 | 106 | private Table buildTable(final AnalyzeResponse analyzeResponse, final RestRequest request) { |
93 | 107 | Table t = getTableWithHeader(request); |
94 | 108 | for (AnalyzeResponse.AnalyzeToken token : analyzeResponse.getTokens()) { |
|
0 commit comments