Package org.elasticsearch.indices

Examples of org.elasticsearch.indices.TypeMissingException


        DocumentMapper mapper = mappers.get(type);
        if (mapper != null) {
            return mapper;
        }
        if (!dynamic) {
            throw new TypeMissingException(index, type, "typing to auto create mapping, but dynamic mapping is disabled");
        }
        // go ahead and dynamically create it
        synchronized (mutex) {
            mapper = mappers.get(type);
            if (mapper != null) {
View Full Code Here


     */
    public Filter typesFilterFailOnMissing(String... types) throws TypeMissingException {
        if (types.length == 1) {
            DocumentMapper docMapper = documentMapper(types[0]);
            if (docMapper == null) {
                throw new TypeMissingException(index, types[0]);
            }
            return docMapper.typeFilter();
        }
        PublicTermsFilter termsFilter = new PublicTermsFilter();
        for (String type : types) {
            if (!hasMapping(type)) {
                throw new TypeMissingException(index, type);
            }
            termsFilter.addTerm(TypeFieldMapper.TERM_FACTORY.createTerm(type));
        }
        return termsFilter;
    }
View Full Code Here

                            }
                            builder.field(mappingMd.type());
                            builder.map(mapping);
                        }
                        if (!foundType) {
                            channel.sendResponse(new XContentThrowableRestResponse(request, new TypeMissingException(new Index(indices[0]), types.iterator().next())));
                            return;
                        }
                    } else {
                        for (IndexMetaData indexMetaData : metaData) {
                            builder.startObject(indexMetaData.index());
View Full Code Here

            Uid uid = extractUid(context, doc);

            DocumentMapper documentMapper = context.mapperService().documentMapper(uid.type());

            if (documentMapper == null) {
                throw new TypeMissingException(new Index(context.shardTarget().index()), uid.type(), "failed to find type loaded for doc [" + uid.id() + "]");
            }

            byte[] source = extractSource(doc, documentMapper);

            // get the version
View Full Code Here

                    if (indices.length != 0 && types.length != 0) {
                        return new BytesRestResponse(OK, builder.endObject());
                    } else if (indices.length != 0) {
                        return new BytesRestResponse(channel, new IndexMissingException(new Index(indices[0])));
                    } else if (types.length != 0) {
                        return new BytesRestResponse(channel, new TypeMissingException(new Index("_all"), types[0]));
                    } else {
                        return new BytesRestResponse(OK, builder.endObject());
                    }
                }
View Full Code Here

        DocumentMapper mapper = mappers.get(type);
        if (mapper != null) {
            return Tuple.tuple(mapper, Boolean.FALSE);
        }
        if (!dynamic) {
            throw new TypeMissingException(index, type, "trying to auto create mapping, but dynamic mapping is disabled");
        }
        // go ahead and dynamically create it
        synchronized (typeMutex) {
            mapper = mappers.get(type);
            if (mapper != null) {
View Full Code Here

                    return Regex.simpleMatch(request.types(), type);
                }

            });
            if (typeIntersection.isEmpty()) {
                throw new TypeMissingException(shardId.index(), request.types());
            }
        }

        MapBuilder<String, ImmutableMap<String, FieldMappingMetaData>> typeMappings = new MapBuilder<>();
        for (String type : typeIntersection) {
View Full Code Here

                    }
                    builder.put(indexBuilder);
                }

                if (!changed) {
                    throw new TypeMissingException(new Index(latestIndexWithout), request.types());
                }

                logger.info("[{}] remove_mapping [{}]", request.indices(), request.types());

                return ClusterState.builder(currentState).metaData(builder).build();
View Full Code Here

                        filterBuilder.should(new TypeFilterBuilder(type.key));
                        types.add(type.key);
                    }
                }
                if (types.size() == 0) {
                    throw new TypeMissingException(new Index("_all"), request.types(), "No index has the type.");
                }
                request.types(types.toArray(new String[types.size()]));
                QuerySourceBuilder querySourceBuilder = new QuerySourceBuilder()
                        .setQuery(QueryBuilders.filteredQuery(QueryBuilders.matchAllQuery(), filterBuilder));
View Full Code Here

TOP

Related Classes of org.elasticsearch.indices.TypeMissingException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.