added comment, why we fail here.
This commit is contained in:
parent
40c22fc654
commit
1a55c073e8
|
@ -177,6 +177,9 @@ public class PercolatorFieldMapper extends FieldMapper {
|
|||
if (fieldMapper instanceof PercolatorFieldMapper) {
|
||||
PercolatorFieldType fieldType = (PercolatorFieldType) fieldMapper.fieldType();
|
||||
if (context.doc().getField(fieldType.getQueryBuilderFieldName()) != null) {
|
||||
// If a percolator query has been defined in an array object then multiple percolator queries
|
||||
// could be provided. In order to prevent this we fail if we try to parse more than one query
|
||||
// for the current document.
|
||||
throw new IllegalArgumentException("a document can only contain one percolator query");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue