Skip to content

Commit 18360a3

Browse files
committed
2 parents a9994e1 + f0d1ebc commit 18360a3

File tree

1 file changed

+21
-9
lines changed

1 file changed

+21
-9
lines changed

README.md

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,24 @@
1414
This package extends Laravel's Eloquent model and query builder with seamless integration of OpenSearch functionalities. Designed to feel native to Laravel, this package enables you to work with Eloquent models while leveraging the
1515
powerful search and analytics capabilities of OpenSearch.
1616

17+
Example:
1718
```php
18-
$logs = UserLog::where('type', UserLogType::LOGIN)->where('created_at','>=',Carbon::now()->subDays(30))->get();
19+
$logs = UserLog::where('created_at','>=',Carbon::now()->subDays(30))->get();
1920
```
20-
21-
### Read the [Documentation](https://opensearch.pdphilip.com/)
22-
21+
```php
22+
$updates = UserLog::where('status', 1)->update(['status' => 4]);
23+
```
24+
```php
25+
$profiles = UserProfile::whereIn('country_code',['US','CA'])->orderByDesc('last_login')->take(10)->get();
26+
```
27+
```php
28+
$deleted = UserProfile::where('state','unsubscribed')->where('updated_at','<=',Carbon::now()->subDays(90)->delete();
29+
```
30+
```php
31+
$search = UserProfile::term('loves espressos')->minShouldMatch(2)->highlight()->search();
32+
```
33+
---
34+
> ### Read the [Documentation](https://opensearch.pdphilip.com/)
2335
---
2436

2537
## Installation
@@ -32,8 +44,8 @@ composer require pdphilip/opensearch
3244

3345
| Laravel Version | Command | Maintained |
3446
|-----------------|-----------------------------------------------|------------|
35-
| Laravel 10 & 11 | `composer require pdphilip/elasticsearch:~2 ` ||
36-
| Laravel 8 & 9 | `composer require pdphilip/elasticsearch:~1` ||
47+
| Laravel 10 & 11 | `composer require pdphilip/opensearch:~2 ` ||
48+
| Laravel 8 & 9 | `composer require pdphilip/opensearch:~1` ||
3749

3850
## Configuration
3951

@@ -148,14 +160,14 @@ Now, you're all set to use OpenSearch with Laravel as if it were native to the f
148160
- [Aggregations](https://opensearch.pdphilip.com/aggregation)
149161
- [Chunking](https://opensearch.pdphilip.com/chunking)
150162
- [Nested Queries](https://opensearch.pdphilip.com/nested-queries)
151-
- [Elasticsearch Specific Queries](https://opensearch.pdphilip.com/es-specific)
163+
- [OpenSearch Specific Queries](https://opensearch.pdphilip.com/os-specific)
152164
- [Full-Text Search](https://opensearch.pdphilip.com/full-text-search)
153165
- [Dynamic Indices](https://opensearch.pdphilip.com/dynamic-indices)
154166

155167
## Relationships
156168

157-
- [Elasticsearch to Elasticsearch](https://opensearch.pdphilip.com/es-es)
158-
- [Elasticsearch to MySQL](https://opensearch.pdphilip.com/es-mysql)
169+
- [OpenSearch to OpenSearch](https://opensearch.pdphilip.com/os-os)
170+
- [OpenSearch to MySQL](https://opensearch.pdphilip.com/os-mysql)
159171

160172
## Schema/Index
161173

0 commit comments

Comments
 (0)