Skip to content

Commit cfdd503

Browse files
committed
update
1 parent 34c4f9f commit cfdd503

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,6 +1139,28 @@ If you want to allow no more than 10 pages with a maximum of 25 records each, yo
11391139

11401140
NB: The maximum number of records is also applied when there is no page number specified in the request.
11411141

1142+
### Search all text fields
1143+
1144+
You may use the "textSearch" middleware to simplify (wildcard) text searches when listing records.
1145+
It allows you to specify a "search" parameter using:
1146+
1147+
GET /records/posts?search=Hello
1148+
1149+
It will return all records from "posts" that contain "Hello" in one of their text (typed) fields:
1150+
1151+
{
1152+
"records":[
1153+
{
1154+
"id": 1,
1155+
"title": "Hello world!",
1156+
"content": "Welcome to the first post.",
1157+
"created": "2018-03-05T20:12:56Z"
1158+
}
1159+
]
1160+
}
1161+
1162+
The example searches the fields "title" or "content" for the substring "Hello".
1163+
11421164
### Customization handlers
11431165

11441166
You may use the "customization" middleware to modify request and response and implement any other functionality.

0 commit comments

Comments
 (0)