Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
138 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| --- | ||
| title: jsonb support | ||
| layout: en | ||
| --- | ||
|
|
||
| # `jsonb` support | ||
|
|
||
| PGroonga also supports `jsonb` type. You can search JSON data by one or more keys and/or one or more values with PGroonga. | ||
|
|
||
| You can also search JSON data by full text search against all text values in JSON. It's an unique feature of PGroonga. Built-in PostgreSQL features and [JsQuery](https://github.com/postgrespro/jsquery) don't support it. | ||
|
|
||
| Think about the following JSON: | ||
|
|
||
| ```json | ||
| { | ||
| "message": "Server is started.", | ||
| "host": "www.example.com", | ||
| "tags": [ | ||
| "web", | ||
| ] | ||
| } | ||
| ``` | ||
|
|
||
| You can find the JSON by full text search with `search`, `example` or `web` because all text values are full text search target. | ||
|
|
||
| ## Operators | ||
|
|
||
| PGroonga provides the following two operators for searching against `jsonb`: | ||
|
|
||
| * [`@>` operator](operators/jsonb-contain.html) | ||
| * [`@@` operator](operators/jsonb-query.html) | ||
|
|
||
| `@>` operator is simpler than `@@` operator but you can't use complex condition such as range search. | ||
|
|
||
| `@@` operator is more complex than `@>` operator but you can use complex condition. You can also use full text search against all text values in JSON. | ||
|
|
||
| ## Comparison with GIN | ||
|
|
||
| PostgreSQL provides built-in fast `jsonb` search feature by GIN. | ||
|
|
||
| Here are differences between PGroonga and GIN: | ||
|
|
||
| * Index creation time: No difference | ||
| * Search time: PGroonga is a bit faster |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| --- | ||
| title: "@> operator" | ||
| layout: en | ||
| --- | ||
|
|
||
| # `@>` operator | ||
|
|
||
| PGroonga supports fast index search by `@>` operator. | ||
|
|
||
| [`@>` is a built-in PostgreSQL operator](http://www.postgresql.org/docs/current/static/functions-json.html#FUNCTIONS-JSONB-OP-TABLE). `@>` returns true when the right hand side `jsonb` is a sub set of left hand side `jsonb`. | ||
|
|
||
| ## See also | ||
|
|
||
| * [`jsonb` support](../jsonb.html) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| --- | ||
| title: "@@ operator for jsonb type" | ||
| layout: en | ||
| --- | ||
|
|
||
| # `@@` operator for `jsonb` type | ||
|
|
||
| `@@` operator is a PGroonga original operator. You can use complex condition that can't be written by `@>` operator such as range search. If you know [JsQuery](https://github.com/postgrespro/jsquery), you can understand like "PGroonga provides `jsonb` related search features that are similar to JsQuery with different syntax". | ||
|
|
||
| ## See also | ||
|
|
||
| * [`jsonb` support](../jsonb.html) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters