You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by John Mitchell <jm...@collabralink.com> on 2016/03/18 14:31:05 UTC
Would it be better to make my Schema changes within the renamed
"/solr-5.3.0/server/solr/configsets/data_driven_schema_configs/conf/schema.xml"
instead of the way that I am doing it now via curl -X POST -H
'Content-type:application/json' --data-binary '{ "add-field": "?
I noticed that within
"/solr-5.3.0/server/solr/configsets/data_driven_schema_configs/conf" it has
a file called "managed-schema" and within this file it says "This is the
Solr schema file. This file should be named "schema.xml" and should be in
the conf directory". Currently I have not renamed this file to
"schema.xml" and any adjustments to the Schema I have done via "curl -X
POST -H 'Content-type:application/json' --data-binary '{
"add-field": ".
My question would it be better to make my Schema changes within the renamed
"/solr-5.3.0/server/solr/configsets/data_driven_schema_configs/conf/schema.xml"
instead of the way that I am doing it now via curl -X POST -H
'Content-type:application/json' --data-binary '{
"add-field": "?
I have pasted below my shell script which starts with an empty Solr, then
adds to the Schema via "curl -X POST -H 'Content-type:application/json'
--data-binary '{ "add-field": ", and then
runs Norconex-Collector-Http webcrawler which commits into Solr.
Thanks,
John Mitchell
========================================================================================
#!/bin/bash
cd /home/jmitchell/20150905/solr-5.3.0
bin/solr stop -all ; rm -Rf example/cloud/
bin/solr start -e cloud -noprompt
##### I am using a dynamic schema so I added the "content" field with the
type of "text_general" (see below) before starting to load any data into
Apache Solr and now everything correctly loads into Apache Solr. For now
not using the default "_text_" field as a replacement for the "content"
field.
curl -X POST -H 'Content-type:application/json' --data-binary '{
"add-field":{ "name":"content", "type":"text_general" } }'
http://localhost:8983/solr/gettingstarted/schema
##### Adding the "Institutions_of_Higher_Education" field with a type of
strings:
curl -X POST -H 'Content-type:application/json' --data-binary '{
"add-field":{ "name":"Institutions_of_Higher_Education", "type":"strings" }
}' http://localhost:8983/solr/gettingstarted/schema
curl -X POST -H 'Content-type:application/json' --data-binary '{
"add-field":{ "name":"Local_Education_Agencies", "type":"strings" } }'
http://localhost:8983/solr/gettingstarted/schema
curl -X POST -H 'Content-type:application/json' --data-binary '{
"add-field":{ "name":"Nonprofit_Organizations", "type":"strings" } }'
http://localhost:8983/solr/gettingstarted/schema
curl -X POST -H 'Content-type:application/json' --data-binary '{
"add-field":{ "name":"Other_Organizations_and_or_Agencies",
"type":"strings" } }' http://localhost:8983/solr/gettingstarted/schema
curl -X POST -H 'Content-type:application/json' --data-binary '{
"add-field":{ "name":"State_Education_Agencies", "type":"strings" } }'
http://localhost:8983/solr/gettingstarted/schema
cd ..
chmod -R 777 solr-5.3.0
cd norconex-collector-http-2.2.1
rm -rf committer-queue/ examples-output/
#curl "
http://localhost:8983/solr/gettingstarted/select?q=*:*&wt=json&indent=true&rows=100000
"
/home/jmitchell/20150905/norconex-collector-http-2.2.1/collector-http.sh -a
start -c examples/minimum/minimum-config.xml 2>&1 >
/home/jmitchell/collector-http-solr-gettingstarted-changed_content_structure_adding_new_faceted_fields_3.txt
&
========================================================================================
Re: Would it be better to make my Schema changes within the renamed
"/solr-5.3.0/server/solr/configsets/data_driven_schema_configs/conf/schema.xml"
instead of the way that I am doing it now via curl -X POST -H
'Content-type:application/json' --data-binary '{ "add-field": "?
Posted by Shawn Heisey <ap...@elyograg.org>.
On 3/18/2016 7:31 AM, John Mitchell wrote:
> My question would it be better to make my Schema changes within the renamed
> "/solr-5.3.0/server/solr/configsets/data_driven_schema_configs/conf/schema.xml"
> instead of the way that I am doing it now via curl -X POST -H
> 'Content-type:application/json' --data-binary '{
> "add-field": "?
Only you can answer this question. Do you want to continue using the
http API, or do you want to hand-edit the schema and reload the
core/collection? Both are possible, but you should pick one or the other.
Note that you would not change the file in data_driven_schema_configs --
this is not the active configuration for a running index, it's a config
source for newly created indexes. If you're not in cloud mode, you
would change the config in your core's conf directory. If you're
running SolrCloud (Solr with zookeeper), the changes would need to be
made in zookeeper, most likely with the upconfig command on the zkcli
script. After the change, the core/collection needs a reload.
Thanks,
Shawn