Skip to content

Commit

Permalink
Single table
Browse files Browse the repository at this point in the history
  • Loading branch information
nataliaElv committed Aug 29, 2024
1 parent 0a488ef commit 1f62e0a
Showing 1 changed file with 9 additions and 21 deletions.
30 changes: 9 additions & 21 deletions argilla/docs/how_to_guides/query.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,27 +67,15 @@ To search for records with terms, you can use the `Dataset.records` attribute wi

If you need more complex searches, you can use [Elasticsearch's simple query string syntax](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-simple-query-string-query.html#simple-query-string-syntax). Here is a summary of the different available operators:

=== "Descriptions"
| operator | description |
| ------------ | --------------------------------------------------------- |
|`+` or `space`| **AND**: matches records that contain both terms |
|`|` | **OR**: matches records that contain either term |
|`-` | **Negation**: exclude records that contain a specific term|
|`*` | **Prefix**:matches records that contain a specific prefix |
|`"` | **Phrase**: matches records that contain a specific phrase|
|`(` and `)` | **Precedence**: group terms |
|`~N` | **Edit distance**: matches records that contain a term or phrase with an edit distance|

=== "Examples"
| operator | example | explanation |
| ------------ | ----------------------------- | ----------------------------------------------- |
|`+` or `space`| `argilla + distilabel` or `argilla distilabel`| returns records that include the terms "argilla" and "distilabel"|
|`|` | `argilla | distilabel` | returns records that include the term "argilla" or "distilabel"|
|`-` | `argilla -distilabel` | returns records that contain the term "argilla" and don't have the term "distilabel"|
|`*` | `arg*` | returns records with any words starting with "arg-"|
|`"` | `"argilla and distilabel"` | returns records that contain the phrase "argilla and distilabel"|
|`(` and `)` | `(argilla | distilabel) rules`| returns records that contain either "argilla" or "distilabel" and "rules"|
|`~N` | `argilla~1` | returns records that contain the term "argilla" with an edit distance of 1, e.g. "argila"|
| operator | description | example |
| ------------ | --------------------------- | --------------------------------------------------------------------- |
|`+` or `space`| **AND**: search both terms | `argilla + distilabel` or `argilla distilabel`</br> return records that include the terms "argilla" and "distilabel"|
|`|` | **OR**: search either term | `argilla | distilabel` </br> returns records that include the term "argilla" or "distilabel"|
|`-` | **Negation**: exclude a term| `argilla -distilabel` </br> returns records that contain the term "argilla" and don't have the term "distilabel"|
|`*` | **Prefix**: search a prefix | `arg*`</br> returns records with any words starting with "arg-"|
|`"` | **Phrase**: search a phrase | `"argilla and distilabel"` </br> returns records that contain the phrase "argilla and distilabel"|
|`(` and `)` | **Precedence**: group terms | `(argilla | distilabel) rules` </br> returns records that contain either "argilla" or "distilabel" and "rules"|
|`~N` | **Edit distance**: search a term or phrase with an edit distance| `argilla~1` </br> returns records that contain the term "argilla" with an edit distance of 1, e.g. "argila"|

!!! tip
To use one of these characters literally, escape it with a preceding backslash `\`, e.g. `"1 \+ 2"` would match records where the phrase "1 + 2" is found.
Expand Down

0 comments on commit 1f62e0a

Please sign in to comment.