Skip to content

Commit 3832fb2

Browse files
committed
FEATURE: Do not add mapping for a field that is marked as not to be indexed
1 parent cba9cd9 commit 3832fb2

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

Classes/Driver/Version6/Mapping/NodeTypeMappingBuilder.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ public function buildMappingInformation(Index $index): MappingCollection
6767
}
6868

6969
foreach ($nodeType->getProperties() as $propertyName => $propertyConfiguration) {
70+
// This property is configured to not be index, so do not add a mapping for it
71+
if (isset($propertyConfiguration['search']['indexing']) && $propertyConfiguration['search']['indexing'] === false) {
72+
continue;
73+
}
74+
7075
if (isset($propertyConfiguration['search']['elasticSearchMapping'])) {
7176
if (is_array($propertyConfiguration['search']['elasticSearchMapping'])) {
7277
$propertyMapping = $propertyConfiguration['search']['elasticSearchMapping'];

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ types in the `Acme.AcmeCom` namespace. The most specific configuration is used i
225225

226226
### Indexing configuration per data type
227227

228-
**The default configuration supports most usecases and often may not need to be touched, as this package comes
228+
**The default configuration supports most use cases and often may not need to be touched, as this package comes
229229
with sane defaults for all Neos data types.**
230230

231231
Indexing of properties is configured at two places. The defaults per-data-type are configured
@@ -285,7 +285,10 @@ the standard indexing configuration:
285285
* `Indexing.convertArrayOfNodesToArrayOfNodeIdentifiers(array $nodes)`: convert the given nodes to
286286
their node identifiers.
287287

288+
#### Skip indexing and mapping of a property
288289

290+
If you don't want a property to be indexed, set `indexing: false`. In this case no mapping is configured for this field.
291+
This can be used to also solve a type conflict of two node properties with same name and different type.
289292

290293
### Fulltext Indexing
291294

0 commit comments

Comments
 (0)