> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.etera.dev/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.etera.dev/_mcp/server.

# Hybrid Search

POST https://api.etera.dev/hotel/search/v2/search/hybrid
Content-Type: application/json

Search using **hybrid mode** - combines BM25 text matching with vector semantic similarity.

**Best For:**

* General search queries
* When you want both exact matches and semantic understanding
* Queries like "family friendly beach hotel" or "romantic getaway dubai"

**How it Works:**

1. Text search finds keyword matches (BM25)
2. Vector search finds semantically similar results
3. Results are merged using Reciprocal Rank Fusion (RRF)

### Request Body Example

```json
{
  "q": "family friendly beach hotel",
  "city": "Dubai",
  "familyFriendly": true,
  "limit": 20
}
```

Reference: https://docs.etera.dev/hotels/search/hotel-search-api/v-2-search/post-v-2-search-hybrid

## Servers

- `https://api.etera.dev/hotel/search` (Production, default)
- `https://api-stage.etera.dev/hotel/search` (Staging)
- `https://api-dev.etera.dev/hotel/search` (Development)

## Request

### Body (application/json)

This endpoint expects an object.

- `q` (string, optional) — Search query text (e.g., 'luxury hotels dubai', 'beachfront resort')
- `query` (string, optional) — Alias for 'q' parameter
- `strategy` (V2SearchHybridPostRequestBodyContentApplicationJsonSchemaStrategy, optional) — Search strategy: 'text' (BM25), 'hybrid' (text+vector), 'vector' (semantic). Omit to use route default.
- `requestId` (string, optional) — Request ID from previous search. Use with page > 1 to fetch cached results.
- `page` (double, optional, default: 1) — Page number. Use with requestId for subsequent pages.
- `fetchSize` (double, optional, default: 100) — Number of hotels to fetch and cache (50-300). Higher = more pages cached.
- `limit` (double, optional, default: 20) — Results per page (default: 20, ignored when using requestId)
- `size` (double, optional) — Alias for 'limit'
- `offset` (double, optional, default: 0) — Deprecated: Use page instead
- `lat` (double, optional) — Latitude for geo-search (requires lng)
- `lng` (double, optional) — Longitude for geo-search (requires lat)
- `radius` (double, optional, default: 50) — Search radius in kilometers (1-500, default: 50)
- `city` (string, optional) — Filter by city name
- `country` (string, optional) — Filter by country code (ISO 3166-1 alpha-2). Must be a country code present in the index (e.g. AE, US, SA).
- `regionId` (double, optional) — Filter by region ID (non-negative integer)
- `stars` (double, optional) — Minimum star rating (1-5)
- `starRating` (V2SearchHybridPostRequestBodyContentApplicationJsonSchemaStarRating, optional) — Star rating filter - single number (1-5) or array of up to 10 values. Matches index values.
- `minStarRating` (double, optional) — Minimum star rating for range filter
- `maxStarRating` (double, optional) — Maximum star rating for range filter
- `kind` (list of string, optional) — Property types. Allowed: APART-HOTEL, APARTMENT, BNB, BOUTIQUE_AND_DESIGN, CAMPING, CASTLE, COTTAGES_AND_HOUSES, FARM, GLAMPING, GUESTHOUSE, HOSTEL, HOTEL, MINI-HOTEL, RESORT, SANATORIUM, VILLAS_AND_BUNGALOWS. Max 20 values.
- `hotelChain` (list of string, optional) — Hotel chain names (e.g., ['Marriott', 'Hilton']). Max 20 values.
- `familyFriendly` (boolean, optional) — Filter for family-friendly hotels (only set to true to filter)
- `petFriendly` (boolean, optional) — Filter for pet-friendly hotels (only set to true to filter)
- `businessFriendly` (boolean, optional) — Filter for business-friendly hotels (only set to true to filter)
- `wellnessSpa` (boolean, optional) — Filter for hotels with spa/wellness facilities (only set to true to filter)
- `beachfront` (boolean, optional) — Filter for beachfront properties (only set to true to filter)
- `freeWifi` (boolean, optional) — Filter for hotels with free WiFi
- `breakfastIncluded` (boolean, optional) — Filter for hotels with breakfast included
- `petsAllowed` (boolean, optional) — Filter for hotels that allow pets
- `parkingAvailable` (boolean, optional) — Filter for hotels with parking available
- `freeParking` (boolean, optional) — Filter for hotels with free parking
- `shuttleAvailable` (boolean, optional) — Filter for hotels with airport shuttle
- `childrenAllowed` (boolean, optional) — Filter for hotels that allow children
- `internetIncluded` (boolean, optional) — Filter for hotels with internet included
- `parkingIncluded` (boolean, optional) — Filter for hotels with parking included in rate
- `features` (list of string, optional) — Filter by feature slugs (e.g. free_wifi, pool_outdoor). Values must exist in features.json. Max 50.
- `poiTypesNearby` (list of string, optional) — Filter by nearby POI types (e.g., ['restaurant', 'beach']). Max 30 values.
- `poiNamesNearby` (list of string, optional) — Filter by specific nearby POI names (e.g., ['Burj Khalifa', 'Dubai Mall']). Max 30 values.
- `excludeClosed` (boolean, optional, default: true) — Exclude closed hotels (default: true)
- `providerHid` (double, optional) — Filter by provider HID (non-negative integer)
- `providerId` (string, optional) — Filter by provider ID (string)
- `sortBy` (V2SearchHybridPostRequestBodyContentApplicationJsonSchemaSortBy, optional) — Sort field: relevance, star_rating, name, distance, updated_at
- `sortOrder` (V2SearchHybridPostRequestBodyContentApplicationJsonSchemaSortOrder, optional) — Sort order: asc or desc
- `includeAggregations` (boolean, optional, default: false) — Include aggregations/facets in response
- `boostByQuality` (boolean, optional, default: false) — Enable quality-based re-ranking. Boosts results by rating_global and star_rating. Useful for ranking by hotel quality while maintaining relevance.
- `qualityRatingWeight` (double, optional, default: 0.7) — Weight for guest rating (rating_global) in quality scoring (0-1). Default: 0.7. Higher values prioritize guest ratings over star ratings.
- `qualityStarsWeight` (double, optional, default: 0.3) — Weight for star rating in quality scoring (0-1). Default: 0.3. Higher values prioritize hotel stars over guest ratings.
- `checkIn` (string, optional) — Check-in date (YYYY-MM-DD). Required for real-time pricing.
- `checkOut` (string, optional) — Check-out date (YYYY-MM-DD). Required for real-time pricing.
- `adults` (double, optional, default: 2) — Number of adults (1-10)
- `children` (double, optional, default: 0) — Number of children (0-4)
- `childAges` (list of double, optional) — Ages of children (0-17 each). Array length should match 'children' count.
- `rooms` (double, optional, default: 1) — Number of rooms (1-5)
- `currency` (string, optional, default: AED) — Currency code for prices (ISO 4217, 3 letters)

## Response

### 200

Search response with hotels and pagination support

- `success` (boolean, required) — Whether the search was successful
- `data` (list of any, required) — Array of hotel results (20 per page)
- `metadata` (V2SearchHybridPostResponsesContentApplicationJsonSchemaMetadata, required)
- `error` (string, optional) — Error message if search failed
- `requestId` (string, optional) — Request ID for pagination. Use with page parameter for next pages.
- `searchMetadata` (V2SearchHybridPostResponsesContentApplicationJsonSchemaSearchMetadata, optional)

## Types

### V2SearchHybridPostRequestBodyContentApplicationJsonSchemaStrategy

Search strategy: 'text' (BM25), 'hybrid' (text+vector), 'vector' (semantic). Omit to use route default.

- "hybrid"
- "text"
- "vector"

### V2SearchHybridPostRequestBodyContentApplicationJsonSchemaStarRating

Star rating filter - single number (1-5) or array of up to 10 values. Matches index values.

- double
- list of double

### V2SearchHybridPostRequestBodyContentApplicationJsonSchemaSortBy

Sort field: relevance, star_rating, name, distance, updated_at

- "relevance"
- "star_rating"
- "name"
- "distance"
- "updated_at"

### V2SearchHybridPostRequestBodyContentApplicationJsonSchemaSortOrder

Sort order: asc or desc

- "asc"
- "desc"

### V2SearchHybridPostResponsesContentApplicationJsonSchemaMetadata

- `total` (double, required) — Total number of matching hotels
- `page` (double, required) — Current page number
- `limit` (double, required) — Results per page (20)
- `totalPages` (double, required) — Total number of pages available
- `filters` (any, required) — Applied filters
- `executionTime` (double, required) — Search execution time in ms
- `strategy` (string, required) — Search strategy used
- `hasMore` (boolean, optional) — Whether more results are available
- `cached` (boolean, optional) — Whether results came from cache

### V2SearchHybridPostResponsesContentApplicationJsonSchemaSearchMetadata

- `query` (string, optional)
- `mode` (string, optional)
- `opensearchTook` (double, optional)
- `fetchedCount` (double, optional) — Total hotels fetched and cached

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "success": true,
  "data": [
    null
  ],
  "metadata": {
    "total": 125,
    "page": 1,
    "limit": 20,
    "totalPages": 7,
    "filters": null,
    "executionTime": 85,
    "strategy": "hybrid",
    "hasMore": true,
    "cached": false
  },
  "error": "",
  "requestId": "req_9f8b7c6d5e4a3b2c1d0e",
  "searchMetadata": {
    "query": "family friendly beach hotel",
    "mode": "hybrid",
    "opensearchTook": 75,
    "fetchedCount": 125
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.etera.dev/hotel/search/v2/search/hybrid"

payload = {}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.etera.dev/hotel/search/v2/search/hybrid';
const options = {method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{}'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.etera.dev/hotel/search/v2/search/hybrid"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.etera.dev/hotel/search/v2/search/hybrid")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.etera.dev/hotel/search/v2/search/hybrid")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.etera.dev/hotel/search/v2/search/hybrid', [
  'body' => '{}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.etera.dev/hotel/search/v2/search/hybrid");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.etera.dev/hotel/search/v2/search/hybrid")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```