Package org.ametys.plugins.ai.search
Class VectorQuery
java.lang.Object
org.ametys.plugins.ai.search.VectorQuery
- All Implemented Interfaces:
Query
An embedding-based query, which can be used to perform a vector search (solr knn query).
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.ametys.cms.search.query.Query
Query.LogicalOperator, Query.Operator -
Field Summary
Fields inherited from interface org.ametys.cms.search.query.Query
BOOL_FILTER, BOOL_MUST, BOOL_MUST_NOT, BOOL_SHOULD -
Constructor Summary
ConstructorsConstructorDescriptionVectorQuery(String fieldName, List<Float> vector) Create a vector query with the given field name and vector, and a default of minReturn of 0.7.VectorQuery(String fieldName, List<Float> vector, double minReturn) Create a vector query with the given field name and vector, and a default topK of 10. -
Method Summary
-
Constructor Details
-
VectorQuery
Create a vector query with the given field name and vector, and a default of minReturn of 0.7.- Parameters:
fieldName- the name of the field to search onvector- the vector to search with
-
VectorQuery
Create a vector query with the given field name and vector, and a default topK of 10.- Parameters:
fieldName- the name of the field to search onvector- the vector to search withminReturn- the min return value for the vector similarity query (between 0 and 1, default is 0.7)
-
-
Method Details
-
build
Description copied from interface:QueryBuild the solr query string representing the Query object.- Specified by:
buildin interfaceQuery- Returns:
- the solr query string representing the Query object.
- Throws:
QuerySyntaxException- if the query can't be built because of a syntax error.
-
buildAsJson
Description copied from interface:QueryBuild the solr query representing the Query object.
The return type may be either String or Map<String, Object> following the Solr JSON Query DSL.- Specified by:
buildAsJsonin interfaceQuery- Returns:
- the solr query representing the Query object. Can be empty in case of empty query.
- Throws:
QuerySyntaxException- if the query can't be built because of a syntax error.
-
hashCode
-
equals
-