Webmaster Sun Login
Not a member yet? Sign up

How Did You Structure Your Index Mysql Tbl ?

  • HOME
  • FORUMS
  • BLOGS
  • MARKETPLACE
  • ADVERTISING
  • SPECIAL OFFERS
  • WEB HOSTING
  • QUICK MENU
  • REGISTER HERE - Join us for FREE
Results 1 to 3 of 3
    Stick this thread
  1. #1
    Join Date
    Jun 2017
    Posts
    86
    Thumbs Up/Down
    Received: 0/0
    Given: 22/0
    Thanks
    13
    Thanked 1 Time in 1 Post

    Question How Did You Structure Your Index Mysql Tbl ?

    Php Buddies,


    I'm going to jump into building my own searchengine now.
    Starting off with the search box, then the index and then finally the crawler.
    Not too worried about the crawler. Gonna make use of cURL and implode,explode, etc. php functions.
    It's the Index that I quite can't get my head around.

    To build the Index, should I have the structure of the mysql tbl like this .... ?

    Option 1

    Columns
    Url|Keywords

    Or, should I make the structure like this instead ..... ?

    Option 2

    Columns
    Keyword|Urls


    Option 1a Example

    Columns
    Url | Keywords
    -----------------------------------------------------------------------
    devshed.com | forum, programming, php

    Option 1b Example

    Columns
    Keyword | Urls
    --------------------------------------------------------------------------------------------------------------------------
    forum | devshed.com, blackhat.com, warriorforum.com
    ---------------------------------------------------------------------------------------------------------------------------
    php | devshed.com/forum/php.htm, sitepoint.com/forum/php.php



    Option 2a Example

    Columns
    Urls | Keyword
    -----------------------------------------------------------------------
    devshed.com | forum
    -----------------------------------------------------------------------
    devshed.com | programming
    -----------------------------------------------------------------------
    warriorforum.com | money
    -----------------------------------------------------------------------
    warriorforum.com | forum



    Option 2b Example

    Columns
    Keywords | Urls
    --------------------------------------------------------------------------------------------------------------------------
    forum | devshed.com/forum
    --------------------------------------------------------------------------------------------------------------------------
    forum | blackhat.com/forum
    ---------------------------------------------------------------------------------------------------------------------------
    php | devshed.com/forum/php.htm
    ---------------------------------------------------------------------------------------------------------------------------
    php | sitepoint.com/forum/php.php


    Question 1:
    I have a feeling you won't like Option 1a or 1b atall.
    But, let's assume you need to do it out of them 2 options. Which one would you choose ?

    Question 2:
    I have a feeling you will like Option 2a or 2b.
    Which one would you choose ?
    Or, if you don't like any of them 2. Then, let's assume you need to do it out of them 2 options. Which one would you choose ?

    Question 3:
    If you don't like the structure of any of the 4 options then which structure would you yourself use or have used ?
    Best to show an example like I did.


    Btw, I know that, if I structure my tbl around the way I showed in my examples then users would only be able to make queires for a single keyword and not a phrase. But, dealing with phrases get complicated and so for the time being, as a beginner, let's concentrate one thing at a time. Concentrate on the very first basic of indexing a url.

    Thanks

  2. #2
    Join Date
    May 2016
    Posts
    558
    Thumbs Up/Down
    Received: 63/1
    Given: 695/2
    Thanks
    41
    Thanked 48 Times in 47 Posts
    Quote Originally Posted by sunny_pro View Post
    I'm going to jump into building my own searchengine now.
    Starting off with the search box, then the index and then finally the crawler.
    Not too worried about the crawler. Gonna make use of cURL and implode,explode, etc. php functions.
    It's the Index that I quite can't get my head around.
    I am curious why you don't worry about crawlers because they will decide what the user will see after search on your search engine. You should care what you will get (data) from these sites and when an user searches on your site then it will return the result depends on their queries.

    I didn't understand why you would build tables with those structures. More details can help someone here give you better support.

  3. #3
    Join Date
    Jun 2017
    Posts
    86
    Thumbs Up/Down
    Received: 0/0
    Given: 22/0
    Thanks
    13
    Thanked 1 Time in 1 Post
    Quote Originally Posted by Marc van Leeuwen View Post
    I am curious why you don't worry about crawlers because they will decide what the user will see after search on your search engine. You should care what you will get (data) from these sites and when an user searches on your site then it will return the result depends on their queries.

    I didn't understand why you would build tables with those structures. More details can help someone here give you better support.
    I am going to create the crawler with cURL. The crawler would fetch the pages and then it would grab the keywords from the pages and then dump the keywords and the page urls to my mysql datababase (db). That db is the Index. I'm not too worried about how to build the web crawler because I know how to build it and if I get stuck then this forum members are welcome to help. As for now, I'm building the Index with the mysql db and so need to learn how to structure the mysql table (tbl). Because, if I get the structure wrong then the searchengine would become slow as the search feature would need to do more work to get the results from the Index (tbl).
    It is like this, if you dump all your clothes (shirts, trousers, coats) into one drawer in your ward drobe then when you need to rush to a party and need to grab your coat, you're gonna have to wade through all those clothes to fetch your coat. Your fetching would become slow due too disorganisation.
    But, if you put your coats in one drawer and your trousers in another and your shirts in another then when you need to grab your coat you won't be looking into the other 2 drawers but the drawer where you usually put your coats. Your fetching would be easier and faster. The fetching was faster in the 2nd example due to you neatly organising the drawers.
    My mysql db is like your room (Index).
    My mysql db tbl is like your wardrobe (a part of the Index).
    My mysql table columns are like your drawers.
    My search feature is like you or your fetching hands.
    You don't want to be roaming your hands on all 3 your drawers but the appropriate one. Neither do I want to get my search feature to be looking into the wrong tables or the wrong columns but the appropriate ones.
    Therefore, need to get the tbl organised with the appropriate columns just like you got your wardrobe organised by discriminating it's drawers.

    In short, the tbl structure would narrow the work down if it is structured correctly.

