Search code examples
linuxcurlsolrcygwin

indexing data in apache solr using bash script for curl


I am again posting the same question. Please help me in this problem. Here is the code for the bash script that I have written

declare -i i=1
for file in searchdumps/*
do
echo "indexing $file"
i=$((i+1))
curl "'http://localhost:8983/solr/update/extract?literal.id=document$i&uprefix=attr_content&commit=true' -F \"myfile=@/home/test/$file\"" 
done 

the path is correct the command when applied directly works, but when this script is executed there is an error

indexing searchdumps/1.pdf curl: (1) Protocol 'http not supported or disabled in libcurl


Solution

  • Please try this :-

    curl "http://localhost:8080/solr/update/extract?stream.file=/home/test/$file&literal.id=document$i&commit=true"