यदि आपने कभी एक वाक्यांश के सभी विभिन्नता को पकड़ने के लिए कई क्वेरी लिखनी पड़ी है, तो आप जानते हैं कि यह कितना दोहराव और गंदा हो सकता है। नए वाक्यांशों के अंदर OR समर्थन के साथ, आप “खुश ग्राहक” और “उदास ग्राहक”—साथ ही किसी भी अन्य भिन्नता—को एक ही, साफ क्वेरी में मिलाकर कर सकते हैं।
Manticore Search 13.6.7 में नया क्या है
हमें यह घोषणा करते हुए खुशी हो रही है कि
Manticore Search 13.6.7
को इस उपयोगी सुविधा के लिए बेहतर समर्थन के साथ जारी किया गया है। वाक्यांश ऑपरेटरों (उद्धरण) के अंदर OR ऑपरेटर (|
) लचीले वाक्यांश मिलान की पेशकश करता है जो आपके खोज कार्यक्षमता को बनाने में सुधार कर सकता है।
वाक्यांशों में OR का जादू
पारंपरिक खोज इंजन आपको सटीक वाक्यांश मिलान और लूज कीवर्ड मिलान के बीच चुनने के लिए मजबूर करते हैं। लेकिन क्या होगा अगर आपको बीच में कुछ चाहिए? यहीं वाक्यांशों के अंदर OR ऑपरेटर चमकते हैं। प्रत्येक विकल्प को वाक्यांश के भीतर एक ही स्थिति पर जांचा जाता है, और यदि किसी भी विकल्प ने उस स्थिति को फिट किया, तो वाक्यांश मेल खाता है।
ऐसी सिंटैक्स जो समझ में आए
"( a | b ) c" -- Either "a c" or "b c"
"( ( a b c ) | d ) e" -- Either "a b c e" or "d e"
"man ( happy | sad ) but all ( ( as good ) | ( as fast ) )" -- Complex nested possibilities
चलो इसे क्रियान्वित करते हैं
आइए ग्राहक फीडबैक डेटा का उपयोग करके एक वास्तविक जीवन उदाहरण बनाते हैं। पहले, हम अपने परीक्षण वातावरण को सेट करते हैं:
-- Clean slate for easy reproduction
DROP TABLE IF EXISTS phrase_or_demo;
CREATE TABLE phrase_or_demo (title TEXT, content TEXT, category TEXT);
INSERT INTO phrase_or_demo (id, title, content, category) VALUES
(1, 'Happy Customer Review', 'I am a very happy customer with excellent service', 'reviews'),
(2, 'Sad Customer Feedback', 'I am a very sad customer with poor experience', 'reviews'),
(3, 'Customer Service Report', 'The customer was happy but had some concerns', 'reports'),
(4, 'Angry Customer Complaint', 'I am an angry customer demanding refund', 'complaints'),
(5, 'Neutral Customer Survey', 'The customer seemed neutral about our service', 'surveys'),
(6, 'Fast Delivery Service', 'Our delivery service is really fast and reliable', 'services'),
(7, 'Slow Delivery Issues', 'The delivery was extremely slow this time', 'issues'),
(8, 'Good Service Quality', 'We provide good service to all customers', 'services'),
(9, 'Bad Service Report', 'There were complaints about bad service quality', 'reports'),
(10, 'Customer Happy Experience', 'The happy customer left positive feedback', 'feedback'),
(11, 'Premium Quality Product', 'This is a premium quality item with excellent features', 'products'),
(12, 'Budget Quality Option', 'A budget quality alternative for cost-conscious buyers', 'products'),
(13, 'Standard Quality Service', 'Our standard quality offering meets basic needs', 'services');
उदाहरण 1: सभी भावनात्मक स्थिति पकड़ें
क्वेरी: "(happy | sad | angry) customer"
SELECT * FROM phrase_or_demo WHERE MATCH('"(happy | sad | angry) customer"')
परिणाम:
+------+---------------------------+---------------------------------------------------+------------+
| id | title | content | category |
+------+---------------------------+---------------------------------------------------+------------+
| 2 | Sad Customer Feedback | I am a very sad customer with poor experience | reviews |
| 4 | Angry Customer Complaint | I am an angry customer demanding refund | complaints |
| 1 | Happy Customer Review | I am a very happy customer with excellent service | reviews |
| 10 | Customer Happy Experience | The happy customer left positive feedback | feedback |
+------+---------------------------+---------------------------------------------------+------------+
4 rows in set (0.00 sec)
क्यों यह महत्वपूर्ण है: तीन अलग-अलग वाक्यांश क्वेरी लिखने के बजाय और उन्हें OR के साथ संयोजित करने के बजाय, आपको एक सुंदर क्वेरी के साथ सटीक वाक्यांश मिलान मिलता है।
उदाहरण 2: सेवा गुणवत्ता भिन्नताएँ
क्वेरी: "(good | bad | premium | budget | standard) (service | quality)"
SELECT * FROM phrase_or_demo WHERE MATCH('"(good | bad | premium | budget | standard) (service | quality)"');
परिणाम:
+------+--------------------------+--------------------------------------------------------+----------+
| id | title | content | category |
+------+--------------------------+--------------------------------------------------------+----------+
| 8 | Good Service Quality | We provide good service to all customers | services |
| 9 | Bad Service Report | There were complaints about bad service quality | reports |
| 11 | Premium Quality Product | This is a premium quality item with excellent features | products |
| 12 | Budget Quality Option | A budget quality alternative for cost-conscious buyers | products |
| 13 | Standard Quality Service | Our standard quality offering meets basic needs | services |
+------+--------------------------+--------------------------------------------------------+----------+
5 rows in set (0.00 sec)
लाभ: एक क्वेरी सभी गुणवत्ता - सेवा संयोजनों को सटीक वाक्यांश सटीकता के साथ पकड़ती है।
बुनियादी वाक्यांशों से परे: quorum और Proximity
OR ऑपरेटर सरल वाक्यांशों तक ही सीमित नहीं है। कभी-कभी आपको अधिक लचीलापन चाहिए जैसे कि ऐसे दस्तावेज़ों को मेल करना जिनमें हर टर्म मौजूद नहीं है, या ऐसे शर्तों को खोजने के लिए जो निकट हैं लेकिन आवश्यक रूप से सटीक क्रम में नहीं हैं। यही कारण है कि quorum और proximity ऑपरेटर आते हैं, और ये OR के साथ निर्बाध रूप से काम करते हैं।
OR के साथ Quorum: लचीला फजी मिलान
OR के साथ quorum ऑपरेटर आपको उन्नत फजी मिलान देता है जहां प्रत्येक OR समूह से केवल एक शब्द थ्रेशोल्ड की ओर गिनती करता है:
-- Find documents with at least 2 out of these word groups
SELECT id, content FROM phrase_or_demo WHERE MATCH('@content "(excellent | good | premium) (service | quality | experience) customer"/2');
परिणाम:
+------+--------------------------------------------------------+
| id | content |
+------+--------------------------------------------------------+
| 8 | We provide good service to all customers |
| 1 | I am a very happy customer with excellent service |
| 11 | This is a premium quality item with excellent features |
| 2 | I am a very sad customer with poor experience |
| 5 | The customer seemed neutral about our service |
+------+--------------------------------------------------------+
5 rows in set (0.00 sec)
व्याख्या: यह उन दस्तावेजों का मिलान करता है जिनमें 3 शब्द समूहों में से कम से कम 2 होते हैं: (excellent|good|premium), (service|quality|experience), और “customer”।
उन्नत quorum उदाहरण
-- Match documents with at least 50% of these emotion/service combinations
SELECT id, title FROM phrase_or_demo
WHERE MATCH('"(happy | satisfied) (customer | experience) (excellent | good) (service | quality)"/0.5');
OR के साथ Proximity: निकट वैकल्पिक
OR के साथ proximity ऑपरेटर प्रत्येक विकल्प को निर्धारित दूरी के भीतर अलग से जांचता है:
-- Find "delivery" within 3 words of either "fast" or "slow"
SELECT id, title, content FROM phrase_or_demo WHERE MATCH('"(fast | slow) delivery"~3');
परिणाम:
+------+-----------------------+--------------------------------------------------+
| id | title | content |
+------+-----------------------+--------------------------------------------------+
| 7 | Slow Delivery Issues | The delivery was extremely slow this time |
| 6 | Fast Delivery Service | Our delivery service is really fast and reliable |
+------+-----------------------+--------------------------------------------------+
2 rows in set (0.00 sec)
जटिल Proximity उदाहरण
-- Customer and emotional state within 5 words, plus quality terms
SELECT id, title, content FROM phrase_or_demo WHERE MATCH('"customer (happy | sad | angry)"~2 (quality | service | experience)');
परिणाम:
+------+---------------------------+---------------------------------------------------+
| id | title | content |
+------+---------------------------+---------------------------------------------------+
| 10 | Customer Happy Experience | The happy customer left positive feedback |
| 2 | Sad Customer Feedback | I am a very sad customer with poor experience |
| 1 | Happy Customer Review | I am a very happy customer with excellent service |
| 3 | Customer Service Report | The customer was happy but had some concerns |
+------+---------------------------+---------------------------------------------------+
4 rows in set (0.00 sec)
तुलना: पारंपरिक बनाम उन्नत
पारंपरिक दृष्टिकोण (मल्टीपल फुल-टेक्स्ट स्टेटमेंट्स)
-- The old way: multiple separate queries
SELECT id, title FROM phrase_or_demo WHERE MATCH('"happy customer"|"sad customer"|"angry customer"');
आधुनिक दृष्टिकोण (सिंगल OR वाक्यांश)
-- The elegant way: one query to rule them all
SELECT id, title FROM phrase_or_demo WHERE MATCH('"(happy | sad | angry) customer"');
वास्तविक दुनिया के अनुप्रयोग
1. ई-कॉमर्स उत्पाद खोज
-- Capture all color and size variations
"(red | blue | green | black) (shirt | t-shirt | tee) (small | medium | large)"
2. सामग्री प्रबंधन प्रणाली
-- Track document status changes
"(draft | published | archived | deleted) (document | article | post)"
3. ग्राहक सहायता टिकट विश्लेषण
-- Categorize support issues with quorum
"(urgent | critical | high) (priority | importance) (bug | issue | problem)"/2
4. सोशल मीडिया भावना निगरानी
-- Capture brand mentions with emotional context
"@brand (love | hate | like | dislike) (product | service | experience)"~5
5. चिकित्सा रिकॉर्ड खोज
-- Find patient symptoms with proximity
"patient (experienced | reported | complained) (pain | discomfort | symptoms)"~4
6. वित्तीय लेनदेन विश्लेषण
-- Track transaction types and statuses
"(credit | debit | transfer) (completed | pending | failed | cancelled)"
उन्नत उपयोग पैटर्न
1. स्तरीकृत सटीकता
सर्जिकल सटीकता के लिए वाक्यांश OR को अन्य ऑपरेटरों के साथ संयोजित करें:
@title "(urgent | critical) (update | patch)" @body "security"
2. प्रदर्शन अनुकूलन
फजी मिलान के लिए OR के साथ quorum का उपयोग करें जो वाइल्डकार्ड खोजों से तेज हो सकता है:
"(run | running | runner | runs) (fast | quick | speed)"/1
3. संदर्भ लचीलापन
प्राकृतिक भाषा भिन्नताओं के लिए proximity OR का लाभ उठाएं:
"user (wants | needs | requires) (feature | functionality)"~3
प्रमुख लाभ
- सटीकता: विविधताओं को समायोजित करते हुए सटीक वाक्यांश संरचना बनाए रखें
- रखरखाव: एक ही क्वेरी को अपडेट करें बजाय कई भिन्नताओं को प्रबंधित करने के
- विश्लेषण: एकीकृत परिणाम सेट विश्लेषण और रैंकिंग को अधिक अर्थपूर्ण बनाते हैं
- लचीलापन: वास्तविक दुनिया की भाषा भिन्नताओं को प्रभावी ढंग से संभालता है
अंतिम बात
वाक्यांशों के अंदर OR ऑपरेटर कठोर सटीक-मेल खोज और ढीले कीवर्ड मिलान के बीच एक उपयोगी मध्य भूमि प्रदान करते हैं। चाहे आप ई-कॉमर्स खोज बना रहे हों, ग्राहक फीडबैक का विश्लेषण कर रहे हों, या सामग्री खोज प्रणाली बना रहे हों, यह सुविधा वाक्यांशों की सटीकता के साथ विकल्पों की लचीलापन प्रदान करती है।
Manticore Search 13.6.7 इस कार्यक्षमता को इसके व्यापक पाठ खोज क्षमताओं के हिस्से के रूप में शामिल करता है। वाक्यांश, निकटता और quorum ऑपरेटरों का संयोजन OR कार्यक्षमता के साथ जटिल खोज आवश्यकताओं को संभालने के लिए अतिरिक्त विकल्प प्रदान करता है।
इस सुविधा और अन्य सुधारों के बारे में और जानने के लिए Manticore Search 13.6.7 रिलीज नोट्स देखें।