Package ai.vespa.client.dsl
Class Q
java.lang.Object
ai.vespa.client.dsl.Q
Helper class for generating Vespa search queries
https://docs.vespa.ai/en/reference/query-language-reference.html
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic DotProduct
dotPdt represents "dotProduct".static GeoLocation
geoLocation
(String field, Double longitude, Double latitude, String radius) GeoLocation geo location https://docs.vespa.ai/en/reference/query-language-reference.html#geolocationstatic NearestNeighbor
nearestNeighbor
(String docVectorName, String queryVectorName) NearestNeighbor nearest neighbor https://docs.vespa.ai/en/reference/query-language-reference.html#nearestneighborstatic NonEmpty
NonEmpty non empty.static Query
p()
P represents "parentheses", used for generated a query in the parentheses.static Query
p
(QueryChain query) P represents "parentheses", used for generated a query in the parentheses.static Field
P represents "parentheses", used for generated a query in the parentheses.static Rank
Rank rank.static Select
static Select
static UserInput
ui
(Annotation a, String value) userInput with an annotation.static UserInput
UI represents "userInput".static UserInput
A convenience method to generate userInput with default index annotation.static Wand
Wand wand.static Wand
Wand wand.static WeakAnd
Weakand weak and.static WeightedSet
wtdSet represents "weightedSet".
-
Constructor Details
-
Q
public Q()
-
-
Method Details
-
select
-
select
-
p
P represents "parentheses", used for generated a query in the parentheses.- Parameters:
fieldName
- the field name- Returns:
- the field
-
p
P represents "parentheses", used for generated a query in the parentheses.- Parameters:
query
- the query- Returns:
- the query
-
p
P represents "parentheses", used for generated a query in the parentheses. This method generates an empty query- Returns:
- the empty query
-
rank
Rank rank. https://docs.vespa.ai/en/reference/query-language-reference.html#rank- Parameters:
query
- the queryranks
- the ranks- Returns:
- the rank query
-
ui
UI represents "userInput". https://docs.vespa.ai/en/reference/query-language-reference.html#userinput- Parameters:
value
- the value- Returns:
- the user input query
-
ui
userInput with an annotation. https://docs.vespa.ai/en/reference/query-language-reference.html#userinput- Parameters:
a
- the avalue
- the value- Returns:
- the user input query
-
ui
A convenience method to generate userInput with default index annotation. https://docs.vespa.ai/en/reference/query-language-reference.html#userinput- Parameters:
index
- the indexvalue
- the value- Returns:
- the user input query
-
dotPdt
dotPdt represents "dotProduct". https://docs.vespa.ai/en/reference/query-language-reference.html#dotproduct- Parameters:
field
- the fieldweightedSet
- the weighted set- Returns:
- the dot product query
-
wtdSet
wtdSet represents "weightedSet". https://docs.vespa.ai/en/reference/query-language-reference.html#weightedset- Parameters:
field
- the fieldweightedSet
- the weighted set- Returns:
- the weighted set query
-
nonEmpty
NonEmpty non empty. https://docs.vespa.ai/en/reference/query-language-reference.html#nonempty- Parameters:
query
- the query- Returns:
- the non empty query
-
wand
Wand wand. https://docs.vespa.ai/en/reference/query-language-reference.html#wand- Parameters:
field
- the fieldweightedSet
- the weighted set- Returns:
- the wand query
-
wand
Wand wand. https://docs.vespa.ai/en/reference/query-language-reference.html#wand- Parameters:
field
- the fieldnumericRange
- the numeric range- Returns:
- the wand query
-
weakand
Weakand weak and. https://docs.vespa.ai/en/reference/query-language-reference.html#weakand- Parameters:
query
- the query- Returns:
- the weak and query
-
geoLocation
public static GeoLocation geoLocation(String field, Double longitude, Double latitude, String radius) GeoLocation geo location https://docs.vespa.ai/en/reference/query-language-reference.html#geolocation- Parameters:
field
- the fieldlongitude
- longitudelatitude
- latituderadius
- a string specifying the radius and it's unit- Returns:
- the geo-location query
-
nearestNeighbor
NearestNeighbor nearest neighbor https://docs.vespa.ai/en/reference/query-language-reference.html#nearestneighbor- Parameters:
docVectorName
- the vector name defined in the vespa schemaqueryVectorName
- the vector name in this query- Returns:
- the nearest neighbor query
-