Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.solr.handler.admin.api;
import static org.apache.solr.client.solrj.impl.BinaryResponseParser.BINARY_CONTENT_TYPE_V2;
import com.fasterxml.jackson.annotation.JsonProperty;
import jakarta.inject.Inject;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.PathParam;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.MediaType;
import java.util.List;
import java.util.Map;
import org.apache.solr.api.JerseyResource;
import org.apache.solr.client.api.model.SolrJerseyResponse;
import org.apache.solr.common.MapWriter;
import org.apache.solr.common.SolrException;
import org.apache.solr.common.cloud.SolrClassLoader;
import org.apache.solr.common.params.SolrParams;
import org.apache.solr.common.util.NamedList;
import org.apache.solr.common.util.SimpleOrderedMap;
import org.apache.solr.core.PluginInfo;
import org.apache.solr.jersey.PermissionName;
import org.apache.solr.pkg.PackageListeningClassLoader;
import org.apache.solr.schema.IndexSchema;
import org.apache.solr.security.PermissionNameProvider;
/**
* GetSchemaFieldAPI contains the V2 APIs for all field related endpoint which are
*
*
*
/fields
*
/fields/{fieldName}
*
/copyfields
*
/dynamicfields
*
/dynamicfields/{fieldName}
*
/fieldtypes
*
/fieldtypes/{fieldTypeName}
*
*/
@Path("/{a:cores|collections}/{collectionName}/schema")
public class GetSchemaFieldAPI /*extends GetSchemaAPI*/ extends JerseyResource {
private final IndexSchema indexSchema;
private final SolrParams params;
// TODO Stop using SolrParams here and instead give API methods parameters representing only those
// query-params that they support
@Inject
public GetSchemaFieldAPI(IndexSchema indexSchema, SolrParams params) {
this.indexSchema = indexSchema;
this.params = params;
}
@GET
@Path("/fields")
@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, BINARY_CONTENT_TYPE_V2})
@PermissionName(PermissionNameProvider.Name.SCHEMA_READ_PERM)
public SchemaListFieldsResponse listSchemaFields() {
SchemaListFieldsResponse response = instantiateJerseyResponse(SchemaListFieldsResponse.class);
final String realName = "fields";
response.fields = listAllFieldsOfType(realName, params);
return response;
}
public static class SchemaListFieldsResponse extends SolrJerseyResponse {
@JsonProperty("fields")
public List