|
| 1 | +/* |
| 2 | + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except |
| 3 | + * in compliance with the License. You may obtain a copy of the License at |
| 4 | + * |
| 5 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 6 | + * |
| 7 | + * Unless required by applicable law or agreed to in writing, software distributed under the License |
| 8 | + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express |
| 9 | + * or implied. See the License for the specific language governing permissions and limitations under |
| 10 | + * the License. |
| 11 | + */ |
| 12 | +/* |
| 13 | + * This code was generated by https://github.com/googleapis/google-api-java-client-services/ |
| 14 | + * Modify at your own risk. |
| 15 | + */ |
| 16 | + |
| 17 | +package com.google.api.services.datastore.v1.model; |
| 18 | + |
| 19 | +/** |
| 20 | + * Nearest Neighbors search config. The ordering provided by FindNearest supersedes the order_by |
| 21 | + * stage. If multiple documents have the same vector distance, the returned document order is not |
| 22 | + * guaranteed to be stable between queries. |
| 23 | + * |
| 24 | + * <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is |
| 25 | + * transmitted over HTTP when working with the Cloud Datastore API. For a detailed explanation see: |
| 26 | + * <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a> |
| 27 | + * </p> |
| 28 | + * |
| 29 | + * @author Google, Inc. |
| 30 | + */ |
| 31 | +@SuppressWarnings("javadoc") |
| 32 | +public final class FindNearest extends com.google.api.client.json.GenericJson { |
| 33 | + |
| 34 | + /** |
| 35 | + * Required. The Distance Measure to use, required. |
| 36 | + * The value may be {@code null}. |
| 37 | + */ |
| 38 | + @com.google.api.client.util.Key |
| 39 | + private java.lang.String distanceMeasure; |
| 40 | + |
| 41 | + /** |
| 42 | + * Optional. Optional name of the field to output the result of the vector distance calculation. |
| 43 | + * Must conform to entity property limitations. |
| 44 | + * The value may be {@code null}. |
| 45 | + */ |
| 46 | + @com.google.api.client.util.Key |
| 47 | + private java.lang.String distanceResultProperty; |
| 48 | + |
| 49 | + /** |
| 50 | + * Optional. Option to specify a threshold for which no less similar documents will be returned. |
| 51 | + * The behavior of the specified `distance_measure` will affect the meaning of the distance |
| 52 | + * threshold. Since DOT_PRODUCT distances increase when the vectors are more similar, the |
| 53 | + * comparison is inverted. * For EUCLIDEAN, COSINE: WHERE distance <= distance_threshold * For |
| 54 | + * DOT_PRODUCT: WHERE distance >= distance_threshold |
| 55 | + * The value may be {@code null}. |
| 56 | + */ |
| 57 | + @com.google.api.client.util.Key |
| 58 | + private java.lang.Double distanceThreshold; |
| 59 | + |
| 60 | + /** |
| 61 | + * Required. The number of nearest neighbors to return. Must be a positive integer of no more than |
| 62 | + * 100. |
| 63 | + * The value may be {@code null}. |
| 64 | + */ |
| 65 | + @com.google.api.client.util.Key |
| 66 | + private java.lang.Integer limit; |
| 67 | + |
| 68 | + /** |
| 69 | + * Required. The query vector that we are searching on. Must be a vector of no more than 2048 |
| 70 | + * dimensions. |
| 71 | + * The value may be {@code null}. |
| 72 | + */ |
| 73 | + @com.google.api.client.util.Key |
| 74 | + private Value queryVector; |
| 75 | + |
| 76 | + /** |
| 77 | + * Required. An indexed vector property to search upon. Only documents which contain vectors whose |
| 78 | + * dimensionality match the query_vector can be returned. |
| 79 | + * The value may be {@code null}. |
| 80 | + */ |
| 81 | + @com.google.api.client.util.Key |
| 82 | + private PropertyReference vectorProperty; |
| 83 | + |
| 84 | + /** |
| 85 | + * Required. The Distance Measure to use, required. |
| 86 | + * @return value or {@code null} for none |
| 87 | + */ |
| 88 | + public java.lang.String getDistanceMeasure() { |
| 89 | + return distanceMeasure; |
| 90 | + } |
| 91 | + |
| 92 | + /** |
| 93 | + * Required. The Distance Measure to use, required. |
| 94 | + * @param distanceMeasure distanceMeasure or {@code null} for none |
| 95 | + */ |
| 96 | + public FindNearest setDistanceMeasure(java.lang.String distanceMeasure) { |
| 97 | + this.distanceMeasure = distanceMeasure; |
| 98 | + return this; |
| 99 | + } |
| 100 | + |
| 101 | + /** |
| 102 | + * Optional. Optional name of the field to output the result of the vector distance calculation. |
| 103 | + * Must conform to entity property limitations. |
| 104 | + * @return value or {@code null} for none |
| 105 | + */ |
| 106 | + public java.lang.String getDistanceResultProperty() { |
| 107 | + return distanceResultProperty; |
| 108 | + } |
| 109 | + |
| 110 | + /** |
| 111 | + * Optional. Optional name of the field to output the result of the vector distance calculation. |
| 112 | + * Must conform to entity property limitations. |
| 113 | + * @param distanceResultProperty distanceResultProperty or {@code null} for none |
| 114 | + */ |
| 115 | + public FindNearest setDistanceResultProperty(java.lang.String distanceResultProperty) { |
| 116 | + this.distanceResultProperty = distanceResultProperty; |
| 117 | + return this; |
| 118 | + } |
| 119 | + |
| 120 | + /** |
| 121 | + * Optional. Option to specify a threshold for which no less similar documents will be returned. |
| 122 | + * The behavior of the specified `distance_measure` will affect the meaning of the distance |
| 123 | + * threshold. Since DOT_PRODUCT distances increase when the vectors are more similar, the |
| 124 | + * comparison is inverted. * For EUCLIDEAN, COSINE: WHERE distance <= distance_threshold * For |
| 125 | + * DOT_PRODUCT: WHERE distance >= distance_threshold |
| 126 | + * @return value or {@code null} for none |
| 127 | + */ |
| 128 | + public java.lang.Double getDistanceThreshold() { |
| 129 | + return distanceThreshold; |
| 130 | + } |
| 131 | + |
| 132 | + /** |
| 133 | + * Optional. Option to specify a threshold for which no less similar documents will be returned. |
| 134 | + * The behavior of the specified `distance_measure` will affect the meaning of the distance |
| 135 | + * threshold. Since DOT_PRODUCT distances increase when the vectors are more similar, the |
| 136 | + * comparison is inverted. * For EUCLIDEAN, COSINE: WHERE distance <= distance_threshold * For |
| 137 | + * DOT_PRODUCT: WHERE distance >= distance_threshold |
| 138 | + * @param distanceThreshold distanceThreshold or {@code null} for none |
| 139 | + */ |
| 140 | + public FindNearest setDistanceThreshold(java.lang.Double distanceThreshold) { |
| 141 | + this.distanceThreshold = distanceThreshold; |
| 142 | + return this; |
| 143 | + } |
| 144 | + |
| 145 | + /** |
| 146 | + * Required. The number of nearest neighbors to return. Must be a positive integer of no more than |
| 147 | + * 100. |
| 148 | + * @return value or {@code null} for none |
| 149 | + */ |
| 150 | + public java.lang.Integer getLimit() { |
| 151 | + return limit; |
| 152 | + } |
| 153 | + |
| 154 | + /** |
| 155 | + * Required. The number of nearest neighbors to return. Must be a positive integer of no more than |
| 156 | + * 100. |
| 157 | + * @param limit limit or {@code null} for none |
| 158 | + */ |
| 159 | + public FindNearest setLimit(java.lang.Integer limit) { |
| 160 | + this.limit = limit; |
| 161 | + return this; |
| 162 | + } |
| 163 | + |
| 164 | + /** |
| 165 | + * Required. The query vector that we are searching on. Must be a vector of no more than 2048 |
| 166 | + * dimensions. |
| 167 | + * @return value or {@code null} for none |
| 168 | + */ |
| 169 | + public Value getQueryVector() { |
| 170 | + return queryVector; |
| 171 | + } |
| 172 | + |
| 173 | + /** |
| 174 | + * Required. The query vector that we are searching on. Must be a vector of no more than 2048 |
| 175 | + * dimensions. |
| 176 | + * @param queryVector queryVector or {@code null} for none |
| 177 | + */ |
| 178 | + public FindNearest setQueryVector(Value queryVector) { |
| 179 | + this.queryVector = queryVector; |
| 180 | + return this; |
| 181 | + } |
| 182 | + |
| 183 | + /** |
| 184 | + * Required. An indexed vector property to search upon. Only documents which contain vectors whose |
| 185 | + * dimensionality match the query_vector can be returned. |
| 186 | + * @return value or {@code null} for none |
| 187 | + */ |
| 188 | + public PropertyReference getVectorProperty() { |
| 189 | + return vectorProperty; |
| 190 | + } |
| 191 | + |
| 192 | + /** |
| 193 | + * Required. An indexed vector property to search upon. Only documents which contain vectors whose |
| 194 | + * dimensionality match the query_vector can be returned. |
| 195 | + * @param vectorProperty vectorProperty or {@code null} for none |
| 196 | + */ |
| 197 | + public FindNearest setVectorProperty(PropertyReference vectorProperty) { |
| 198 | + this.vectorProperty = vectorProperty; |
| 199 | + return this; |
| 200 | + } |
| 201 | + |
| 202 | + @Override |
| 203 | + public FindNearest set(String fieldName, Object value) { |
| 204 | + return (FindNearest) super.set(fieldName, value); |
| 205 | + } |
| 206 | + |
| 207 | + @Override |
| 208 | + public FindNearest clone() { |
| 209 | + return (FindNearest) super.clone(); |
| 210 | + } |
| 211 | + |
| 212 | +} |
0 commit comments