- PostgreSQL खुद अपना सर्च इंजन बनाने के लिए आवश्यक building blocks प्रदान करता है
- मुख्य components हैं
tsvector और tsquery data types, match operator @@, match results को rank करने वाले functions, और GIN index type
tsvector normalized vocabulary और मूल text में उसकी positions को store करता है
tsquery normalized query को दर्शाता है और logical operators का उपयोग करके कई terms को जोड़ सकता है
GIN index type का उपयोग tsvector पर efficient queries के लिए किया जाता है
ts_rank और ts_rank_cd ऐसे ranking functions हैं जो term frequency और proximity को ध्यान में रखते हैं
- relevance tuning के ज़रिए search results को खास मानदंडों के अनुसार customize किया जा सकता है
- ranking score में numbers, dates, और exact value boosters जोड़े जा सकते हैं
- column weights assign करके search results में कुछ terms को प्राथमिकता दी जा सकती है
- title column पर
setweight का उपयोग करने से jedi शब्द वाले movie titles की ranking बेहतर होती है
- PostgreSQL सीधे तौर पर fuzzy search या typo tolerance को support नहीं करता, लेकिन similarity या Levenshtein distance का उपयोग करके इसे implement किया जा सकता है
- facet search, जो users को search scope संकरा करने में मदद करती है, PostgreSQL में category definitions या algorithms का उपयोग करके implement की जा सकती है
- लेख का अंत इस उल्लेख के साथ होता है कि Elasticsearch के साथ विस्तृत तुलना भाग 2 में की जाएगी
1 टिप्पणियां
Hacker News की राय