Mapping: Allow to have for a field to not be stored and not indexed, but still be included in `all`, closes #90.
This commit is contained in:
parent
5957f580e3
commit
9c0a37df32
|
@ -119,6 +119,9 @@ public class JsonBooleanFieldMapper extends JsonFieldMapper<Boolean> {
|
|||
}
|
||||
|
||||
@Override protected Field parseCreateField(JsonParseContext jsonContext) throws IOException {
|
||||
if (!indexed() && !stored()) {
|
||||
return null;
|
||||
}
|
||||
JsonToken token = jsonContext.jp().getCurrentToken();
|
||||
String value = null;
|
||||
if (token == JsonToken.VALUE_FALSE) {
|
||||
|
|
|
@ -267,9 +267,6 @@ public abstract class JsonFieldMapper<T> implements FieldMapper<T>, JsonMapper {
|
|||
}
|
||||
|
||||
@Override public void parse(JsonParseContext jsonContext) throws IOException {
|
||||
if (!indexed() && !stored()) {
|
||||
return;
|
||||
}
|
||||
Field field = parseCreateField(jsonContext);
|
||||
if (field == null) {
|
||||
return;
|
||||
|
|
|
@ -109,6 +109,9 @@ public class JsonStringFieldMapper extends JsonFieldMapper<String> implements Js
|
|||
if (includeInAll == null || includeInAll) {
|
||||
jsonContext.allEntries().addText(names.fullName(), value, boost);
|
||||
}
|
||||
if (!indexed() && !stored()) {
|
||||
return null;
|
||||
}
|
||||
return new Field(names.indexName(), value, store, index, termVector);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue