All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.volcengine.service.vikingDB.common.SearchByVectorParam Maven / Gradle / Ivy

There is a newer version: 1.0.192
Show newest version
package com.volcengine.service.vikingDB.common;

import java.util.List;
import java.util.Map;

import com.volcengine.service.vikingDB.VikingDBException;

import lombok.Data;
@Data
public class SearchByVectorParam {
    private List vector = null;
    private Map filter = null;
    private Integer limit = 10;
    private List outputFields = null;
    private Object partition = "default";
    private Integer isBuild = 0;
    private Map sparseVectors = null;
    private Double denseWeight = null;
    public SearchByVectorParam setVector(List vector){
        this.vector = vector;
        return this;
    }
    public SearchByVectorParam setFilter(Map filter){
        this.filter = filter;
        return this;
    }
    public SearchByVectorParam setLimit(Integer limit){
        this.limit = limit;
        return this;
    }
    public SearchByVectorParam setOutputFields(List outputFields){
        this.outputFields = outputFields;
        return this;
    }
    public SearchByVectorParam setPartition(Object partition){
        this.partition = partition;
        return this;
    }
    public SearchByVectorParam setSparseVectors(Map sparseVectors){
        this.sparseVectors = sparseVectors;
        return this;
    }
    public SearchByVectorParam setDenseWeight(Double denseWeight){
        this.denseWeight = denseWeight;
        return this;
    }
    public SearchByVectorParam build() throws Exception{
        VikingDBException vikingDBException = new VikingDBException(1000030, null, "Params does not exist");
        if(this.vector == null){
            throw vikingDBException.getErrorCodeException(1000030, null, "Vector does not exist");
        } else {
            this.isBuild = 1;
            return this;
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy