Search: When using `_all` for types, field name/type resolution might fail, closes #1704.

This commit is contained in:
Shay Banon 2012-02-15 15:50:22 +02:00
parent e1cca90006
commit d8f18dd812
2 changed files with 9 additions and 0 deletions

View File

@ -456,6 +456,9 @@ public class MapperService extends AbstractIndexComponent implements Iterable<Do
if (types == null || types.length == 0) {
return smartNameObjectMapper(smartName);
}
if (types.length == 1 && types[0].equals("_all")) {
return smartNameObjectMapper(smartName);
}
for (String type : types) {
DocumentMapper possibleDocMapper = mappers.get(type);
if (possibleDocMapper != null) {
@ -586,6 +589,9 @@ public class MapperService extends AbstractIndexComponent implements Iterable<Do
if (types == null || types.length == 0) {
return smartName(smartName);
}
if (types.length == 1 && types[0].equals("_all")) {
return smartName(smartName);
}
for (String type : types) {
DocumentMapper documentMapper = mappers.get(type);
// we found a mapper

View File

@ -275,6 +275,9 @@ public class QueryParseContext {
if (types == null || types.length == 0) {
return mapperService().types();
}
if (types.length == 1 && types[0].equals("_all")) {
return mapperService().types();
}
return Arrays.asList(types);
}