<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Hrushi yadav</title>
    <description>The latest articles on Forem by Hrushi yadav (@hrushi_yadav).</description>
    <link>https://forem.com/hrushi_yadav</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1491864%2Faf1f20b3-85dc-4244-b407-a71953511ffc.png</url>
      <title>Forem: Hrushi yadav</title>
      <link>https://forem.com/hrushi_yadav</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/hrushi_yadav"/>
    <language>en</language>
    <item>
      <title>Deep Dive on Phonetic vs Semantic Search</title>
      <dc:creator>Hrushi yadav</dc:creator>
      <pubDate>Mon, 14 Apr 2025 09:08:36 +0000</pubDate>
      <link>https://forem.com/hrushi_yadav/deep-dive-on-phonetic-vs-semantic-search-4j6h</link>
      <guid>https://forem.com/hrushi_yadav/deep-dive-on-phonetic-vs-semantic-search-4j6h</guid>
      <description>&lt;p&gt;Saw a viral post on Twitter comparing "Prashant" and "Croissant" and it got me thinking - how exactly does search work? What logic is behind it?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1eq458t45dr6e2rqkkm4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1eq458t45dr6e2rqkkm4.png" alt="Viral Tweet"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Luckily, I follow Arpit who had already made a video breaking this down (I’ve linked that below). After watching it, I figured: why not try building something similar over the weekend? Surprisingly, it only took 2 hours because I already had a basic understanding of search algorithms.&lt;/p&gt;

&lt;p&gt;To really get into this, I had to go deeper — here’s what I found:&lt;/p&gt;

&lt;p&gt;🧠 Lexical Search&lt;/p&gt;

&lt;p&gt;Lexical search is your classic, text-based search. It matches documents based on exact word matches.&lt;/p&gt;

&lt;p&gt;How it works:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Words are put into an &lt;strong&gt;inverted index&lt;/strong&gt; — a data structure mapping words to the documents they appear in.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;word 1 -&amp;gt; [doc1, doc2, doc3]
word 2 -&amp;gt; [doc1, doc4, doc5]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Real-world example:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"optimization" -&amp;gt; ['git.pdf','codeofconduct.md','readme.md']
"CICD" -&amp;gt; ['azurefundamentals.pdf','readme.md']
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🔴 Limitations:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Doesn't understand &lt;strong&gt;meaning&lt;/strong&gt; or &lt;strong&gt;sound&lt;/strong&gt; of words.&lt;/li&gt;
&lt;li&gt;One-to-one word mapping only:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"PullRequest" ≠ "PullRaquest"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Common issues:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Spelling variations: &lt;code&gt;Hrushi vs Hrishi vs Rishi vs Rushi&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Typos/misspellings: &lt;code&gt;hrushikesh vs hrushkesh vs hrushiksh&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Synonyms: &lt;code&gt;car vs vehicle&lt;/code&gt;, &lt;code&gt;automobile vs SUV&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Abbreviations: &lt;code&gt;AI vs Artificial Intelligence&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🔍 Fuzzy Search
&lt;/h2&gt;

&lt;p&gt;Fuzzy search handles typos or small spelling differences. It matches terms even when they aren’t exact.&lt;/p&gt;

&lt;h3&gt;
  
  
  Example:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Query: Prashant
Result matches (within edit distance ≤ 4):
- merchant
- elephant
- present
- variant
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Edit Distance&lt;/strong&gt; is how many changes you need to convert one word to another.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  🔊 Phonetic Search
&lt;/h2&gt;

&lt;p&gt;Phonetic search matches based on how a word &lt;strong&gt;sounds&lt;/strong&gt;, not how it’s spelled.&lt;/p&gt;

&lt;p&gt;It uses algorithms like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Soundex&lt;/li&gt;
&lt;li&gt;Metaphone&lt;/li&gt;
&lt;li&gt;NYSIIS&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  How it works:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;word -----------&amp;gt; phonetic key
"coffee" -------&amp;gt; KF (metaphone)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Example:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mikaela -&amp;gt; MKL (Soundex)
micaela -&amp;gt; MKL (Soundex)

kristen -&amp;gt; KRSTN (Metaphone)
cristen -&amp;gt; KRSTN (Metaphone)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  ✅ Strengths:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Great for matching spelling variations that sound alike.&lt;/li&gt;
&lt;li&gt;Fast &amp;amp; doesn't need training data.&lt;/li&gt;
&lt;li&gt;Lookup is indexed and efficient (O(n) encoding).&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  ⚠️ Concerns:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Can lead to &lt;strong&gt;false positives&lt;/strong&gt; — different words that sound similar can match.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;text&lt;br&gt;
"file" =&amp;gt; Soundex: F400 | Metaphone: FL&lt;br&gt;
"phile" =&amp;gt; Soundex: P400 | Metaphone: FL&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;


