Interface XContentFieldFilter
public interface XContentFieldFilter
A filter that filter fields away from source
-
Method Summary
Modifier and TypeMethodDescriptionapply(BytesReference sourceBytes, org.elasticsearch.xcontent.XContentType xContentType) filter source inBytesReferenceformat and inXContentTypecontent type note that xContentType may be null in some case, we should guess xContentType from sourceBytes in such casesstatic XContentFieldFilternewFieldFilter(String[] includes, String[] excludes) ConstructXContentFieldFilterusing given includes and excludes
-
Method Details
-
apply
BytesReference apply(BytesReference sourceBytes, @Nullable org.elasticsearch.xcontent.XContentType xContentType) throws IOException filter source inBytesReferenceformat and inXContentTypecontent type note that xContentType may be null in some case, we should guess xContentType from sourceBytes in such cases- Throws:
IOException
-
newFieldFilter
ConstructXContentFieldFilterusing given includes and excludes- Parameters:
includes- fields to keep, wildcard supportedexcludes- fields to remove, wildcard supported- Returns:
- filter that filter
XContentwith given includes and excludes
-