Skip to content

Commit 762b7cb

Browse files
authored
Switch derived source from field attributes to segment attribute (#2606)
Switches derived source from using field attributes to using segment attributes to track removed vector fields.The main motivation for this change is that: (1) it allows us to simplify mapper logic. We no longer need to add another field attribute to an already bloated set of field attributes. (2) At the time of setting field attributes, we do not have access to info about nesting scope for the field. If we switch to segment info, we can get the nested scope and avoid having to perform complex lucene low level operations to get this info ourselves. Along with the change, I moved certain components to the bwc package to preserve backwards compatibility. Additionally, I added several bwc tests. Signed-off-by: John Mazanec <[email protected]>
1 parent 55b9663 commit 762b7cb

21 files changed

+1200
-550
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Add filter function to KNNQueryBuilder with unit tests and integration tests [#2
1515
### Documentation
1616
### Maintenance
1717
### Refactoring
18+
* Switch derived source from field attributes to segment attribute [#2606](https://github.com/opensearch-project/k-NN/pull/2606)
1819

1920
## [Unreleased 2.x](https://github.com/opensearch-project/k-NN/compare/2.19...2.x)
2021
### Features

qa/restart-upgrade/build.gradle

+50
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,31 @@ testClusters {
126126
excludeTestsMatching "org.opensearch.knn.bwc.ScriptScoringIT.testNonKNNIndex_withMethodParams_withLuceneEngine"
127127
}
128128
}
129+
130+
if (knn_bwc_version.startsWith("1.") ||
131+
knn_bwc_version.startsWith("2.0.") ||
132+
knn_bwc_version.startsWith("2.1.") ||
133+
knn_bwc_version.startsWith("2.2.") ||
134+
knn_bwc_version.startsWith("2.3.") ||
135+
knn_bwc_version.startsWith("2.4") ||
136+
knn_bwc_version.startsWith("2.5.") ||
137+
knn_bwc_version.startsWith("2.6.") ||
138+
knn_bwc_version.startsWith("2.7.") ||
139+
knn_bwc_version.startsWith("2.8.") ||
140+
knn_bwc_version.startsWith("2.9.") ||
141+
knn_bwc_version.startsWith("2.10.") ||
142+
knn_bwc_version.startsWith("2.11.") ||
143+
knn_bwc_version.startsWith("2.12.") ||
144+
knn_bwc_version.startsWith("2.13.") ||
145+
knn_bwc_version.startsWith("2.14.") ||
146+
knn_bwc_version.startsWith("2.15.") ||
147+
knn_bwc_version.startsWith("2.16.") ||
148+
knn_bwc_version.startsWith("2.17.") ||
149+
knn_bwc_version.startsWith("2.18.")) {
150+
filter {
151+
excludeTestsMatching "org.opensearch.knn.bwc.DerivedSourceBWCRestartIT"
152+
}
153+
}
129154

130155
nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",")}")
131156
nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName()}")
@@ -230,6 +255,31 @@ testClusters {
230255
}
231256
}
232257

258+
if (knn_bwc_version.startsWith("1.") ||
259+
knn_bwc_version.startsWith("2.0.") ||
260+
knn_bwc_version.startsWith("2.1.") ||
261+
knn_bwc_version.startsWith("2.2.") ||
262+
knn_bwc_version.startsWith("2.3.") ||
263+
knn_bwc_version.startsWith("2.4") ||
264+
knn_bwc_version.startsWith("2.5.") ||
265+
knn_bwc_version.startsWith("2.6.") ||
266+
knn_bwc_version.startsWith("2.7.") ||
267+
knn_bwc_version.startsWith("2.8.") ||
268+
knn_bwc_version.startsWith("2.9.") ||
269+
knn_bwc_version.startsWith("2.10.") ||
270+
knn_bwc_version.startsWith("2.11.") ||
271+
knn_bwc_version.startsWith("2.12.") ||
272+
knn_bwc_version.startsWith("2.13.") ||
273+
knn_bwc_version.startsWith("2.14.") ||
274+
knn_bwc_version.startsWith("2.15.") ||
275+
knn_bwc_version.startsWith("2.16.") ||
276+
knn_bwc_version.startsWith("2.17.") ||
277+
knn_bwc_version.startsWith("2.18.")) {
278+
filter {
279+
excludeTestsMatching "org.opensearch.knn.bwc.DerivedSourceBWCRestartIT"
280+
}
281+
}
282+
233283
nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",")}")
234284
nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName()}")
235285
systemProperty 'tests.security.manager', 'false'

0 commit comments

Comments
 (0)