-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsolr
161 lines (96 loc) · 5.38 KB
/
solr
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
/opt/solr-8.11.1/server/solr/orientation/conf
/opt/solr-8.11.1
/var/solr/data
/var/solr/data/server/solr/configsets/orientation
sudo service solr stop
sudo service solr start
sudo service solr status
# URL QUERY
~ single value field
http://orientationindex01dev.intranet.etnic.be:8983/solr/VW_PORTAIL_SO_DGSP/select?q=FOR_OBJ_ID:40&indent=true&rows=100000&wt=csv
~ Multiple value field
http://orientationindex01dev.intranet.etnic.be:8983/solr/VW_PORTAIL_SO_DGSP/select?q=FOR_OBJ_ID:40%0AFOR_OBJ_ID:41&indent=true&rows=100000&wt=csv
# CREATE CORE
cd /opt/solr-8.11.1/bin/
solr create -c orientation
@ PRESISTANT CORE
In your solr.xml, update <solr> or <solr persistent="false"> to <solr persistent="true">
# CHECK RUNNING
name : orientation
instancedir: server/solr/configsets/orientation
dataDir: data
config :solrconfig.xml
schema : schema.xml
# UPDATE SCHEMA
go to core page and hit reload button
http://orientationindex01dev.intranet.etnic.be:8983/solr/#/orientation/core-overview
#CLEAR INDEX
curl http://localhost:8983/solr/VW_PORTAIL_EPS_UNIE/update?commit=true -d "<delete><query>*:*</query></delete>"
# DELETE CORE
cd /opt/solr-8.11.1/bin/
solr delete -c products_shard1_replica_n1
bin/solr delete -c orientation_shard1_replica_n1
bin/solr delete -c orientation2_shard1_replica_n1
# REMOTE ACCES WRITER
http://orientationindex01dev.intranet.etnic.be:8983/solr/VW_PORTAIL_ORIENTATION/select?q=ipod&fl=id,cat,name,popularity,price,score&wt=csv
http://orientationindex01dev.intranet.etnic.be:8983/solr/VW_PORTAIL_ORIENTATION/select?indent=true&q.op=OR&q=*%3A*&wt=csv
returns:
# STOP
cd /opt/solr-8.11.1/bin/
./solr stop -p 8984
/opt/solr/bin/solr stop -all
/opt/solr/bin/solr stop -p 8983
# PK
The primary key for the entity. It is optional, and required only when using delta-imports. It has no relation to the uniqueKey defined in schema.xml but they can both be the same.
# ABORT
curl "http://orientationindex01dev.intranet.etnic.be:8983/solr/SECOND_ENSEIGN_ETAB/dataimport?command=abort"
# EXPORT
curl "http://localhost:8983/solr/VW_PORTAIL_EPS_ACTE/select?q=*:*&wt=csv&indent=true"
curl --negotiate -u : "http://localhost:8983/solr/orientation/select?q=*:*&wt=json&indent=true&rows=100000" >> /opt/solr-8.11.1/server/solr/orientation/export/collection_source.json
curl --negotiate -u : "http://localhost:8983/solr/VW_PORTAIL_EPS_ACTE/select?q=*:*&wt=csv&indent=true&rows=100000" >> /opt/solr-8.11.1/server/solr/ORIENTATION/VW_PORTAIL_EPS_ACTE/export/VW_PORTAIL_EPS_ACTE.csv
curl "http://localhost:8983/solr/orientation/export?q=my-query&sort=severity+desc,timestamp+desc&fl=severity,timestamp,msg"
http://host:port/solr/coreName/select?q=*%3A*&fl=fieldA,fieldB&wt=json&indent=true
# URL IMPORT
http://orientationindex01dev.intranet.etnic.be:8983/solr/QT_STRUCTURES_AUTORISEES/select?indent=true&rows=250000&q.op=OR&q=*%3A*&wt=csv
# SELECT
SELECT 'VW_SIEL_LM_ENTITY_NAME' AS entity_type, NS_ETAB_ID
http://orientationindex01dev.intranet.etnic.be:8983/solr/gettingstarted/select?fq=entity_type:VW_SIEL_LM_ENTITY_NAME
# STATUS
curl "http://localhost:8983/solr/orientation/dataimport?command=status"
# IMPORT
curl "http://localhost:8983/solr/orientation/dataimport?command=full-import"
curl "http://localhost:8983/solr/orientation/dataimport?command=full-import"
# RELOAD CONFIG
curl "http://localhost:8983/solr/#/orientation/dataimport//dataimport?command=reload-config"
= = = =
# DIH MANUAL
https://github.com/rohitbemax/dataimporthandler
~ Create a products collection
curl "http://localhost:8983/solr/admin/collections?action=CREATE&name=orientation2&numShards=1"
~ Deploy package on the collection
bin/solr package deploy data-import-handler -y -collections orientation2
~ Add the configurations and reload the collection
./server/scripts/cloud-scripts/zkcli.sh -z localhost:9983 -cmd putfile "/opt/solr-8.11.1/server/solr/orientation/conf/db-data-config-orientation.xml" db-data-config-orientation.xml
curl "localhost:8983/solr/admin/collections?action=RELOAD&name=orientation"
~ Run data import
curl http://localhost:8983/solr/orientation/dataimport?command=full-import
curl "http://localhost:8983/solr/orientation2/select?q=*:*"
________________________________________________________________________________________
curl "http://orientationindex01dev.intranet.etnic.be:8983/solr/admin/collections?action=CREATE&name=orientation&numShards=1"
bin/solr package deploy data-import-handler -y -collections orientation
-- Add the configurations and reload the collection
denis crespin
/opt/solr-8.11.1/server/scripts/cloud-scripts/zkcli.sh -z orientationindex01dev.intranet.etnic.be:9983 -cmd putfile "/configs/products.AUTOCREATED/data-config.xml" data-config.xml
# DELETE ALL CORE DATA
http://orientationindex01dev.intranet.etnic.be:8983/solr/VW_PORTAIL_EPS_CATAE/update?stream.body=<delete><query>*:*</query></delete>&commit=true
# DELETE INDEX
./post -c orientation delete.xml
# TEST IMPORT VANILLIA
cd /opt/solr-8.11.1/example/exampledocs
java -jar -Dc=orientation post.jar *.xml
# MySQL connector
http://dev.mysql.com/downloads/connector/j/
cd /opt/solr-8.11.1/contrib/dataimporthandler/lib
copy jar file in taht folder
/admin/cores?action=CREATE&name=portail_orientation&instanceDir=/opt/solr-8.11.1/instance&configSet=portail_orientation
./server/scripts/cloud-scripts/zkcli.sh -z orientationindex01dev.intranet.etnic.be:9983 -cmd putfile "/configs/orientation.AUTOCREATED/data-config.xml" data-config.xml