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