You can use EXALEAD Low-Level Query Language (ELLQL) for programmatic generation of queries, similar to SQL. ELLQL is typically used by custom programs to enrich user queries and to add additional features. Internally, all user-entered UQL queries are transformed into ELLQL.
Why Use ELLQL?
You can use ELLQL to handle complex queries that would either be too difficult or not supported in UQL, which is the case for:
• Geographic search using Point fields. For more details on Point search, see Search a Geographic Point.
• Advanced Inner Joins, where you can specify which join type to use, are not possible in UQL. To do so, query the search API directly using ELLQL.
• Search for words that have a certain position in an index field. For example, if you want to search for a specific value only, such as all documents that have a title that starts with a particular word. If this word is “Rambo"; you would enter (#at(1,#alphanum(title,"rambo"))).
ELLQL vs UQL
You can pass ELLQL queries via the Search API using the eq parameter instead of q for UQL queries.
ELLQL operators work the same as UQL. Basic leaf nodes, however, work differently in ELLQL: they are index-level operators, not user-level operators. For example:
• In UQL, the query "a b" is tokenized and Exalead CloudView searches for two words. Using query expansion and prefix handling, Exalead CloudView can interpret this query to mean that we want to search in the text field.
• In ELLQL, you must write #and(#alphanum(text, "a") #alphanum(text, "b")).
To build a complex query containing some user parts written in UQL, and some advanced parts in ELLQL, you can insert UQL within an ELLQL query with the #uql ELLQL operator. For example,
Using ELLQL, you can pass a parameter that filters which hits to include in the search results for a query. The filtering criteria is defined as a virtual expression. If the virtual expression returns a 0 (false) value for the hit, the hit is excluded from the search results. The query pattern is: ?eq=#filter("virtual expression", ELLQL query).