@@ -43,20 +43,20 @@ Index and type names setted in query will override values the configuration file
43
43
#### Available methods:
44
44
45
45
46
- // sorting
46
+ ##### Sorting
47
47
48
48
$documents = ES::orderBy("created_at", "desc")->get();
49
49
$documents = ES::orderBy("_score")->get();
50
50
51
- // limit and offset
51
+ ##### Limit and offset
52
52
53
53
$documents = ES::take(10)->skip(5)->get();
54
54
55
- // select only specific fields
55
+ ##### Select only specific fields
56
56
57
57
$documents = ES::select("title", "content")->take(10)->skip(5)->get();
58
58
59
- // where clause
59
+ ##### Where clause
60
60
61
61
ES::where("id", 150)->get(); or ES::where("id", "=", 150)->get();
62
62
ES::where("id", ">", 150)->get();
@@ -66,17 +66,17 @@ Index and type names setted in query will override values the configuration file
66
66
ES::where("title", "like", "foo")->get();
67
67
ES::where("hobbies", "exists", true)->get(); or ES::whereExists("hobbies", true)->get();
68
68
69
- // where in clause
69
+ ##### Where in clause
70
70
71
71
ES::whereIn("id", [100, 150])->get();
72
72
73
- // where between clause
73
+ ##### Where between clause
74
74
75
75
ES::whereBetween("id", 100, 150)->get();
76
76
77
77
>
78
78
79
- // where not clause
79
+ ##### Where not clause
80
80
81
81
ES::whereNot("id", 150)->get(); or ES::where("id", "=", 150)->get();
82
82
ES::whereNot("id", ">", 150)->get();
@@ -86,37 +86,37 @@ Index and type names setted in query will override values the configuration file
86
86
ES::whereNot("title", "like", "foo")->get();
87
87
ES::whereNot("hobbies", "exists", true)->get(); or ES::whereExists("hobbies", true)->get();
88
88
89
- // where not in clause
89
+ ##### Where not in clause
90
90
91
91
ES::whereNotIn("id", [100, 150])->get();
92
92
93
- // where not between clause
93
+ ##### Where not between clause
94
94
95
95
ES::whereNotBetween("id", 100, 150)->get();
96
96
97
97
98
98
>
99
99
100
- // Search the entire document
100
+ ##### Search the entire document
101
101
102
102
ES::search("bar")->get();
103
103
104
104
105
105
>
106
106
107
- // Return only first record
107
+ ##### Return only first record
108
108
109
109
ES::search("bar")->first();
110
110
111
111
>
112
112
113
- // Return only count
113
+ ##### Return only count
114
114
115
115
ES::search("bar")->count();
116
116
117
117
>
118
118
119
- // paginate results with per_page = 5
119
+ ##### Paginate results with per_page = 5
120
120
121
121
$documents = ES::search("bar")->paginate(5);
122
122
@@ -127,7 +127,7 @@ Index and type names setted in query will override values the configuration file
127
127
128
128
>
129
129
130
- // Executing elasticsearch raw queries
130
+ ##### Executing elasticsearch raw queries
131
131
132
132
ES::raw()->search([
133
133
"index" => "my_index",
@@ -147,7 +147,7 @@ Index and type names setted in query will override values the configuration file
147
147
148
148
>
149
149
150
- // insert a new document
150
+ ##### Insert a new document
151
151
152
152
ES::insert([
153
153
"title" => "Test document",
@@ -162,7 +162,7 @@ Index and type names setted in query will override values the configuration file
162
162
163
163
>
164
164
165
- // Bulk insert a multiple of documents at once using multidimensional array of [id => data] pairs
165
+ ##### Bulk insert a multiple of documents at once using multidimensional array of [ id => data] pairs
166
166
167
167
ES::bulk(
168
168
10 => [
@@ -179,7 +179,7 @@ Index and type names setted in query will override values the configuration file
179
179
180
180
>
181
181
182
- // Update an existing document
182
+ ##### Update an existing document
183
183
184
184
ES::update([
185
185
"title" => "Test document",
@@ -193,7 +193,7 @@ Index and type names setted in query will override values the configuration file
193
193
194
194
>
195
195
196
- // delete a document
196
+ ##### Delete a document
197
197
198
198
ES::delete(3);
199
199
0 commit comments