I am trying to learn and create SOLR search engine for text search.
My initial step is to load a table of content from SQL to Solr. I have imported data using data import handler but Solr loaded only id field. Later I realised that the managed schema does not work with DIH. So I am currently switching form managed schema to classic schema.
One of the step that Solr learning material asks me to do is add new field through schema API and it has given below commands for UNIX. I am not sure its equivalent windows command. Since POST command cannot be used in windows.
curl -X POST -H 'Content-type:application/json' --data-binary '{
"add-field":{
"name":"sell-by",
"type":"tdate",
"stored":true
}
}' http://localhost:8983/solr/gettingstarted/schema
Below is the command I used which failed,
curl -X java -jar example\exampledocs\post.jar -H 'Content-type:application/json' --data-binary '{
"add-field":{
"name":"FIN",
"type":"int",
"stored":true
}
}' http://localhost:8983/solr/#/firstcore/schema
Your advice or help would be much appreciated. I am stuck here for long time. I could not find how to add fields in windows. Any advice would be very much appreciated.
There are some problem with your request parameter.
integer
not available by default if you are implemented it then it is fine.GET
while it require POST
. I think you removed it after try requesting it by POST
but it may end-up with Method Not Supported
.Method Not Supported
is not because of POST
method, it is because your URL was wrong, It should be http://localhost:8983/solr/firstcore/schema
.These are the problem which I find from your provided data and here is my example of adding field.
And Yes I am using Postman as a rest client
After success operation you will see you schema file of you collection will updated in Files menu on SOLR WebApp:
To check that: