Buscar em múltiplas coleções
curl --request POST \
--url https://services.pref.rio/go/api/v1/typesense/multi-search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"collections": [
"<string>"
],
"params": {
"exclude_fields": "<string>",
"facet_by": "<string>",
"facet_query": "<string>",
"filter_by": "<string>",
"highlight_fields": "<string>",
"highlight_full_fields": "<string>",
"include_fields": "<string>",
"max_facet_values": 123,
"num_typos": 123,
"page": 123,
"per_page": 123,
"prefix": true,
"q": "<string>",
"query_by": "<string>",
"sort_by": "<string>"
}
}
'import requests
url = "https://services.pref.rio/go/api/v1/typesense/multi-search"
payload = {
"collections": ["<string>"],
"params": {
"exclude_fields": "<string>",
"facet_by": "<string>",
"facet_query": "<string>",
"filter_by": "<string>",
"highlight_fields": "<string>",
"highlight_full_fields": "<string>",
"include_fields": "<string>",
"max_facet_values": 123,
"num_typos": 123,
"page": 123,
"per_page": 123,
"prefix": True,
"q": "<string>",
"query_by": "<string>",
"sort_by": "<string>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
collections: ['<string>'],
params: {
exclude_fields: '<string>',
facet_by: '<string>',
facet_query: '<string>',
filter_by: '<string>',
highlight_fields: '<string>',
highlight_full_fields: '<string>',
include_fields: '<string>',
max_facet_values: 123,
num_typos: 123,
page: 123,
per_page: 123,
prefix: true,
q: '<string>',
query_by: '<string>',
sort_by: '<string>'
}
})
};
fetch('https://services.pref.rio/go/api/v1/typesense/multi-search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://services.pref.rio/go/api/v1/typesense/multi-search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'collections' => [
'<string>'
],
'params' => [
'exclude_fields' => '<string>',
'facet_by' => '<string>',
'facet_query' => '<string>',
'filter_by' => '<string>',
'highlight_fields' => '<string>',
'highlight_full_fields' => '<string>',
'include_fields' => '<string>',
'max_facet_values' => 123,
'num_typos' => 123,
'page' => 123,
'per_page' => 123,
'prefix' => true,
'q' => '<string>',
'query_by' => '<string>',
'sort_by' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://services.pref.rio/go/api/v1/typesense/multi-search"
payload := strings.NewReader("{\n \"collections\": [\n \"<string>\"\n ],\n \"params\": {\n \"exclude_fields\": \"<string>\",\n \"facet_by\": \"<string>\",\n \"facet_query\": \"<string>\",\n \"filter_by\": \"<string>\",\n \"highlight_fields\": \"<string>\",\n \"highlight_full_fields\": \"<string>\",\n \"include_fields\": \"<string>\",\n \"max_facet_values\": 123,\n \"num_typos\": 123,\n \"page\": 123,\n \"per_page\": 123,\n \"prefix\": true,\n \"q\": \"<string>\",\n \"query_by\": \"<string>\",\n \"sort_by\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://services.pref.rio/go/api/v1/typesense/multi-search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"collections\": [\n \"<string>\"\n ],\n \"params\": {\n \"exclude_fields\": \"<string>\",\n \"facet_by\": \"<string>\",\n \"facet_query\": \"<string>\",\n \"filter_by\": \"<string>\",\n \"highlight_fields\": \"<string>\",\n \"highlight_full_fields\": \"<string>\",\n \"include_fields\": \"<string>\",\n \"max_facet_values\": 123,\n \"num_typos\": 123,\n \"page\": 123,\n \"per_page\": 123,\n \"prefix\": true,\n \"q\": \"<string>\",\n \"query_by\": \"<string>\",\n \"sort_by\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://services.pref.rio/go/api/v1/typesense/multi-search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"collections\": [\n \"<string>\"\n ],\n \"params\": {\n \"exclude_fields\": \"<string>\",\n \"facet_by\": \"<string>\",\n \"facet_query\": \"<string>\",\n \"filter_by\": \"<string>\",\n \"highlight_fields\": \"<string>\",\n \"highlight_full_fields\": \"<string>\",\n \"include_fields\": \"<string>\",\n \"max_facet_values\": 123,\n \"num_typos\": 123,\n \"page\": 123,\n \"per_page\": 123,\n \"prefix\": true,\n \"q\": \"<string>\",\n \"query_by\": \"<string>\",\n \"sort_by\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"results": {},
"total_found": 123
}{
"code": 123,
"message": "<string>"
}{
"code": 123,
"message": "<string>"
}search
Buscar em múltiplas coleções
Realiza busca em várias coleções simultaneamente
POST
/
api
/
v1
/
typesense
/
multi-search
Buscar em múltiplas coleções
curl --request POST \
--url https://services.pref.rio/go/api/v1/typesense/multi-search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"collections": [
"<string>"
],
"params": {
"exclude_fields": "<string>",
"facet_by": "<string>",
"facet_query": "<string>",
"filter_by": "<string>",
"highlight_fields": "<string>",
"highlight_full_fields": "<string>",
"include_fields": "<string>",
"max_facet_values": 123,
"num_typos": 123,
"page": 123,
"per_page": 123,
"prefix": true,
"q": "<string>",
"query_by": "<string>",
"sort_by": "<string>"
}
}
'import requests
url = "https://services.pref.rio/go/api/v1/typesense/multi-search"
payload = {
"collections": ["<string>"],
"params": {
"exclude_fields": "<string>",
"facet_by": "<string>",
"facet_query": "<string>",
"filter_by": "<string>",
"highlight_fields": "<string>",
"highlight_full_fields": "<string>",
"include_fields": "<string>",
"max_facet_values": 123,
"num_typos": 123,
"page": 123,
"per_page": 123,
"prefix": True,
"q": "<string>",
"query_by": "<string>",
"sort_by": "<string>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
collections: ['<string>'],
params: {
exclude_fields: '<string>',
facet_by: '<string>',
facet_query: '<string>',
filter_by: '<string>',
highlight_fields: '<string>',
highlight_full_fields: '<string>',
include_fields: '<string>',
max_facet_values: 123,
num_typos: 123,
page: 123,
per_page: 123,
prefix: true,
q: '<string>',
query_by: '<string>',
sort_by: '<string>'
}
})
};
fetch('https://services.pref.rio/go/api/v1/typesense/multi-search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://services.pref.rio/go/api/v1/typesense/multi-search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'collections' => [
'<string>'
],
'params' => [
'exclude_fields' => '<string>',
'facet_by' => '<string>',
'facet_query' => '<string>',
'filter_by' => '<string>',
'highlight_fields' => '<string>',
'highlight_full_fields' => '<string>',
'include_fields' => '<string>',
'max_facet_values' => 123,
'num_typos' => 123,
'page' => 123,
'per_page' => 123,
'prefix' => true,
'q' => '<string>',
'query_by' => '<string>',
'sort_by' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://services.pref.rio/go/api/v1/typesense/multi-search"
payload := strings.NewReader("{\n \"collections\": [\n \"<string>\"\n ],\n \"params\": {\n \"exclude_fields\": \"<string>\",\n \"facet_by\": \"<string>\",\n \"facet_query\": \"<string>\",\n \"filter_by\": \"<string>\",\n \"highlight_fields\": \"<string>\",\n \"highlight_full_fields\": \"<string>\",\n \"include_fields\": \"<string>\",\n \"max_facet_values\": 123,\n \"num_typos\": 123,\n \"page\": 123,\n \"per_page\": 123,\n \"prefix\": true,\n \"q\": \"<string>\",\n \"query_by\": \"<string>\",\n \"sort_by\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://services.pref.rio/go/api/v1/typesense/multi-search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"collections\": [\n \"<string>\"\n ],\n \"params\": {\n \"exclude_fields\": \"<string>\",\n \"facet_by\": \"<string>\",\n \"facet_query\": \"<string>\",\n \"filter_by\": \"<string>\",\n \"highlight_fields\": \"<string>\",\n \"highlight_full_fields\": \"<string>\",\n \"include_fields\": \"<string>\",\n \"max_facet_values\": 123,\n \"num_typos\": 123,\n \"page\": 123,\n \"per_page\": 123,\n \"prefix\": true,\n \"q\": \"<string>\",\n \"query_by\": \"<string>\",\n \"sort_by\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://services.pref.rio/go/api/v1/typesense/multi-search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"collections\": [\n \"<string>\"\n ],\n \"params\": {\n \"exclude_fields\": \"<string>\",\n \"facet_by\": \"<string>\",\n \"facet_query\": \"<string>\",\n \"filter_by\": \"<string>\",\n \"highlight_fields\": \"<string>\",\n \"highlight_full_fields\": \"<string>\",\n \"include_fields\": \"<string>\",\n \"max_facet_values\": 123,\n \"num_typos\": 123,\n \"page\": 123,\n \"per_page\": 123,\n \"prefix\": true,\n \"q\": \"<string>\",\n \"query_by\": \"<string>\",\n \"sort_by\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"results": {},
"total_found": 123
}{
"code": 123,
"message": "<string>"
}{
"code": 123,
"message": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Parâmetros de busca
⌘I
