Overview
LVS's V4 Search API endpoints enable your application to find Video Clip Metadata using a variety of search criteria.
The V4 Search API offers enhanced search capabilities with more robust context search, searching for similar/related content, and features like auto-completion and sorting (e.g. chronologically, alphabetically), which are not available in V3 Search.
Endpoints Covered
- /search
- /search/similar-content
- /search/facets
- /search/autocomplete
- /data
/search
Description: Perform a comprehensive search on the content database.
- HTTP Method: POST
- Parameters:
- query (string): The search query.
- filters (object): Filters to apply to the search results.
- sort (object): Sorting criteria.
- pagination (object): Pagination options (page number, page size).
- Example: Request:
{ "query": "example search query", "filters": { "category": "sports" }, "sort": { "field":"date", "order": "desc" }, "pagination": { "page": 1, "pageSize": 10 } }
Response:
{ "results": [ { "id": "content1", "title": "Example Title", "description": "Example Description", "metadata": { "category": "sports", "date": "2023-01-01" } } ], "pagination": {"page": 1, "pageSize": 10, "totalResults": 100 } }
Usage: This endpoint is used for general search queries, allowing for comprehensive filtering, sorting, and pagination of search results.
/search/similar-content
Description: Retrieve content similar to the specified content.
- HTTP Method: POST
- Parameters:
- contentId (string): The ID of the content to find similar items for.
- filters (object): Filters to apply to the search results.
- sort (object): Sorting criteria.
- pagination (object): Pagination options (page number, page size).
- Example: Request:
{ "contentId": "exampleContentId", "filters": { "category": "sports" }, "sort": { "field":"date", "order": "desc" }, "pagination": { "page": 1, "pageSize": 10 } }
Response:
{ "results": [ { "id": "similarContent1", "title": "Similar Content Title", "description":"Similar Content Description", "metadata": { "category": "sports", "date": "2023-01-02" } }], "pagination": { "page": 1, "pageSize": 10, "totalResults": 50 } }
Usage: This endpoint is useful for finding content that is contextually similar to a given piece of content, enhancing content discovery and engagement.
/search/facets
Description: Retrieve facets for refining search results.
- HTTP Method: POST
- Parameters:
- query (string): The search query.
- filters (object): Filters to apply to the search results.
- facetFields (array of strings): Fields for which facets are to be retrieved.
- Example: Request:
{ "query": "example search query", "filters": { "category": "sports" }, "facetFields":["date", "category"] }
Response:
{ "facets": { "date": { "buckets": [ { "key": "2023", "doc_count": 20 }, { "key": "2022","doc_count": 15 } ] }, "category": { "buckets": [ { "key": "sports", "doc_count": 30 }, {"key": "news", "doc_count": 10 } ] } } }
Usage: Facets allow users to refine their search results by providing aggregated data on specified fields, improving the search experience.
/search/autocomplete
Description: Provide autocomplete suggestions for search queries.
- HTTP Method: POST
- Parameters:
- query (string): The partial search query.
- filters (object): Filters to apply to the search results.
- Example: Request:
{ "query": "example", "filters": { "category": "sports" } }
Response:
{ "suggestions": [ "example search query 1", "example search query 2" ] }
Usage: Autocomplete enhances the user experience by providing real-time search suggestions based on partial input, speeding up the search process.
/data
Description: Manage and manipulate data within the content database.
- HTTP Method: POST
- Parameters:
- operation (string): The type of operation (e.g., create, update, delete).
- data (object): The data to be managed or manipulated.
- Example: Request:
{ "operation": "create", "data": { "id": "newContent", "title": "New Content Title","description": "New Content Description", "metadata": { "category": "sports", "date": "2023-01-01" } } }
Response:
{ "status": "success", "message": "Content created successfully.", "data": { "id":"newContent", "title": "New Content Title", "description": "New Content Description","metadata": { "category": "sports", "date": "2023-01-01" } } }
Usage: This endpoint is used for managing content data, including creating, updating, and deleting content records within the database.
Conclusion
The V4 Search API brings advanced search capabilities to the Linius platform, offering robust context search, similar content discovery, and auto-completion features. By utilizing these endpoints, developers can create powerful search functionalities that improve user engagement and content discovery.
Comments
0 comments
Please sign in to leave a comment.