&lt;h2&gt;
  
  
  🧠 Semantic Search
&lt;/h2&gt;

&lt;p&gt;Semantic search goes beyond words — it captures the &lt;strong&gt;meaning&lt;/strong&gt; using NLP and embeddings.&lt;/p&gt;
&lt;h3&gt;
  
  
  How it works:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Each word/sentence is converted into a &lt;strong&gt;vector&lt;/strong&gt;.
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"laptop" -&amp;gt; [0.25, 0.742, 0.1232, 0.5453]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;Perform &lt;strong&gt;k-NN search&lt;/strong&gt; to find the closest vectors (similar meaning).&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;
  
  
  Pre-reqs:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Trained language model (like BERT, Word2Vec).&lt;/li&gt;
&lt;li&gt;Corpus for training (e.g., news articles).&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  ✅ Strengths:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Understands &lt;strong&gt;context&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Matches concepts not present in the corpus.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;For example, your data doesn’t have "laptop" but has "notebook" — it’ll still match!&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;
  
  
  ⚠️ Concerns:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Needs training and resources.&lt;/li&gt;
&lt;li&gt;Vector comparisons are resource-intensive.&lt;/li&gt;
&lt;li&gt;Approximation (ANN) may be needed for large datasets.&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  💡 Back to "Prashant vs Croissant"
&lt;/h2&gt;

&lt;p&gt;None of the phonetic or semantic algorithms would match them — because:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;prashant =&amp;gt; Soundex: P625 | Metaphone: PRXNT | NYSIIS: PRASAD
croissant =&amp;gt; Soundex: C625 | Metaphone: KRSNT | NYSIIS: CRASAD
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;They're phonetically and semantically unrelated.&lt;/p&gt;

&lt;p&gt;So how did that tweet match them?&lt;/p&gt;




&lt;h2&gt;
  
  
  💭 Solution: Manual Synonym Mapping
&lt;/h2&gt;

&lt;p&gt;Define a &lt;strong&gt;custom synonym map&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1. When query is "prashant"
2. Expand to "prashant OR croissant"
3. Fire the expanded query
4. Elasticsearch returns docs matching either
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Simple and effective!&lt;/p&gt;




&lt;h2&gt;
  
  
  🔧 ElasticSearch Demo
&lt;/h2&gt;

&lt;p&gt;I’ve created a full demo showing different types of search using AWS ElasticSearch. Check it out on &lt;a href="https://github.com/HrushiYadav/elastic-search" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;References :&lt;br&gt;
1) &lt;a href="https://youtu.be/gZIVHSFgkvk?si=6YWgxL4PitvhZL8L" rel="noopener noreferrer"&gt;https://youtu.be/gZIVHSFgkvk?si=6YWgxL4PitvhZL8L&lt;/a&gt;&lt;br&gt;
2) &lt;a href="https://medium.com/@tzhaonj/metaphone-a-quick-and-efficient-method-for-fuzzy-name-matching-aaeb68d3c481" rel="noopener noreferrer"&gt;https://medium.com/@tzhaonj/metaphone-a-quick-and-efficient-method-for-fuzzy-name-matching-aaeb68d3c481&lt;/a&gt;&lt;/p&gt;

</description>
      <category>elasticsearch</category>
      <category>phoneticsearch</category>
      <category>search</category>
    </item>
    <item>
      <title>Zoom Meetings API Integration Guide</title>
      <dc:creator>Hrushi yadav</dc:creator>
      <pubDate>Thu, 29 Aug 2024 20:27:38 +0000</pubDate>
      <link>https://forem.com/hrushi_yadav/zoom-meetings-api-integration-guide-1gi8</link>
      <guid>https://forem.com/hrushi_yadav/zoom-meetings-api-integration-guide-1gi8</guid>
      <description>&lt;p&gt;Integrating Zoom's API allows you to automate meeting scheduling and management. With this integration, you can schedule and manage meetings without needing a paid Zoom plan. Here’s a step-by-step guide to get you started with Zoom API integration using Node.js and Express.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prerequisites&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Basic knowledge of Node.js and Express.&lt;br&gt;
