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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DotProductdotPdt represents "dotProduct".static GeoLocationgeoLocation(String field, Double longitude, Double latitude, String radius) GeoLocation geo location https://docs.vespa.ai/en/reference/query-language-reference.html#geolocationstatic NearestNeighbornearestNeighbor(String docVectorName, String queryVectorName) NearestNeighbor nearest neighbor https://docs.vespa.ai/en/reference/query-language-reference.html#nearestneighborstatic NonEmptyNonEmpty non empty.static Queryp()P represents "parentheses", used for generated a query in the parentheses.static Queryp(QueryChain query) P represents "parentheses", used for generated a query in the parentheses.static FieldP represents "parentheses", used for generated a query in the parentheses.static Rankrank(Query query, QueryChain... ranks) Rank rank.static Selectstatic Selectstatic UserInputui(Annotation a, String value) userInput with an annotation.static UserInputUI represents "userInput".static UserInputA convenience method to generate userInput with default index annotation.static WandWand wand.static WandWand wand.static WeakAndWeakand weak and.static WeightedSetwtdSet 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
-