Documentation
¶
Overview ¶
Copyright 2020 io.xream.sqlxb
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2020 io.xream.sqlxb ¶
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2020 io.xream.sqlxb ¶
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2020 io.xream.sqlxb ¶
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2020 io.xream.sqlxb ¶
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2020 io.xream.sqlxb ¶
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2020 io.xream.sqlxb ¶
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2020 io.xream.sqlxb ¶
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2020 io.xream.sqlxb ¶
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2020 io.xream.sqlxb ¶
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2020 io.xream.sqlxb ¶
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2020 io.xream.sqlxb ¶
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2020 io.xream.sqlxb ¶
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2020 io.xream.sqlxb ¶
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2020 io.xream.sqlxb ¶
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2020 io.xream.sqlxb ¶
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2020 io.xream.sqlxb ¶
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2020 io.xream.sqlxb ¶
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2020 io.xream.sqlxb ¶
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2020 io.xream.sqlxb ¶
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2020 io.xream.sqlxb ¶
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2020 io.xream.sqlxb ¶
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2020 io.xream.sqlxb ¶
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2020 io.xream.sqlxb ¶
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2020 io.xream.sqlxb ¶
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2020 io.xream.sqlxb ¶
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2020 io.xream.sqlxb ¶
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- func ASC() string
- func ASOF() string
- func Bool(b bool) *bool
- func Byte(b byte) *byte
- func CROSS() string
- func DESC() string
- func Eq() string
- func FULL_OUTER() string
- func Float32(f float32) *float32
- func Float64(f float64) *float64
- func GLOBAL() string
- func Gt() string
- func Gte() string
- func INNER() string
- func Int(v int) *int
- func Int8(v int8) *int8
- func Int16(v int16) *int16
- func Int32(v int32) *int32
- func Int64(v int64) *int64
- func IsNull() string
- func LEFT() string
- func Like() string
- func LikeLeft() string
- func Lt() string
- func Lte() string
- func N2s(p interface{}) string
- func NON_JOIN() string
- func Ne() string
- func NilOrNumber(p interface{}) (bool, interface{})
- func NonNull() string
- func NotLike() string
- func Np2s(p interface{}) (string, bool)
- func QdrantDistanceMetric(metric VectorDistance) string
- func RIGHT() string
- func Uint(v uint) *uint
- func Uint64(v uint64) *uint64
- type Bb
- type BoolFunc
- type BuilderX
- func (x *BuilderX) Agg(fn string, vs ...interface{}) *BuilderX
- func (x *BuilderX) And(f func(cb *CondBuilder)) *BuilderX
- func (x *BuilderX) Any(f func(x *BuilderX)) *BuilderX
- func (x *BuilderX) As(alia string) *BuilderX
- func (x *BuilderX) Bool(preCond BoolFunc, then func(cb *CondBuilder)) *BuilderX
- func (x *BuilderX) Build() *Built
- func (x *BuilderX) Eq(k string, v interface{}) *BuilderX
- func (x *BuilderX) From(orFromSql string) *BuilderX
- func (x *BuilderX) FromX(f func(fb *FromBuilder)) *BuilderX
- func (x *BuilderX) GroupBy(groupBy string) *BuilderX
- func (x *BuilderX) Gt(k string, v interface{}) *BuilderX
- func (x *BuilderX) Gte(k string, v interface{}) *BuilderX
- func (x *BuilderX) Having(f func(cb *CondBuilderX)) *BuilderX
- func (x *BuilderX) In(k string, vs ...interface{}) *BuilderX
- func (x *BuilderX) Insert(f func(b *InsertBuilder)) *BuilderX
- func (x *BuilderX) IsNull(key string) *BuilderX
- func (x *BuilderX) Last(last string) *BuilderX
- func (x *BuilderX) Like(k string, v string) *BuilderX
- func (x *BuilderX) LikeLeft(k string, v string) *BuilderX
- func (x *BuilderX) Lt(k string, v interface{}) *BuilderX
- func (x *BuilderX) Lte(k string, v interface{}) *BuilderX
- func (x *BuilderX) Meta() *interceptor.Metadata
- func (x *BuilderX) Ne(k string, v interface{}) *BuilderX
- func (x *BuilderX) Nin(k string, vs ...interface{}) *BuilderX
- func (x *BuilderX) NonNull(key string) *BuilderX
- func (x *BuilderX) NotLike(k string, v string) *BuilderX
- func (x *BuilderX) OR() *BuilderX
- func (x *BuilderX) Or(f func(cb *CondBuilder)) *BuilderX
- func (x *BuilderX) Paged(f func(pb *PageBuilder)) *BuilderX
- func (x *BuilderX) QdrantX(f func(qx *QdrantBuilderX)) *BuilderX
- func (x *BuilderX) Select(resultKeys ...string) *BuilderX
- func (x *BuilderX) Sort(orderBy string, direction Direction) *BuilderX
- func (x *BuilderX) Sub(s string, f func(sb *BuilderX)) *BuilderX
- func (x *BuilderX) Update(f func(ub *UpdateBuilder)) *BuilderX
- func (x *BuilderX) VectorDistance(metric VectorDistance) *BuilderX
- func (x *BuilderX) VectorDistanceFilter(field string, queryVector Vector, op string, threshold float32) *BuilderX
- func (x *BuilderX) VectorSearch(field string, queryVector Vector, topK int) *BuilderX
- func (x *BuilderX) WithDiversity(strategy DiversityStrategy, params ...interface{}) *BuilderX
- func (x *BuilderX) WithHashDiversity(hashField string) *BuilderX
- func (x *BuilderX) WithMMR(lambda float32) *BuilderX
- func (x *BuilderX) WithMinDistance(minDistance float32) *BuilderX
- func (x *BuilderX) WithoutOptimization() *BuilderX
- func (x *BuilderX) X(k string, vs ...interface{}) *BuilderX
- type Built
- func (built *Built) SqlOfCond() (string, string, []interface{})
- func (built *Built) SqlOfDelete() (string, []interface{})
- func (built *Built) SqlOfInsert() (string, []interface{})
- func (built *Built) SqlOfPage() (string, string, []interface{}, map[string]string)
- func (built *Built) SqlOfSelect() (string, []interface{}, map[string]string)
- func (built *Built) SqlOfUpdate() (string, []interface{})
- func (built *Built) SqlOfVectorSearch() (string, []interface{})
- func (built *Built) ToQdrantJSON() (string, error)
- func (built *Built) ToQdrantRequest() (*QdrantSearchRequest, error)
- type CondBuilder
- func (cb *CondBuilder) And(f func(cb *CondBuilder)) *CondBuilder
- func (cb *CondBuilder) Bool(preCond BoolFunc, f func(cb *CondBuilder)) *CondBuilder
- func (cb *CondBuilder) Eq(k string, v interface{}) *CondBuilder
- func (cb *CondBuilder) Gt(k string, v interface{}) *CondBuilder
- func (cb *CondBuilder) Gte(k string, v interface{}) *CondBuilder
- func (cb *CondBuilder) In(k string, vs ...interface{}) *CondBuilder
- func (cb *CondBuilder) IsNull(key string) *CondBuilder
- func (cb *CondBuilder) Like(k string, v string) *CondBuilder
- func (cb *CondBuilder) LikeLeft(k string, v string) *CondBuilder
- func (cb *CondBuilder) Lt(k string, v interface{}) *CondBuilder
- func (cb *CondBuilder) Lte(k string, v interface{}) *CondBuilder
- func (cb *CondBuilder) Ne(k string, v interface{}) *CondBuilder
- func (cb *CondBuilder) Nin(k string, vs ...interface{}) *CondBuilder
- func (cb *CondBuilder) NonNull(key string) *CondBuilder
- func (cb *CondBuilder) NotLike(k string, v string) *CondBuilder
- func (cb *CondBuilder) OR() *CondBuilder
- func (cb *CondBuilder) Or(f func(cb *CondBuilder)) *CondBuilder
- func (cb *CondBuilder) VectorDistance(metric VectorDistance) *CondBuilder
- func (cb *CondBuilder) VectorDistanceFilter(field string, queryVector Vector, op string, threshold float32) *CondBuilder
- func (cb *CondBuilder) VectorSearch(field string, queryVector Vector, topK int) *CondBuilder
- func (cb *CondBuilder) WithDiversity(strategy DiversityStrategy, params ...interface{}) *CondBuilder
- func (cb *CondBuilder) WithHashDiversity(hashField string) *CondBuilder
- func (cb *CondBuilder) WithMMR(lambda float32) *CondBuilder
- func (cb *CondBuilder) WithMinDistance(minDistance float32) *CondBuilder
- func (cb *CondBuilder) X(k string, vs ...interface{}) *CondBuilder
- type CondBuilderX
- type Direction
- type DiversityParams
- type DiversityStrategy
- type FromBuilder
- func (fb *FromBuilder) As(alia string) *FromBuilder
- func (fb *FromBuilder) Cond(on func(on *ON)) *FromBuilder
- func (fb *FromBuilder) JOIN(join JOIN) *FromBuilder
- func (fb *FromBuilder) Of(tableName string) *FromBuilder
- func (fb *FromBuilder) On(onStr string) *FromBuilder
- func (fb *FromBuilder) Sub(sub func(sb *BuilderX)) *FromBuilder
- func (fb *FromBuilder) Using(key string) *FromBuilder
- type FromX
- type InsertBuilder
- type JOIN
- type Join
- type LongId
- type ON
- type Op
- type PageBuilder
- type PageCondition
- type Po
- type QdrantBuilderX
- func (qx *QdrantBuilderX) Balanced() *QdrantBuilderX
- func (qx *QdrantBuilderX) Exact(exact bool) *QdrantBuilderX
- func (qx *QdrantBuilderX) HighPrecision() *QdrantBuilderX
- func (qx *QdrantBuilderX) HighSpeed() *QdrantBuilderX
- func (qx *QdrantBuilderX) HnswEf(ef int) *QdrantBuilderX
- func (qx *QdrantBuilderX) ScoreThreshold(threshold float32) *QdrantBuilderX
- func (qx *QdrantBuilderX) WithVector(withVector bool) *QdrantBuilderX
- func (qx *QdrantBuilderX) X(k string, v interface{}) *QdrantBuilderX
- type QdrantCondition
- type QdrantFilter
- type QdrantMatchCondition
- type QdrantRangeCondition
- type QdrantSearchParams
- type QdrantSearchRequest
- type Sort
- type StringId
- type TotalRows
- type USING
- type UpdateBuilder
- type Vector
- type VectorDistance
- type VectorDistanceFilterParams
- type VectorSearchParams
Constants ¶
const ( XX = "" AGG = "" SUB = "SUB" AND = "AND" OR = "OR" AND_SUB = AND OR_SUB = OR EQ = "=" NE = "<>" GT = ">" LT = "<" GTE = ">=" LTE = "<=" LIKE = "LIKE" NOT_LIKE = "NOT LIKE" IN = "IN" NIN = "NOT IN" IS_NULL = "IS NULL" NON_NULL = "IS NOT NULL" )
const ( VECTOR_SEARCH = "VECTOR_SEARCH" VECTOR_DISTANCE_FILTER = "VECTOR_DISTANCE_FILTER" )
向量操作符(v0.8.0 新增)
const ( QDRANT_HNSW_EF = "QDRANT_HNSW_EF" QDRANT_EXACT = "QDRANT_EXACT" QDRANT_SCORE_THRESHOLD = "QDRANT_SCORE_THRESHOLD" QDRANT_WITH_VECTOR = "QDRANT_WITH_VECTOR" QDRANT_XX = "QDRANT_XX" // 用户自定义 Qdrant 专属参数 )
Qdrant 专属操作符(v0.9.1 新增)
Variables ¶
This section is empty.
Functions ¶
func FULL_OUTER ¶ added in v0.5.4
func FULL_OUTER() string
func NilOrNumber ¶
func NilOrNumber(p interface{}) (bool, interface{})
func QdrantDistanceMetric ¶ added in v0.9.0
func QdrantDistanceMetric(metric VectorDistance) string
QdrantDistanceMetric 转换距离度量
Types ¶
type BuilderX ¶
type BuilderX struct {
CondBuilderX
// contains filtered or unexported fields
}
ToId build sql, like: SELECT DISTINCT f.id FROM foo f INNER_JOIN JOIN (SELECT foo_id FROM bar) b ON b.foo_id = f.id Sql for MySQL, Clickhouse....
@author Sim
func (*BuilderX) And ¶ added in v0.5.5
func (x *BuilderX) And(f func(cb *CondBuilder)) *BuilderX
func (*BuilderX) Bool ¶ added in v0.5.5
func (x *BuilderX) Bool(preCond BoolFunc, then func(cb *CondBuilder)) *BuilderX
func (*BuilderX) FromX ¶ added in v0.5.7
func (x *BuilderX) FromX(f func(fb *FromBuilder)) *BuilderX
func (*BuilderX) Having ¶
func (x *BuilderX) Having(f func(cb *CondBuilderX)) *BuilderX
func (*BuilderX) Insert ¶ added in v0.7.0
func (x *BuilderX) Insert(f func(b *InsertBuilder)) *BuilderX
func (*BuilderX) Or ¶ added in v0.5.5
func (x *BuilderX) Or(f func(cb *CondBuilder)) *BuilderX
func (*BuilderX) Paged ¶ added in v0.5.5
func (x *BuilderX) Paged(f func(pb *PageBuilder)) *BuilderX
func (*BuilderX) QdrantX ¶ added in v0.9.1
func (x *BuilderX) QdrantX(f func(qx *QdrantBuilderX)) *BuilderX
QdrantX 使用 Qdrant 专属构建器 ⭐ 只包含 Qdrant 专属的配置方法(HNSW, ScoreThreshold 等) ⭐ 通用方法(VectorSearch, WithHashDiversity)在外部调用
示例:
sqlxb.Of(&CodeVector{}).
Eq("language", "golang"). // 通用条件
VectorSearch("embedding", vec, 20). // 通用向量检索
WithHashDiversity("semantic_hash"). // 通用多样性
QdrantX(func(qx *QdrantBuilderX) {
qx.HnswEf(256). // ⭐ Qdrant 专属
ScoreThreshold(0.8). // ⭐ Qdrant 专属
WithVector(false) // ⭐ Qdrant 专属
}).
Build()
func (*BuilderX) Update ¶ added in v0.6.0
func (x *BuilderX) Update(f func(ub *UpdateBuilder)) *BuilderX
func (*BuilderX) VectorDistance ¶ added in v0.8.1
func (x *BuilderX) VectorDistance(metric VectorDistance) *BuilderX
VectorDistance 设置向量距离度量(BuilderX 扩展)
示例:
builder.VectorSearch("embedding", vec, 10).
VectorDistance(sqlxb.L2Distance)
func (*BuilderX) VectorDistanceFilter ¶ added in v0.8.1
func (x *BuilderX) VectorDistanceFilter( field string, queryVector Vector, op string, threshold float32, ) *BuilderX
VectorDistanceFilter 向量距离过滤(BuilderX 扩展)
示例:
builder.VectorDistanceFilter("embedding", queryVector, "<", 0.3)
func (*BuilderX) VectorSearch ¶ added in v0.8.1
VectorSearch 向量相似度检索(BuilderX 扩展) 与 CondBuilder.VectorSearch() 功能相同,但返回 *BuilderX 用于链式调用
示例:
sqlxb.Of(&CodeVector{}).
Eq("language", "golang").
VectorSearch("embedding", queryVector, 10).
Build().
SqlOfVectorSearch()
func (*BuilderX) WithDiversity ¶ added in v0.9.0
func (x *BuilderX) WithDiversity(strategy DiversityStrategy, params ...interface{}) *BuilderX
WithDiversity 设置多样性参数(BuilderX 扩展) ⭐ 核心:如果数据库不支持,会被自动忽略
示例:
sqlxb.Of(&CodeVector{}).
VectorSearch("embedding", vec, 20).
WithDiversity(sqlxb.DiversityByHash, "semantic_hash").
Build()
func (*BuilderX) WithHashDiversity ¶ added in v0.9.0
WithHashDiversity 设置哈希去重(BuilderX 扩展)
示例:
sqlxb.Of(&CodeVector{}).
VectorSearch("embedding", vec, 20).
WithHashDiversity("semantic_hash").
Build()
func (*BuilderX) WithMMR ¶ added in v0.9.0
WithMMR 设置 MMR 算法(BuilderX 扩展)
示例:
sqlxb.Of(&CodeVector{}).
VectorSearch("embedding", vec, 20).
WithMMR(0.5).
Build()
func (*BuilderX) WithMinDistance ¶ added in v0.9.0
WithMinDistance 设置最小距离多样性(BuilderX 扩展)
示例:
sqlxb.Of(&CodeVector{}).
VectorSearch("embedding", vec, 20).
WithMinDistance(0.3).
Build()
func (*BuilderX) WithoutOptimization ¶
type Built ¶
type Built struct {
Delete bool
Inserts *[]Bb
Updates *[]Bb
ResultKeys []string
Conds []Bb
Sorts []Sort
Havings []Bb
GroupBys []string
Aggs []Bb
Last string
OrFromSql string
Fxs []*FromX
Svs []interface{}
PageCondition *PageCondition
Meta *interceptor.Metadata // ⭐ 新增:元数据(v0.9.2)
}
func (*Built) SqlOfDelete ¶ added in v0.7.1
func (*Built) SqlOfInsert ¶ added in v0.7.0
func (*Built) SqlOfSelect ¶ added in v0.6.1
func (*Built) SqlOfUpdate ¶ added in v0.6.0
func (*Built) SqlOfVectorSearch ¶ added in v0.8.1
SqlOfVectorSearch 生成向量检索 SQL 返回: sql, args
示例输出:
SELECT *, embedding <-> ? AS distance FROM code_vectors WHERE language = ? ORDER BY distance LIMIT 10
func (*Built) ToQdrantJSON ¶ added in v0.9.0
ToQdrantJSON 转换为 Qdrant 搜索 JSON 返回: JSON 字符串, error
示例输出:
{
"vector": [0.1, 0.2, 0.3],
"limit": 20,
"filter": {
"must": [
{"key": "language", "match": {"value": "golang"}}
]
},
"with_payload": true,
"params": {"hnsw_ef": 128}
}
func (*Built) ToQdrantRequest ¶ added in v0.9.0
func (built *Built) ToQdrantRequest() (*QdrantSearchRequest, error)
ToQdrantRequest 转换为 Qdrant 请求结构
type CondBuilder ¶ added in v0.5.1
type CondBuilder struct {
// contains filtered or unexported fields
}
func (*CondBuilder) And ¶ added in v0.5.1
func (cb *CondBuilder) And(f func(cb *CondBuilder)) *CondBuilder
func (*CondBuilder) Bool ¶ added in v0.5.1
func (cb *CondBuilder) Bool(preCond BoolFunc, f func(cb *CondBuilder)) *CondBuilder
func (*CondBuilder) Eq ¶ added in v0.5.1
func (cb *CondBuilder) Eq(k string, v interface{}) *CondBuilder
func (*CondBuilder) Gt ¶ added in v0.5.1
func (cb *CondBuilder) Gt(k string, v interface{}) *CondBuilder
func (*CondBuilder) Gte ¶ added in v0.5.1
func (cb *CondBuilder) Gte(k string, v interface{}) *CondBuilder
func (*CondBuilder) In ¶ added in v0.5.1
func (cb *CondBuilder) In(k string, vs ...interface{}) *CondBuilder
func (*CondBuilder) IsNull ¶ added in v0.5.1
func (cb *CondBuilder) IsNull(key string) *CondBuilder
func (*CondBuilder) Like ¶ added in v0.5.1
func (cb *CondBuilder) Like(k string, v string) *CondBuilder
Like sql: LIKE %value%, Like() default has double %
func (*CondBuilder) LikeLeft ¶ added in v0.5.9
func (cb *CondBuilder) LikeLeft(k string, v string) *CondBuilder
LikeLeft sql: LIKE value%, Like() default has double %, then LikeLeft() remove left %
func (*CondBuilder) Lt ¶ added in v0.5.1
func (cb *CondBuilder) Lt(k string, v interface{}) *CondBuilder
func (*CondBuilder) Lte ¶ added in v0.5.1
func (cb *CondBuilder) Lte(k string, v interface{}) *CondBuilder
func (*CondBuilder) Ne ¶ added in v0.5.1
func (cb *CondBuilder) Ne(k string, v interface{}) *CondBuilder
func (*CondBuilder) Nin ¶ added in v0.5.1
func (cb *CondBuilder) Nin(k string, vs ...interface{}) *CondBuilder
func (*CondBuilder) NonNull ¶ added in v0.5.1
func (cb *CondBuilder) NonNull(key string) *CondBuilder
func (*CondBuilder) NotLike ¶ added in v0.5.1
func (cb *CondBuilder) NotLike(k string, v string) *CondBuilder
func (*CondBuilder) OR ¶ added in v0.5.1
func (cb *CondBuilder) OR() *CondBuilder
func (*CondBuilder) Or ¶ added in v0.5.1
func (cb *CondBuilder) Or(f func(cb *CondBuilder)) *CondBuilder
func (*CondBuilder) VectorDistance ¶ added in v0.8.1
func (cb *CondBuilder) VectorDistance(metric VectorDistance) *CondBuilder
VectorDistance 设置向量距离度量 必须在 VectorSearch() 之后调用
示例:
builder.VectorSearch("embedding", vec, 10).VectorDistance(sqlxb.L2Distance)
func (*CondBuilder) VectorDistanceFilter ¶ added in v0.8.1
func (cb *CondBuilder) VectorDistanceFilter( field string, queryVector Vector, op string, threshold float32, ) *CondBuilder
VectorDistanceFilter 向量距离过滤 用于: WHERE distance < threshold
示例:
builder.VectorDistanceFilter("embedding", queryVector, "<", 0.3)
生成 SQL:
WHERE (embedding <-> $1) < 0.3
func (*CondBuilder) VectorSearch ¶ added in v0.8.1
func (cb *CondBuilder) VectorSearch(field string, queryVector Vector, topK int) *CondBuilder
VectorSearch 向量相似度检索 field: 向量字段名 queryVector: 查询向量 topK: 返回 Top-K 个最相似的结果
示例:
builder.VectorSearch("embedding", queryVector, 10)
生成 SQL:
ORDER BY embedding <-> $1 LIMIT 10
func (*CondBuilder) WithDiversity ¶ added in v0.9.0
func (cb *CondBuilder) WithDiversity(strategy DiversityStrategy, params ...interface{}) *CondBuilder
WithDiversity 链式设置多样性参数 ⭐ 核心:如果数据库不支持,会被自动忽略
示例:
builder.VectorSearch("embedding", vec, 20).
WithDiversity(sqlxb.DiversityByHash, "semantic_hash")
func (*CondBuilder) WithHashDiversity ¶ added in v0.9.0
func (cb *CondBuilder) WithHashDiversity(hashField string) *CondBuilder
WithHashDiversity 快捷方法:设置哈希去重
示例:
builder.VectorSearch("embedding", vec, 20).
WithHashDiversity("semantic_hash")
func (*CondBuilder) WithMMR ¶ added in v0.9.0
func (cb *CondBuilder) WithMMR(lambda float32) *CondBuilder
WithMMR 快捷方法:设置 MMR 算法
示例:
builder.VectorSearch("embedding", vec, 20).
WithMMR(0.5) // lambda = 0.5,平衡相关性和多样性
func (*CondBuilder) WithMinDistance ¶ added in v0.9.0
func (cb *CondBuilder) WithMinDistance(minDistance float32) *CondBuilder
WithMinDistance 快捷方法:设置最小距离多样性
示例:
builder.VectorSearch("embedding", vec, 20).
WithMinDistance(0.3)
func (*CondBuilder) X ¶ added in v0.5.1
func (cb *CondBuilder) X(k string, vs ...interface{}) *CondBuilder
type CondBuilderX ¶ added in v0.5.11
type CondBuilderX struct {
CondBuilder
}
func (*CondBuilderX) Sub ¶ added in v0.5.11
func (x *CondBuilderX) Sub(s string, f func(sb *BuilderX)) *CondBuilderX
type DiversityParams ¶ added in v0.9.0
type DiversityParams struct {
// Enabled 是否启用多样性
Enabled bool
// Strategy 多样性策略
Strategy DiversityStrategy
// HashField 语义哈希字段名(用于 DiversityByHash)
// 例如: "semantic_hash", "content_hash"
HashField string
// MinDistance 结果之间的最小距离(用于 DiversityByDistance)
// 例如: 0.3 表示结果之间的距离至少为 0.3
MinDistance float32
// Lambda MMR 平衡参数(用于 DiversityByMMR)
// 范围: 0-1
// 0 = 完全多样性
// 1 = 完全相关性
// 0.5 = 平衡(推荐)
Lambda float32
// OverFetchFactor 过度获取因子
// 先获取 TopK * OverFetchFactor 个结果,再应用多样性过滤
// 默认: 5(获取 5 倍的结果后过滤)
OverFetchFactor int
}
DiversityParams 多样性查询参数
type DiversityStrategy ¶ added in v0.9.0
type DiversityStrategy string
DiversityStrategy 多样性策略
const ( // DiversityByHash 基于语义哈希去重 DiversityByHash DiversityStrategy = "hash" // DiversityByDistance 基于向量距离去重 DiversityByDistance DiversityStrategy = "distance" // DiversityByMMR 使用 MMR(Maximal Marginal Relevance)算法 DiversityByMMR DiversityStrategy = "mmr" )
type FromBuilder ¶ added in v0.5.6
type FromBuilder struct {
// contains filtered or unexported fields
}
func (*FromBuilder) As ¶ added in v0.5.9
func (fb *FromBuilder) As(alia string) *FromBuilder
func (*FromBuilder) Cond ¶ added in v0.5.6
func (fb *FromBuilder) Cond(on func(on *ON)) *FromBuilder
func (*FromBuilder) JOIN ¶ added in v0.5.6
func (fb *FromBuilder) JOIN(join JOIN) *FromBuilder
func (*FromBuilder) Of ¶ added in v0.5.6
func (fb *FromBuilder) Of(tableName string) *FromBuilder
func (*FromBuilder) On ¶ added in v0.5.6
func (fb *FromBuilder) On(onStr string) *FromBuilder
func (*FromBuilder) Sub ¶ added in v0.5.6
func (fb *FromBuilder) Sub(sub func(sb *BuilderX)) *FromBuilder
func (*FromBuilder) Using ¶ added in v0.5.6
func (fb *FromBuilder) Using(key string) *FromBuilder
type InsertBuilder ¶ added in v0.7.0
type InsertBuilder struct {
// contains filtered or unexported fields
}
func (*InsertBuilder) Set ¶ added in v0.7.0
func (b *InsertBuilder) Set(k string, v interface{}) *InsertBuilder
type ON ¶
type ON struct {
CondBuilder
// contains filtered or unexported fields
}
type PageBuilder ¶
type PageBuilder struct {
// contains filtered or unexported fields
}
func (*PageBuilder) IgnoreTotalRows ¶
func (pb *PageBuilder) IgnoreTotalRows() *PageBuilder
func (*PageBuilder) Last ¶
func (pb *PageBuilder) Last(last uint64) *PageBuilder
Last if ASC: orderBy > last else DESC: orderBy < last LIMIT rows
func (*PageBuilder) Page ¶
func (pb *PageBuilder) Page(page uint) *PageBuilder
func (*PageBuilder) Rows ¶
func (pb *PageBuilder) Rows(rows uint) *PageBuilder
func (*PageBuilder) SetTotalRowsIgnored ¶ added in v0.5.1
func (pb *PageBuilder) SetTotalRowsIgnored(ignored bool) *PageBuilder
type PageCondition ¶
type PageCondition struct {
// contains filtered or unexported fields
}
type QdrantBuilderX ¶ added in v0.9.1
type QdrantBuilderX struct {
// contains filtered or unexported fields
}
QdrantBuilderX Qdrant 专属构建器 提供 Qdrant 专属的高层 API
func (*QdrantBuilderX) Balanced ¶ added in v0.9.1
func (qx *QdrantBuilderX) Balanced() *QdrantBuilderX
Balanced 平衡模式(默认)
func (*QdrantBuilderX) Exact ¶ added in v0.9.1
func (qx *QdrantBuilderX) Exact(exact bool) *QdrantBuilderX
Exact 设置是否使用精确搜索(不使用索引) true: 精确搜索(慢但准确) false: 近似搜索(快但可能略不准)
func (*QdrantBuilderX) HighPrecision ¶ added in v0.9.1
func (qx *QdrantBuilderX) HighPrecision() *QdrantBuilderX
HighPrecision 高精度模式(牺牲速度)
func (*QdrantBuilderX) HighSpeed ¶ added in v0.9.1
func (qx *QdrantBuilderX) HighSpeed() *QdrantBuilderX
HighSpeed 高速模式(牺牲精度)
func (*QdrantBuilderX) HnswEf ¶ added in v0.9.1
func (qx *QdrantBuilderX) HnswEf(ef int) *QdrantBuilderX
HnswEf 设置 HNSW 算法的 ef 参数 ef 越大,查询精度越高,但速度越慢 推荐值: 64-256
func (*QdrantBuilderX) ScoreThreshold ¶ added in v0.9.1
func (qx *QdrantBuilderX) ScoreThreshold(threshold float32) *QdrantBuilderX
ScoreThreshold 设置最小相似度阈值 只返回相似度 >= threshold 的结果
func (*QdrantBuilderX) WithVector ¶ added in v0.9.1
func (qx *QdrantBuilderX) WithVector(withVector bool) *QdrantBuilderX
WithVector 设置是否返回向量数据 true: 返回向量(占用带宽) false: 不返回向量(节省带宽)
func (*QdrantBuilderX) X ¶ added in v0.9.1
func (qx *QdrantBuilderX) X(k string, v interface{}) *QdrantBuilderX
X Qdrant 用户自定义专属参数 用于设置 Qdrant 未来可能新增的参数,或 sqlxb 未封装的参数
示例:
qx.X("quantization", map[string]interface{}{
"rescore": true,
})
type QdrantCondition ¶ added in v0.9.0
type QdrantCondition struct {
Key string `json:"key,omitempty"`
Match *QdrantMatchCondition `json:"match,omitempty"`
Range *QdrantRangeCondition `json:"range,omitempty"`
}
QdrantCondition Qdrant 条件
type QdrantFilter ¶ added in v0.9.0
type QdrantFilter struct {
Must []QdrantCondition `json:"must,omitempty"`
Should []QdrantCondition `json:"should,omitempty"`
MustNot []QdrantCondition `json:"must_not,omitempty"`
}
QdrantFilter Qdrant 过滤器
type QdrantMatchCondition ¶ added in v0.9.0
type QdrantMatchCondition struct {
Value interface{} `json:"value,omitempty"`
Any []interface{} `json:"any,omitempty"`
}
QdrantMatchCondition Qdrant 精确匹配条件
type QdrantRangeCondition ¶ added in v0.9.0
type QdrantRangeCondition struct {
Gt *float64 `json:"gt,omitempty"`
Gte *float64 `json:"gte,omitempty"`
Lt *float64 `json:"lt,omitempty"`
Lte *float64 `json:"lte,omitempty"`
}
QdrantRangeCondition Qdrant 范围条件
type QdrantSearchParams ¶ added in v0.9.0
type QdrantSearchParams struct {
HnswEf int `json:"hnsw_ef,omitempty"`
Exact bool `json:"exact,omitempty"`
IndexedOnly bool `json:"indexed_only,omitempty"`
}
QdrantSearchParams Qdrant 搜索参数
type QdrantSearchRequest ¶ added in v0.9.0
type QdrantSearchRequest struct {
Vector []float32 `json:"vector"`
Limit int `json:"limit"`
Filter *QdrantFilter `json:"filter,omitempty"`
WithPayload interface{} `json:"with_payload,omitempty"` // true, false, or []string
WithVector bool `json:"with_vector,omitempty"`
ScoreThreshold *float32 `json:"score_threshold,omitempty"`
Offset int `json:"offset,omitempty"`
Params *QdrantSearchParams `json:"params,omitempty"`
}
QdrantSearchRequest Qdrant 搜索请求结构 文档: https://qdrant.tech/documentation/concepts/search/
type UpdateBuilder ¶ added in v0.6.0
type UpdateBuilder struct {
// contains filtered or unexported fields
}
func (*UpdateBuilder) Any ¶ added in v0.6.0
func (ub *UpdateBuilder) Any(f func(*UpdateBuilder)) *UpdateBuilder
func (*UpdateBuilder) Bool ¶ added in v0.6.0
func (ub *UpdateBuilder) Bool(preCond BoolFunc, f func(cb *UpdateBuilder)) *UpdateBuilder
func (*UpdateBuilder) Set ¶ added in v0.6.0
func (ub *UpdateBuilder) Set(k string, v interface{}) *UpdateBuilder
func (*UpdateBuilder) X ¶ added in v0.6.0
func (ub *UpdateBuilder) X(s string, vs ...interface{}) *UpdateBuilder
type Vector ¶ added in v0.8.1
type Vector []float32
Vector 向量类型(兼容 PostgreSQL pgvector)
func (Vector) Distance ¶ added in v0.8.1
func (v Vector) Distance(other Vector, metric VectorDistance) float32
Distance 计算两个向量的距离
type VectorDistance ¶ added in v0.8.1
type VectorDistance string
VectorDistance 向量距离度量类型
const ( // CosineDistance 余弦距离(最常用) // PostgreSQL: <-> CosineDistance VectorDistance = "<->" // L2Distance 欧氏距离(L2范数) // PostgreSQL: <#> L2Distance VectorDistance = "<#>" // InnerProduct 内积距离(点积) // PostgreSQL: <=> InnerProduct VectorDistance = "<=>" )
type VectorDistanceFilterParams ¶ added in v0.8.1
type VectorDistanceFilterParams struct {
QueryVector Vector
Operator string // <, <=, >, >=, =
Threshold float32
DistanceMetric VectorDistance
}
VectorDistanceFilterParams 向量距离过滤参数
type VectorSearchParams ¶ added in v0.8.1
type VectorSearchParams struct {
QueryVector Vector
TopK int
DistanceMetric VectorDistance
Diversity *DiversityParams // ⭐ 新增:多样性参数(可选)
}
VectorSearchParams 向量检索参数
Source Files
¶
- bb.go
- builder_insert.go
- builder_update.go
- builder_vector.go
- builder_x.go
- cond_builder.go
- cond_builder_vector.go
- cond_builder_x.go
- filter_last.go
- from_builder.go
- from_builder_optimization.go
- joins.go
- nil_able.go
- oper.go
- page_builder.go
- po.go
- qdrant_x.go
- sort.go
- to_agg.go
- to_from_sql_by_builder.go
- to_insert_set.go
- to_qdrant_json.go
- to_result_key.go
- to_sql.go
- to_update_set.go
- to_vector_sql.go
- vector_types.go