A Zoom account.&lt;br&gt;
Node.js and npm installed on your machine.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step-by-Step Instructions&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Create a Zoom App&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a Zoom Account: If you don't have one, sign up at &lt;a href="https://marketplace.zoom.us/" rel="noopener noreferrer"&gt;Zoom Marketplace&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Develop an App: Go to the Zoom Marketplace and click on the "Develop" icon.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fai0suz3zwdamxlylck57.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fai0suz3zwdamxlylck57.png" alt="Image description" width="800" height="98"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Build App: Click on "Build App" and select "Server to Server OAuth" app type.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Store Credentials: After creating the app, store the following details securely:&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;ZOOM_CLIENT_ID&lt;br&gt;
ZOOM_CLIENT_SECRET&lt;br&gt;
ZOOM_ACCOUNT_ID&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Set Up Your Project&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a Project Folder: Create a new folder for your project and initialize it with npm.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;mkdir zoom-meeting-integration&lt;br&gt;
cd zoom-meeting-integration&lt;br&gt;
npm init -y&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Install Dependencies: Install the required libraries using npm.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;npm install axios body-parser dotenv express&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create Environment Variables: Create a .env file in the root directory of your project and add your Zoom credentials:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ZOOM_CLIENT_ID=YOUR_ZOOM_CLIENT_ID
ZOOM_CLIENT_SECRET=YOUR_ZOOM_CLIENT_SECRET
ZOOM_ACCOUNT_ID=YOUR_ZOOM_ACCOUNT_ID
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3. Implement API Integration&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create an Index File: Create a file named index.js and set up your basic Express server:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const express = require('express');
const bodyParser = require('body-parser');
const axios = require('axios');
require('dotenv').config();

const app = express();
app.use(bodyParser.json());

// Your code will go here

app.listen(3000, () =&amp;gt; {
  console.log('Server is running on port 3000');
});

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Get an Access Token: Create a function to get an OAuth token from Zoom. Add the following code to index.js:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;async function getAccessToken() {
  const response = await axios.post('https://zoom.us/oauth/token', null, {
    params: {
      grant_type: 'account_credentials',
    },
    auth: {
      username: process.env.ZOOM_CLIENT_ID,
      password: process.env.ZOOM_CLIENT_SECRET,
    },
  });
  return response.data.access_token;
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;API Payload
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "topic": "Sample Meeting",
  "type": 1,
  "duration": 30,
  "start_time": "2024-09-01T10:00:00Z",
  "agenda": "Discuss project updates"
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Schedule a Meeting: Create an endpoint to schedule a meeting using the Zoom API:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;app.post('/schedule-meeting', async (req, res) =&amp;gt; {
  try {
    const token = await getAccessToken();
    const meetingData = {
      topic: 'Sample Meeting',
      type: 1,
      duration: 30,
      start_time: '2024-09-01T10:00:00Z',
      agenda: 'Discuss project updates',
    };

    const response = await axios.post('https://api.zoom.us/v2/users/me/meetings', meetingData, {
      headers: {
        Authorization: `Bearer ${token}`,
        'Content-Type': 'application/json',
      },
    });

    res.json(response.data);
  } catch (error) {
    res.status(error.response ? error.response.status : 500).send(error.message);
  }
});

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Retrieve Meeting Link: Once you have the meeting ID, you can use it to get the meeting link:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;app.get('/meeting-link/:meetingId', async (req, res) =&amp;gt; {
  try {
    const token = await getAccessToken();
    const meetingId = req.params.meetingId;

    const response = await axios.get(`https://api.zoom.us/v2/meetings/${meetingId}`, {
      headers: {
        Authorization: `Bearer ${token}`,
      },
    });

    res.json({ join_url: response.data.join_url });
  } catch (error) {
    res.status(error.response ? error.response.status : 500).send(error.message);
  }
});

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Sending Meeting Links
Send Emails: After retrieving the meeting link, you can use any mail service (e.g., Nodemailer) to send the meeting link to participants.&lt;/li&gt;
&lt;li&gt;Additional Information&lt;/li&gt;
&lt;li&gt;Meeting Features: Note that the API for adding participants may require a paid Zoom plan. For free plans, you can only schedule meetings and share the links manually.&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Refer to GitHub: For a complete implementation, check out the GitHub repository &lt;a href="https://github.com/HrushiYadav/Zoom-Meeting-Scheduler" rel="noopener noreferrer"&gt;Zoom Meeting Scheduler&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By following these steps, you can successfully integrate Zoom API into your application for scheduling and managing meetings.&lt;/p&gt;

</description>
      <category>zoom</category>
      <category>graphql</category>
      <category>api</category>
      <category>node</category>
    </item>
  </channel>
</rss>
