@@ -68,7 +68,7 @@ conn$add(df, "books")
68
68
#> [1] 0
69
69
#>
70
70
#> $responseHeader$QTime
71
- #> [1] 51
71
+ #> [1] 36
72
72
```
73
73
74
74
### list
@@ -87,7 +87,7 @@ conn$add(ss, "books")
87
87
#> [1] 0
88
88
#>
89
89
#> $responseHeader$QTime
90
- #> [1] 26
90
+ #> [1] 37
91
91
```
92
92
93
93
## Delete documents
@@ -112,7 +112,7 @@ conn$add(docs, "gettingstarted")
112
112
#> [1] 0
113
113
#>
114
114
#> $responseHeader$QTime
115
- #> [1] 438
115
+ #> [1] 42
116
116
```
117
117
118
118
And the documents are now in your Solr database
@@ -124,11 +124,11 @@ conn$search(name = "gettingstarted", params = list(q = "*:*", rows = 3))
124
124
125
125
```
126
126
#> # A tibble: 3 x 4
127
- #> id title title_str `_version_`
128
- #> <chr> <chr> <chr> <dbl>
129
- #> 1 10 adfadsf adfadsf 1.582911e+18
130
- #> 2 12 though though 1.582911e+18
131
- #> 3 14 animals animals 1.582911e+18
127
+ #> id title title_str `_version_`
128
+ #> <chr> <chr> <chr> <dbl>
129
+ #> 1 10 adfadsf adfadsf 1.62e18
130
+ #> 2 12 though though 1.62e18
131
+ #> 3 14 animals animals 1.62e18
132
132
```
133
133
134
134
Now delete those documents just added
@@ -144,7 +144,7 @@ conn$delete_by_id(ids = c(1, 2, 3), "gettingstarted")
144
144
#> [1] 0
145
145
#>
146
146
#> $responseHeader$QTime
147
- #> [1] 129
147
+ #> [1] 19
148
148
```
149
149
150
150
And now they are gone
@@ -156,11 +156,11 @@ conn$search("gettingstarted", params = list(q = "*:*", rows = 4))
156
156
157
157
```
158
158
#> # A tibble: 3 x 4
159
- #> id title title_str `_version_`
160
- #> <chr> <chr> <chr> <dbl>
161
- #> 1 10 adfadsf adfadsf 1.582911e+18
162
- #> 2 12 though though 1.582911e+18
163
- #> 3 14 animals animals 1.582911e+18
159
+ #> id title title_str `_version_`
160
+ #> <chr> <chr> <chr> <dbl>
161
+ #> 1 10 adfadsf adfadsf 1.62e18
162
+ #> 2 12 though though 1.62e18
163
+ #> 3 14 animals animals 1.62e18
164
164
```
165
165
166
166
### By query
@@ -178,7 +178,7 @@ conn$add(docs, "gettingstarted")
178
178
#> [1] 0
179
179
#>
180
180
#> $responseHeader$QTime
181
- #> [1] 620
181
+ #> [1] 33
182
182
```
183
183
184
184
And the documents are now in your Solr database
@@ -190,13 +190,13 @@ conn$search("gettingstarted", params = list(q = "*:*", rows = 5))
190
190
191
191
```
192
192
#> # A tibble: 5 x 7
193
- #> id title title_str `_version_` price name name_str
194
- #> <chr> <chr> <chr> <dbl> <int> <chr> <chr>
195
- #> 1 10 adfadsf adfadsf 1.582911e+18 NA <NA> <NA>
196
- #> 2 12 though though 1.582911e+18 NA <NA> <NA>
197
- #> 3 14 animals animals 1.582911e+18 NA <NA> <NA>
198
- #> 4 1 <NA> <NA> 1.582912e+18 100 brown brown
199
- #> 5 2 <NA> <NA> 1.582912e+18 500 blue blue
193
+ #> id title title_str `_version_` price name name_str
194
+ #> <chr> <chr> <chr> <dbl> <int> <chr> <chr>
195
+ #> 1 10 adfadsf adfadsf 1.62e18 NA <NA> <NA>
196
+ #> 2 12 though though 1.62e18 NA <NA> <NA>
197
+ #> 3 14 animals animals 1.62e18 NA <NA> <NA>
198
+ #> 4 1 <NA> <NA> 1.62e18 100 brown brown
199
+ #> 5 2 <NA> <NA> 1.62e18 500 blue blue
200
200
```
201
201
202
202
Now delete those documents just added
@@ -212,7 +212,7 @@ conn$delete_by_query(query = "(name:blue OR name:pink)", "gettingstarted")
212
212
#> [1] 0
213
213
#>
214
214
#> $responseHeader$QTime
215
- #> [1] 45
215
+ #> [1] 26
216
216
```
217
217
218
218
And now they are gone
@@ -224,12 +224,12 @@ conn$search("gettingstarted", params = list(q = "*:*", rows = 5))
224
224
225
225
```
226
226
#> # A tibble: 4 x 7
227
- #> id title title_str `_version_` price name name_str
228
- #> <chr> <chr> <chr> <dbl> <int> <chr> <chr>
229
- #> 1 10 adfadsf adfadsf 1.582911e+18 NA <NA> <NA>
230
- #> 2 12 though though 1.582911e+18 NA <NA> <NA>
231
- #> 3 14 animals animals 1.582911e+18 NA <NA> <NA>
232
- #> 4 1 <NA> <NA> 1.582912e+18 100 brown brown
227
+ #> id title title_str `_version_` price name name_str
228
+ #> <chr> <chr> <chr> <dbl> <int> <chr> <chr>
229
+ #> 1 10 adfadsf adfadsf 1.62e18 NA <NA> <NA>
230
+ #> 2 12 though though 1.62e18 NA <NA> <NA>
231
+ #> 3 14 animals animals 1.62e18 NA <NA> <NA>
232
+ #> 4 1 <NA> <NA> 1.62e18 100 brown brown
233
233
```
234
234
235
235
## Update documents from files
@@ -256,7 +256,7 @@ conn$update_json(file, "books")
256
256
#> [1] 0
257
257
#>
258
258
#> $responseHeader$QTime
259
- #> [1] 58
259
+ #> [1] 59
260
260
```
261
261
262
262
### Add and delete in the same file
@@ -275,7 +275,7 @@ conn$add(ss, "books")
275
275
#> [1] 0
276
276
#>
277
277
#> $responseHeader$QTime
278
- #> [1] 49
278
+ #> [1] 57
279
279
```
280
280
281
281
Now add a new document, and delete the one we just made
@@ -298,7 +298,6 @@ cat(readLines(file), sep = "\n")
298
298
#> <field name="sequence_i">1</field>
299
299
#> <field name="genre_s">fantasy</field>
300
300
#> <field name="inStock">TRUE</field>
301
- #> <field name="price">12.5</field>
302
301
#> <field name="pages_i">384</field>
303
302
#> </doc>
304
303
#> </add>
@@ -318,7 +317,7 @@ conn$update_xml(file, "books")
318
317
#> [1] 0
319
318
#>
320
319
#> $responseHeader$QTime
321
- #> [1] 32
320
+ #> [1] 30
322
321
```
323
322
324
323
### Notes
0 commit comments