Skip to content

Commit

Permalink
add documentation for scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
Leo committed Nov 9, 2018
1 parent 556fb02 commit c7c1aa2
Showing 1 changed file with 48 additions and 3 deletions.
51 changes: 48 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ The package is developed and tested under Elasticsearch ``v6.*``. It should be a
* [withOut](#without)
* [Execute Query](#execute-query)
* [get](#get)
* [scroll](#scroll)
* [count](#count)
* [first](#first)
* [find](#find)
Expand Down Expand Up @@ -287,24 +288,51 @@ The package is developed and tested under Elasticsearch ``v6.*``. It should be a
|:--------:|:--------:|:-----------------------:|:---------:|:-----------------------------------------------------:|
| column | Y | ``string`` | | |
| value | | ``mixed`` | ``null`` | |
| boost | | ``array`` | [] | ``match``query options. Check elasticsearch Docs for references |
| options | | ``array`` | [] | ``match``query options. Check elasticsearch Docs for references |
* Output
``self``
* Examples
1. without option
1. without ``options``
```php
User::es()->whereMatch('email', 'shisun@')->first()
```
2. ``column`` can be a function
2. with ``options``
```php
User::es()->whereMatch('email', 'shisun@', [
'query' => 'this will be overrided by $value',
'operator' => 'and',
'zero_terms_query' => 'all'
])->first()
```
#### orWhereMatch
* Parameters
| Name | Required | Type | Default | Description |
|:--------:|:--------:|:-----------------------:|:---------:|:-----------------------------------------------------:|
| column | Y | ``string`` | | |
| value | | ``mixed`` | ``null`` | |
| options | | ``array`` | [] | ``match``query options. Check elasticsearch Docs for references |
* Output
``self``
* Examples
1. without ``options``
```php
User::es()->orWhereMatch('email', 'shisun@')->first()
```
2. with ``options``
```php
User::es()->orWhereMatch('email', 'shisun@', [
'query' => 'this will be overrided by $value',
'operator' => 'and',
'zero_terms_query' => 'all'
])->first()
```
#### whereHas
* Parameters
Expand Down Expand Up @@ -897,6 +925,23 @@ The package is developed and tested under Elasticsearch ``v6.*``. It should be a
### Execute Query
#### get
#### scroll
* Parameters
| Name | Required | Type | Default | Description |
|:--------:|:--------:|:-----------------------:|:---------:|:-----------------------------------------------------:|
|scroll_alive| | ``string`` |``5m`` | This specifies the life span of the scroll session. |
|scroll_size| | ``integer`` |``500`` | This specifies the number of records retrieved from Elasticsearch per batch.|
* Output
``array``
* Examples
1. basic example
```php
User::es()->scroll()
```
#### count
* Output
Expand Down

0 comments on commit c7c1aa2

Please sign in to comment.