You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/documents.md
+17-4Lines changed: 17 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -223,16 +223,28 @@ $doc->reaction = $reaction;
223
223
$doc->setField('reaction', $reaction);
224
224
```
225
225
226
-
**Note:**Solarium can't index this single nested child correctly at the moment. For more info see [known limitations](#known-limitations).
226
+
**Note:**You have to use the JSON request format to index a labelled single nested child document. For more info see [known limitations](#known-limitations).
227
227
228
228
#### Anonymous children
229
229
230
230
If you use `_childDocuments_` as the field name, the child documents are indexed anonymously. This is not recommended by Solr.
231
231
232
232
#### Known limitations
233
233
234
-
- It's currently impossible to index a labelled single nested child document with Solarium because of [SOLR-16183](https://issues.apache.org/jira/browse/SOLR-16183). Any child document you index this way will end up as an anonymous nested child.
235
-
- Atomic updates of child documents aren't fully supported in Solarium because of [SOLR-12677](https://issues.apache.org/jira/browse/SOLR-12677).
234
+
Some child document functionality isn't supported by XML formatted update requests.
235
+
236
+
- It's impossible to index a labelled single nested child document because of [SOLR-16183](https://issues.apache.org/jira/browse/SOLR-16183). Any child document you index this way will end up as an anonymous nested child.
237
+
- Atomic updates of child documents aren't fully supported because of [SOLR-12677](https://issues.apache.org/jira/browse/SOLR-12677).
238
+
239
+
Make sure to set the request format to JSON if you require this functionality.
@@ -330,7 +342,7 @@ The document has `getVersion` and `setVersion` methods. By default no version is
330
342
331
343
But you can also set a custom version (specific ID).
332
344
333
-
For more info on versioning please see this blogpost: <http://yonik.com/solr/optimistic-concurrency/>
345
+
For more info on versioning please see this blogpost: <https://yonik.com/solr/optimistic-concurrency/>.
334
346
335
347
### Boosts
336
348
@@ -340,6 +352,7 @@ You can set the document boost with the `setBoost` method.
340
352
341
353
Field boosts can be set with the `setFieldBoost` method, or with optional parameters of the `setField` and `addField` methods. See the API docs for details.
342
354
355
+
Index-time boosts have been removed from Solr 7 and will be ignored. Even with older Solr versions, they aren't supported by JSON formatted update requests.
Copy file name to clipboardExpand all lines: docs/queries/update-query/best-practices-for-updates.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,6 +28,10 @@ If you need to use rollbacks (outside of testing) that usually indicates there i
28
28
29
29
While 'optimizing' sounds like it's always a good thing to do, you should use it with care, as it can have a negative performance impact *during the optimize process*. If possible use try to use it outside peak hours / at intervals.
30
30
31
+
### XML vs JSON formatted update requests
32
+
33
+
Solarium issues XML formatted update requests by default. This will change to JSON format when Solarium 7 is released. You can set this to JSON if you want to test your code in advance. If you require XML specific functionality, you should already set this to XML explicitly to ensure a seamless transition.
34
+
31
35
### Raw XML update commands
32
36
33
37
Solarium makes it easy to build update commands without having to know the underlying XML structure. If you already have XML formatted update commands, you can add them directly to an update query. Make sure they are valid as Solarium will not check this.
Copy file name to clipboardExpand all lines: docs/queries/update-query/building-an-update-query/building-an-update-query.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ However, if you do need to customize them for a special case, you can.
10
10
11
11
### RequestFormat
12
12
13
-
Solarium sends XML formatted update requests by default. You can change this to JSON formatted requests.
13
+
Solarium issues XML formatted update requests by default. This will change to JSON format when Solarium 7 is released. You can set this to JSON if you want to test your code in advance. If you require XML specific functionality, you should already set this to XML explicitly to ensure a seamless transition.
Copy file name to clipboardExpand all lines: docs/queries/update-query/building-an-update-query/rawxml-command.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,8 @@ You can use this command to add XML formatted update commands to an update query
2
2
3
3
Make sure the XML is valid as Solarium will not check this. If you are constructing these strings in your own code, you should probably be using the other commands Solarium provides to build your update query.
4
4
5
+
This command can only be used with the XML request format.
6
+
5
7
Options
6
8
-------
7
9
@@ -22,6 +24,9 @@ $client = new Solarium\Client($adapter, $eventDispatcher, $config);
Update queries allow you to add, delete, commit, optimize and rollback commands. For all the details about the Solr update handler please see the Solr documentation, but some important notes:
2
2
3
3
- Solr has no 'update' command. But if you add a document with a value for the 'unique key' field that already exists in the index that existing document will be overwritten by your new document.
4
-
-You can only add complete documents. If you want to update only a single field you still need to 'add' the whole document.
4
+
- If you want to update only a single field you either need to 'add' the whole document or use atomic updates if your schema is configured to support this.
5
5
- Always use a database or other persistent storage as the source for building documents to add. Don't be tempted to emulate an update command by selecting a document, altering it and adding it. Almost all schemas will have fields that are indexed and not stored. You will lose the data in those fields.
6
6
- The best way to use update queries is also related to your Solr config. If you are for instance using the autocommit feature of Solr you probably don't want to use a commit command in your update queries. Make sure you know the configuration details of the Solr core you use.
7
-
7
+
- Some functionality is only available with XML formatted or JSON formatted update queries, but not both. Set the appropriate request format if necessary.
0 commit comments