Newer Threads

  1. Jonhsunny
    Hello
    By Jonhsunny in forum New Member Introductions
    ulterios
    Replies: 2 | Views: 202
    Last post by ulterios, 01-11-2018, 09:33 PM
  2. Ratha1207
    ivanab
    Replies: 6 | Views: 493
    Last post by ivanab, 01-15-2018, 01:26 PM
  3. NiNi Sweetie
    Hello
    By NiNi Sweetie in forum New Member Introductions
    ulterios
    Replies: 2 | Views: 222
    Last post by ulterios, 01-12-2018, 07:38 PM
  4. Mary4
    Hello,
    By Mary4 in forum New Member Introductions
    Rob Whisonant
    Replies: 2 | Views: 216
    Last post by Rob Whisonant, 01-12-2018, 08:45 PM
  5. visalprom
    Introduction
    By visalprom in forum New Member Introductions
    ulterios
    Replies: 3 | Views: 277
    Last post by ulterios, 01-14-2018, 06:08 AM

Older Threads

  1. sunny_pro
    sunny_pro
    Replies: 2 | Views: 263
    Last post by sunny_pro, 01-10-2018, 06:24 AM
  2. vishwa
    CookieRunner
    Replies: 11 | Views: 1249
    Last post by CookieRunner, 02-01-2018, 05:59 AM
  3. Ridew
    divdeeps
    Replies: 12 | Views: 967
    Last post by divdeeps, 07-09-2018, 06:53 AM
  4. Heather
    professorrosado
    Replies: 5 | Views: 415
    Last post by professorrosado, 01-24-2018, 01:23 AM
  5. nortoncomsetup
    ORLOVA
    Replies: 3 | Views: 445
    Last post by ORLOVA, 04-19-2018, 12:04 PM

Latest Threads

  1. Rob Whisonant
    Rob Whisonant
    Replies: 0 | Views: 20
    Last post by Rob Whisonant, Today, 07:36 AM
  2. emmawilliam22
    Hello,
    By emmawilliam22 in forum New Member Introductions
    rozzski89
    Replies: 4 | Views: 132
    Last post by rozzski89, Today, 04:03 AM
  3. Xerof
    Rob Whisonant
    Replies: 3 | Views: 118
    Last post by Rob Whisonant, 07-16-2018, 09:08 PM
  4. SimonBritt
    harrygreen90
    Replies: 2 | Views: 144
    Last post by harrygreen90, 07-20-2018, 10:47 AM
  5. Xerof
    Xerof
    Replies: 4 | Views: 164
    Last post by Xerof, 07-17-2018, 03:44 PM

Similar Threads

  1. Williams Reus
    subhodipd
    Replies: 5 | Views: 1344
    Last post by subhodipd, 11-09-2017, 06:27 AM
  2. PenguinManiac
    shilpa
    Replies: 7 | Views: 650
    Last post by shilpa, 08-04-2017, 10:59 AM
  3. melanymaldena
    Ron Killian
    Replies: 7 | Views: 1986
    Last post by Ron Killian, 08-18-2016, 04:04 AM
  4. Harry P
    professorrosado
    Replies: 1 | Views: 819
    Last post by professorrosado, 04-04-2016, 06:45 AM
  5. JerryJo
    InFeRnO
    Replies: 4 | Views: 1979
    Last post by InFeRnO, 11-11-2013, 09:31 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Internet Marketing Forum

Webmaster Sun is a forum where you’ll find in-depth discussions and resources to help you succeed on the web whether you are new or experienced. You’ll find it all here. With topics ranging from internet marketing, search engine optimization, social networking, make money online, web hosting, affiliate marketing as well as hands-on technical support for web design, programming and more. We are a growing community of like-minded people that is keen to help and support each other with ambitions and online endeavors. Learn and grow, make friends and contacts for life.

Come Hang Out With Us

    Facebook Twitter Webmaster Forum Google+

    Webmaster Sun Logo
Copyright ©2012 - 2018, WebmasterSun.com. All rights reserved. Internet marketing forum for internet marketers, webmasters, web hosting providers, designers and affiliate marketers.

Welcome to Webmaster Sun

The World's Number 1 Webmaster Community, SEO and Marketplace

Log in!

Continue with Facebook
Continue With Email. By signing up you indicate that you have read and agree to the Terms of Service and Privacy Policy.

Sign in Manually

Need an account? Sign up now!