Query Template Syntax
The default query template string is:
#and(#query(relevance_tuning) #and(#query(_default_) #query(refine) #query(security) #query(restriction) #query(date_restriction) #query(geo_restriction)))
The parameters following #query are replaced by named queries, whose names
are specified between parentheses. For example, relevance_tuning is the
name of the first named query. You can reference the default query (q in
UQL or eq in ELLQL) in the query template with
#query(_default_).
The query template is itself an ELLQL query that you can set dynamically using the
qt parameter. For example, with a query template of
qt=#and(#query(a) #query(b))
-
passing in
q.a=word1 OR word2andq.b=word3 OR word4 -
results in a final query of
(word1 OR word2) AND (word3 OR word4)Note: Through the API, you can pass additional queries using theq.NAMEparameter family. You can pass additional queries as ELLQL, using theeq.NAMEparameter family.
Options can be passed to the named queries specified after #query in the
query template and forwarded to top nodes. The options forwarded from the query template
always override the options that might be already present on the top nodes. For example,
qt=#and(#query{w=0.5}(a) #query(b))
-
passing in
q.a=word1{w=2}andq.b=word2 -
results in a final query of
word1{w=0.5} AND word2
For example:
-
If the query template is:
#and(#query{foo=bar}(_example_) #false) -
and the
_example_named query in the search field is:#fuzzyand(#or(#true)) -
the expanded query is:
#and(#fuzzyand{foo=bar}(#or(#true)) #false)