Constructors
SearchEngine()
Methods
addComparison(String,String,String,String,Integer)
Adds a field-comparison criterion that compares 2 database fields to a database query. You can optionally add functions to be applied to the 2 fields.addComparison(String,String,String,String,String,String,Integer)
Adds a field-comparison criterion that compares 2 database fields to a database query with functions to be applied to the 2 fields.addCriteria(String,String,String)
Adds a criterion on a database field to the database query You can optionally add a row operator, priority, and function to be applied to the field.Comparison operators
addCriteria(String,String,String,String,Integer)
Adds a criterion on a database field to the database query You can optionally add a function to be applied to the field.addCriteria(String,String,String,String,String,Integer)
Adds a criterion on a database field to the database query.addData(String,String)
Adds data for use in an update or insert query.addDataField(String,String)
Adds a data field to the SearchEngine. A data field is a field assigned to another field instead of a value.You can optionally add a function to be applied to the second field.Can only be used in update() queries.
addDataField(String,String,String)
Adds a data field to the SearchEngine. A data field is a field assigned to another field instead of a value. Can only be used in update() queries.Available functions
- count
- avg
- sum
- max
- min
- hour
- wday
- upper
- lower
- castToVarchar
- date
- time
addField(String)
Adds a field to the SELECT part of the database queryYou can optionally add a function to be applied to the field.
addField(String,String)
Adds a field to the SELECT part of the database query with a function to be applied to the field.Available functions
- count
- avg
- sum
- max
- min
- hour
- wday
- upper
addFields(String,String)
A shortcut to add multiple fields to a query. Adds all fields in the comma-separated string “fields”, prefixed by “table” and a dot ”.”.addHaving(String,String,String,String,Integer)
Adds a HAVING clause to the database query.You can optionally add a function to be applied to the field.
addHaving(String,String,String,String,String,Integer)
Adds a HAVING clause to the database query.addJoinCriteria(String,String,String,String,Integer)
Does NOT work with NetServer. You need to bypass NetServer (see the method bypassNetServer) if you need to use this.addOrder(String,Bool)
Adds a restriction to the order on the listing of the database result.You can optionally add a function to be applied to the field.
addOrder(String,String,Bool)
Adds a restriction to the order on the listing of the database result.Available functions
- Count
- Avg
- Sum
- Max
- Min
- Hour
- WDay
- Upper
buildSql()
Returns the SQL query generated by the SearchEngine. The query is built by <code>addCriteria()</code>,<code>addComparison()</code>,<code>addData()</code>, and so on.For versions 7.0 and newer, the statement returned will be an estimate of the SQL, since the query is sent to NetServer instead.
buildSql(String)
Returns the SQL query generated by the SearchEngine. The query is built by <code>addCriteria()</code>,<code>addComparison()</code>,<code>addData()</code>, and so on.For versions 7.0 and newer, the statement returned will be an estimate of the SQL, since the query is sent to NetServer instead.
bypassNetServer(Bool)
From version 7, all queries are sent to NetServer instead of directly to the database. This function will allow you to send the queries directly to the database instead.Has no effect if the registry value (reg_id = 235) is set to 0.Be aware of any security implications by circumventing the NetServer.
countColumns()
Returns the count of columns (selected fields) in the SearchEngine query.countRows()
Returns the number of rows in the result set.delete()
After adding criteria, call this to delete the items that was selected by the query.eof()
Checks if the end of the result set is reached.execute()
Executes the query. Must be called to get the results.executeHTMLTable()
Executes the query and return the result as a HTML formatted table.executeInto(StringMatrix)
Executes the query and returns the result in the matrix.executeJSON()
Executes the query and return the result as a JSON formatted text.executeTextTable()
Executes the query and return the result as a text formatted table (similar to MySQL).have some overhead for large result sets.
executeToJSONBuilder(JSONBuilder,String,String)
Executes the SearchEngine to a JSONBuilder. The fields string can contain a comma-separated list of label:fieldType elements, allowing you to better control the resulting json. The label is the name the field gets in the json object. The fieldType can be “Integer”, “Float”, “Bool”, or “String” (default). The json object member will be formatted accordingly, e.g. a Bool will be “true” or “false”, while Integer/Float will become unquoted numbers. The arrayName will become the name of the array in the JSONBuilder.This is useful if you want this query to populate an array in a JSONBuilder already containing other stuff.
findAlternativeFields(String)
Finds all alternative fields given a start field. These fields can be used in <code>addField()</code> or similar functions.findRelations(String,Bool)
first()
Sets the row pointer to the first item of the result set.getField(Integer)
Returns the value of a field.You can optionally add a function to be applied to the field when using the name as the identifier.
getField(String)
Returns the value of a field.You can optionally add a function to be applied to the field when using the name as the identifier.