Skip to content

Commit

Permalink
Added documentation for the simple_query_string
Browse files Browse the repository at this point in the history
For PR on elasticsearch adapter - feathersjs-ecosystem/feathers-elasticsearch#24

Signed-off-by: Matt <matt@ideajunction.uk>
  • Loading branch information
Matt committed Jun 1, 2017
1 parent 5667f27 commit e608635
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions api/databases/elasticsearch.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,26 @@ query: {
}
```

### $sqs
[simple_query_string](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-simple-query-string-query.html). A query that uses the SimpleQueryParser to parse its context. Optional `$default_operator` which is set to `or` by default but can be set to `and` if required.

```js
query: {
$sqs: {
$fields: [
'title^5',
'description'
],
$query: '+like +javascript',
$default_operator: 'and'
}
}
```
This can also be expressed in an URL as the following:
```http
http://localhost:3030/users?$sqs[$fields][]=title^5&$sqs[$fields][]=description&$sqs[$query]=+like +javascript&$sqs[$default_operator]=and
```

## Parent-child relationship
Elasticsearch supports [parent-child relationship](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-parent-field.html), however it is not exactly the same as in relational databases. feathers-elasticsearch supports all CRUD operations for Elasticsearch types with parent mapping, and does that with the Elasticsearch constrains. Therefore:

Expand Down

0 comments on commit e608635

Please sign in to comment.