Skip to content

Pre-create a sample schemaless collection for CDH Solr #5

@dimaspivak

Description

@dimaspivak

Reposting here for Srid:

To support testing or working on sample CDH Solr documents, a schemaless collection can be pre-created. Bash steps would look like below for creating sample schemaless Solr collection called sample_collection. (note: below sed will uncomment "df" field to use "id" as the default field)

More about this feature is documented in:
https://www.cloudera.com/documentation/enterprise/5-10-x/topics/search_validate_deploy_solr_rest_api.html
https://www.cloudera.com/documentation/enterprise/5-10-x/topics/search_solrctl_managing_solr.html#concept_l3y_txb_mt
https://www.cloudera.com/documentation/enterprise/5-10-x/topics/search_faq.html#faq_search_general_schemalesserror

solrctl instancedir --generate $HOME/sample_collection_solr_configs -schemaless
sed -i 's/.*<!--.*<str name="df".*>/<str name="df">id<\/str>/' $HOME/sample_collection_solr_configs/conf/solrconfig.xml
solrctl instancedir --create sample_collection $HOME/sample_collection_solr_configs
solrctl collection --create sample_collection -s 1 -c sample_collection```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions