Package org.apache.solr.handler.designer
Class SchemaDesignerAPI
- java.lang.Object
-
- org.apache.solr.handler.designer.SchemaDesignerAPI
-
- All Implemented Interfaces:
SchemaDesignerConstants
public class SchemaDesignerAPI extends Object implements SchemaDesignerConstants
All V2 APIs that have a prefix of /api/schema-designer/
-
-
Field Summary
-
Fields inherited from interface org.apache.solr.handler.designer.SchemaDesignerConstants
ANALYSIS_ERROR, AUTO_CREATE_FIELDS, BLOB_STORE_ID, CLEANUP_TEMP_PARAM, CONFIG_SET_PARAM, CONFIGOVERLAY_JSON, COPY_FROM_PARAM, DESIGNER_KEY, DESIGNER_PREFIX, DISABLE_DESIGNER_PARAM, DISABLED, DOC_ID_PARAM, ENABLE_DYNAMIC_FIELDS_PARAM, ENABLE_FIELD_GUESSING_PARAM, ENABLE_NESTED_DOCS_PARAM, ERROR_DETAILS, FIELD_PARAM, INDEX_TO_COLLECTION_PARAM, LANGUAGES_PARAM, MAX_SAMPLE_DOCS, NEW_COLLECTION_PARAM, PUBLISHED_VERSION, RELOAD_COLLECTIONS_PARAM, SCHEMA_VERSION_PARAM, SOLR_CONFIG_XML, TEMP_COLLECTION_PARAM, UNIQUE_KEY_FIELD_PARAM, UPDATE_ERROR
-
-
Constructor Summary
Constructors Constructor Description SchemaDesignerAPI(CoreContainer coreContainer)
-
Method Summary
-
-
-
Constructor Detail
-
SchemaDesignerAPI
public SchemaDesignerAPI(CoreContainer coreContainer)
-
-
Method Detail
-
newSchemaSuggester
public static SchemaSuggester newSchemaSuggester(CoreContainer coreContainer)
-
newSampleDocumentsLoader
public static SampleDocumentsLoader newSampleDocumentsLoader(CoreContainer coreContainer)
-
getInfo
public void getInfo(SolrQueryRequest req, SolrQueryResponse rsp) throws IOException
- Throws:
IOException
-
prepNewSchema
public void prepNewSchema(SolrQueryRequest req, SolrQueryResponse rsp) throws IOException, SolrServerException
- Throws:
IOException
SolrServerException
-
cleanupTemp
public void cleanupTemp(SolrQueryRequest req, SolrQueryResponse rsp) throws IOException, SolrServerException
- Throws:
IOException
SolrServerException
-
getFileContents
public void getFileContents(SolrQueryRequest req, SolrQueryResponse rsp) throws IOException
- Throws:
IOException
-
updateFileContents
public void updateFileContents(SolrQueryRequest req, SolrQueryResponse rsp) throws IOException, SolrServerException
- Throws:
IOException
SolrServerException
-
getSampleValue
public void getSampleValue(SolrQueryRequest req, SolrQueryResponse rsp) throws IOException
- Throws:
IOException
-
listCollectionsForConfig
public void listCollectionsForConfig(SolrQueryRequest req, SolrQueryResponse rsp)
-
listConfigs
public void listConfigs(SolrQueryRequest req, SolrQueryResponse rsp) throws IOException
- Throws:
IOException
-
listEnabledConfigs
protected Map<String,Integer> listEnabledConfigs() throws IOException
- Throws:
IOException
-
downloadConfig
public void downloadConfig(SolrQueryRequest req, SolrQueryResponse rsp) throws IOException
- Throws:
IOException
-
addSchemaObject
public void addSchemaObject(SolrQueryRequest req, SolrQueryResponse rsp) throws IOException, SolrServerException
- Throws:
IOException
SolrServerException
-
updateSchemaObject
public void updateSchemaObject(SolrQueryRequest req, SolrQueryResponse rsp) throws IOException, SolrServerException
- Throws:
IOException
SolrServerException
-
publish
public void publish(SolrQueryRequest req, SolrQueryResponse rsp) throws IOException, SolrServerException
- Throws:
IOException
SolrServerException
-
analyze
public void analyze(SolrQueryRequest req, SolrQueryResponse rsp) throws IOException, SolrServerException
- Throws:
IOException
SolrServerException
-
query
public void query(SolrQueryRequest req, SolrQueryResponse rsp) throws IOException, SolrServerException
- Throws:
IOException
SolrServerException
-
getSchemaDiff
public void getSchemaDiff(SolrQueryRequest req, SolrQueryResponse rsp) throws IOException
Return the diff of designer schema with the source schema (either previously published or the copyFrom).- Throws:
IOException
-
loadSampleDocuments
protected SampleDocuments loadSampleDocuments(SolrQueryRequest req, String configSet) throws IOException
- Throws:
IOException
-
analyzeInputDocs
protected ManagedIndexSchema analyzeInputDocs(Map<String,List<Object>> docs, ManagedIndexSchema schema, List<String> langs)
-
getMutableSchemaForConfigSet
protected org.apache.solr.handler.designer.SchemaDesignerSettings getMutableSchemaForConfigSet(String configSet, int schemaVersion, String copyFrom) throws IOException
- Throws:
IOException
-
extractSingleContentStream
protected ContentStream extractSingleContentStream(SolrQueryRequest req, boolean required)
-
cloudClient
protected CloudSolrClient cloudClient()
-
zkStateReader
protected ZkStateReader zkStateReader()
-
indexSampleDocsWithRebuildOnAnalysisError
protected Map<Object,Throwable> indexSampleDocsWithRebuildOnAnalysisError(String idField, List<SolrInputDocument> docs, String collectionName, boolean asBatch, String[] analysisErrorHolder) throws IOException, SolrServerException
- Throws:
IOException
SolrServerException
-
indexSampleDocs
protected Map<Object,Throwable> indexSampleDocs(String idField, List<SolrInputDocument> docs, String collectionName, boolean asBatch) throws IOException, SolrServerException
- Throws:
IOException
SolrServerException
-
waitToSeeSampleDocs
protected long waitToSeeSampleDocs(String collectionName, long numAdded) throws IOException, SolrServerException
- Throws:
IOException
SolrServerException
-
buildResponse
protected Map<String,Object> buildResponse(String configSet, ManagedIndexSchema schema, org.apache.solr.handler.designer.SchemaDesignerSettings settings, List<SolrInputDocument> docs) throws IOException
- Throws:
IOException
-
addErrorToResponse
protected void addErrorToResponse(String collection, SolrException solrExc, Map<Object,Throwable> errorsDuringIndexing, Map<String,Object> response, String updateError)
-
fieldToMap
protected SimpleOrderedMap<Object> fieldToMap(SchemaField f, ManagedIndexSchema schema)
-
readJsonFromRequest
protected Map<String,Object> readJsonFromRequest(SolrQueryRequest req) throws IOException
- Throws:
IOException
-
addSettingsToResponse
protected void addSettingsToResponse(org.apache.solr.handler.designer.SchemaDesignerSettings settings, Map<String,Object> response)
-
checkMutable
protected String checkMutable(String configSet, SolrQueryRequest req) throws IOException
- Throws:
IOException
-
requireSchemaVersionFromClient
protected int requireSchemaVersionFromClient(SolrQueryRequest req)
-
getRequiredParam
protected String getRequiredParam(String param, SolrQueryRequest req)
-
cleanupTemp
protected void cleanupTemp(String configSet) throws IOException, SolrServerException
- Throws:
IOException
SolrServerException
-
-