Back to main page

Get

Concept:

Get expression defines what items are returned as query results. By default, the hits are from the table defined in 'from' clause. In some cases, you may want to declare propositions like 'query is laptop' in impression table, while returning results from the separate products table, based on click likelihood. In this case, you may have query like

{
  "from": "impressions",
  "where":{"query":"laptop"},
  "get":"product",
  "orderBy": {"$p":{"$context":{"click:true}}}
}

The get expression takes a field name as a parameter. If the field is link, the returned results are from the linked table. If the field is not link, the field values are returned as results.

Normally, the result of a query consists of the field values that best fulfill the query conditions. Field analyzers extract features from text fields and the $feature property can be used to return features instead of complete field values. For instance, the following example demonstrates how to discover product tags which are likely to lead to sales:

{
  "from": "impressions",
  "where":{"query":"cheap phone"},
  "get":"product.tags.$feature",
  "orderBy": {"$p":{"$context":{"click:true}}}
}

The $feature syntax also allows you to examine the values/features of a link field like it would be a regular field.

Format:

    string

Example 1:

    "product"

Example 2:

    "user"

Example 3:

    "query"

Example 4:

    "text.$feature"

Example 5:

    "link.field"

Example 6:

    "link.$feature"

Example 7:

    "link.text.$feature"