File tree 4 files changed +25
-42
lines changed
4 files changed +25
-42
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ {
2
+ "add" : {
3
+ "doc" : {
4
+ "id" : " 1" ,
5
+ "name_text" : [" William John Dueber" , " David Thomas Jones" ]
6
+ }
7
+ },
8
+ "add" : {
9
+ "doc" : {
10
+ "id" : 2 ,
11
+ "name_text" : [" Mike Dueber" , " William Penn" ]
12
+ }
13
+ }
14
+ }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 15
15
# limitations under the License.
16
16
17
17
FILES=$*
18
- URL=http://localhost:8983/solr/update
18
+ URL=' http://localhost:8983/solr/update/json?wt=json '
19
19
20
+ # Clear it out
21
+ echo
22
+ echo " Clearing out solr (delete all)"
23
+ curl $URL -s -d ' {"delete": { "query":"*:*" }, "commit": {}}' -H ' Content-type:application/json' > /dev/null
24
+
25
+ echo ' Posting file(s)'
20
26
for f in $FILES ; do
21
- echo Posting file $f to $URL
22
- curl $URL --data-binary @$f -H ' Content-type:application/xml'
23
- echo
27
+ echo " - $f "
28
+ curl $URL -s -d @$f -H ' Content-type:application/json' > /dev/null
24
29
done
25
30
26
31
# send the commit command to make sure all the changes are flushed and visible
27
- curl $URL --data-binary ' <commit/>' -H ' Content-type:application/xml'
32
+ echo " Final commit"
33
+ curl $URL -s -d ' {"commit": {}}' -H ' Content-type:application/json' > /dev/null
28
34
echo
You can’t perform that action at this time.
0 commit comments