diff options
author | Geir Storli <geirst@verizonmedia.com> | 2020-05-12 15:52:15 +0000 |
---|---|---|
committer | Geir Storli <geirst@verizonmedia.com> | 2020-05-12 15:52:15 +0000 |
commit | fe5a4c73f70cc451f461bc007d1ce7d32481edb2 (patch) | |
tree | bd8007d72484c81f11d43ca4a3ec0003f74d0bec /config-model/src/main/javacc | |
parent | 2d5ddf827dcef2af9619f8a9fee148f9edd12b02 (diff) |
Support specifying a distance metric for nearest neighbor search when not having a hnsw index.
This also changes the syntax in the sd file to specifying the distance metric in the attribute tag.
Diffstat (limited to 'config-model/src/main/javacc')
-rw-r--r-- | config-model/src/main/javacc/SDParser.jj | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/config-model/src/main/javacc/SDParser.jj b/config-model/src/main/javacc/SDParser.jj index 3560cf2cd84..043599dedbf 100644 --- a/config-model/src/main/javacc/SDParser.jj +++ b/config-model/src/main/javacc/SDParser.jj @@ -1212,6 +1212,7 @@ Object sortingSetting(SortingOperation sorting, String attributeName) : */ Object attributeSetting(FieldOperationContainer field, AttributeOperation attribute, String attributeName) : { + String str; } { ( @@ -1228,6 +1229,7 @@ Object attributeSetting(FieldOperationContainer field, AttributeOperation attrib attribute.setAliasedName(aliasedName); } | attributeTensorType(attribute) + | <DISTANCEMETRIC> <COLON> str = identifierWithDash() { attribute.setDistanceMetric(str); } ) { return null; } } @@ -1816,7 +1818,6 @@ Object indexBody(IndexOperation index) : | <UPPERBOUND> <COLON> num = consumeLong() { index.setUpperBound(num); } | <DENSEPOSTINGLISTTHRESHOLD> <COLON> threshold = consumeFloat() { index.setDensePostingListThreshold(threshold); } | <ENABLE_BM25> { index.setEnableBm25(true); } - | <DISTANCEMETRIC> <COLON> str = identifierWithDash() { index.setDistanceMetric(str); } | hnswIndex(index) { } ) { return null; } |