Skip to content

Commit

Permalink
Merge pull request #332 from BeliefYou8/UAVStackXingshengliLLL
Browse files Browse the repository at this point in the history
The log is too large to cause the insert data to fail
  • Loading branch information
zxy0728 authored Jun 28, 2018
2 parents 6e34ce4 + a878b81 commit f0cd13c
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@
public class HMNewLogIndexMgr extends AbstractComponent {

private static final String AppLog = "applog_";
/**
* Strings longer than the ignore_above setting will not be indexed This option is also useful for protecting
* against Lucene’s term byte-length limit of 32766 The value for ignore_above is the character count, but Lucene
* counts bytes. If you use UTF-8 text with many non-ASCII characters, you may want to set the limit to 32766 / 3 =
* 10922 since UTF-8 characters may occupy at most 3 bytes
*/
private static final int IGNORE_ABOVE = 32766 / 3;

private ESClient client;

Expand Down Expand Up @@ -195,6 +202,7 @@ public void prepareIndexType(String appid, String type) {
Map<String, Object> sfields = new HashMap<>();

sfields.put("type", "keyword");
sfields.put("ignore_above", IGNORE_ABOVE);

mapping.put("ipport", sfields);

Expand Down

0 comments on commit f0cd13c

Please sign in to comment.