Scalar Search

This chapter introduces how to query data with scalar filtering.

curl -u shiva:shiva -XGET 'localhost:8902/hippo/v1/{table}/_query?pretty' -H 'Content-Type: application/json' -d'{  
  "output_fields": ["book_id", "book_intro"],  
  "expr" : "word_count >= 11000",  
  "limit" : 2,  
  "only_explain" : false  
}';  

Result:

{
  "fields_data" : [
    {
      "field_name" : "book_id",
      "field_values" : [11,12]
    },
    {
      "field_name" : "book_intro",
      "field_values" : [[11.0,1.0],[12.0,1.0]]
    }
  ]
}

Parameter description:

ParametersDescriptionRequired
tableTable name, such as "book" created in this exampleYes
limitThe number of results to returnYes
database_nameDatabase where the table is locatedNo, defaults to "default" database
output_fieldsName of the field to returnNo
exprFilter conditionNo
only_explainWhether to execute "explain" onlyNo, defaults to false
Table 37 Scalar Search (Python API)