.rating-values text-align: center; font-weight: bold;
.card-header display: flex; gap: 8px; margin-bottom: 10px;
router.get('/api/search', async (req, res) => try const results = await searchService.searchByCategory(req.query); res.json(results); catch (error) res.status(500).json( error: error.message );
const offset = (page - 1) * limit; let sql = ` SELECT ci.*, c.name as category_name, c.type as category_type, MATCH(ci.title, ci.description) AGAINST(? IN BOOLEAN MODE) as relevance FROM content_items ci JOIN categories c ON ci.category_id = c.id WHERE 1=1 `; const params = [query + '*']; // For boolean full-text search // Add filters if (categoryId) // Include subcategories sql += ` AND ci.category_id IN ( WITH RECURSIVE category_tree AS ( SELECT id FROM categories WHERE id = ? UNION ALL SELECT c.id FROM categories c INNER JOIN category_tree ct ON c.parent_id = ct.id ) SELECT id FROM category_tree )`; params.push(categoryId); if (mediaType) sql += ` AND ci.media_type = ?`; params.push(mediaType); if (minRating > 0) sql += ` AND ci.rating >= ?`; params.push(minRating); if (maxRating < 10) sql += ` AND ci.rating <= ?`; params.push(maxRating); if (startDate) sql += ` AND ci.release_date >= ?`; params.push(startDate); if (endDate) sql += ` AND ci.release_date <= ?`; params.push(endDate); // Add sorting if (sortBy === 'relevance' && query) sql += ` ORDER BY relevance $sortOrder`; else if (sortBy === 'rating') sql += ` ORDER BY ci.rating $sortOrder`; else if (sortBy === 'date') sql += ` ORDER BY ci.release_date $sortOrder`; else if (sortBy === 'title') sql += ` ORDER BY ci.title $sortOrder`; // Add pagination sql += ` LIMIT ? OFFSET ?`; params.push(limit, offset); // Get total count let countSql = ` SELECT COUNT(*) as total FROM content_items ci JOIN categories c ON ci.category_id = c.id WHERE 1=1 `; // Apply same filters to count query (simplified for brevity) const [results, total] = await Promise.all([ db.query(sql, params), db.query(countSql, countParams) ]); return items: results, pagination: page, limit, total: total[0].total, totalPages: Math.ceil(total[0].total / limit) , filters: categoryId, mediaType, minRating, maxRating ; Searching for- porn collection in-All Categorie...
);
.results-header margin-bottom: 20px; padding-bottom: 10px; border-bottom: 2px solid #eee;
const performSearch = async () => setLoading(true); try const params = new URLSearchParams( query: searchQuery, categoryId: selectedCategory, mediaType: selectedMediaType, minRating: filters.minRating, maxRating: filters.maxRating, startDate: filters.dateRange.start, endDate: filters.dateRange.end, sortBy: filters.sortBy, page: pagination.page, limit: 20 ); OFFSET
const handleRatingChange = (type, value) => setFilters(prev => ( ...prev, minRating: type === 'min' ? value : prev.minRating, maxRating: type === 'max' ? value : prev.maxRating )); ;
.rating color: #ffc107; font-weight: bold;
.content-card background: white; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.1); transition: transform 0.3s, box-shadow 0.3s; total] = await Promise.all([ db.query(sql
.filter-section h3 margin-top: 0; margin-bottom: 15px; font-size: 18px;
// Advanced search with Elasticsearch class ElasticSearchService constructor() const Client = require('@elastic/elasticsearch'); this.client = new Client( node: 'http://localhost:9200' ); async indexContent(content) return await this.client.index( index: 'entertainment_content', id: content.id, body: title: content.title, description: content.description, category: content.category_name, media_type: content.media_type, rating: content.rating, release_date: content.release_date, suggestions: input: content.title.split(' '), weight: content.rating );