Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5958573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:33:45+00:00 2026-05-22T18:33:45+00:00

I have a MySQL InnoDB table with a ‘name’ column (VARCHAR(255)) which I want

  • 0

I have a MySQL InnoDB table with a ‘name’ column (VARCHAR(255)) which I want users to be able to search against, returning all the matching rows. However, I can’t just use a LIKE query because the search needs to allow for users typing in names which are similar to the available names (e.g. prefixing with ‘The’, or not knowing that the correct name includes an apostrophe).

Two examples are:

Name in DB: ‘Rose and Crown’

Example possible searches which should match: ‘Rose & Crown’, ‘Rose and Crown’, ‘rose and crown’, ‘The Rose and Crown’

Name in DB: ‘Diver’s Inn’

Example possible searches which should match: ‘Divers’ Inn’, ‘The Diver’s Inn’, ‘Divers Inn’

I also want to be able to rank the results by a ‘closest match’ relevance, although I’m not sure how that would be done (edit distance perhaps?).

It’s unlikely that the table will ever grow beyond a few thousand rows, so a method which doesn’t scale to millions of rows is fine. Once entered, the name value for a given row will not change, so if an expensive indexing operation is required that’s not a problem.

Is there an existing tool which will perform this task? I’ve looked at Zend_Search_Lucence but that seems to focus on documents, whereas I’m only interesting in searching a single column.

Edit: On SOUNDEX searching, this doesn’t produce the results I want. For example:

SELECT soundex( 'the rose & crown' ) AS soundex1, soundex( 'rose and crown' ) AS soundex2;
soundex1    soundex2
T6265   R253265

Solution: In the end I’ve used Zend_Search_Lucence and just pretended that every name is in fact a document, which seems to achieve the result I want. I guess it’s full text search in a way, even though each string is at most 3-4 words.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T18:33:46+00:00Added an answer on May 22, 2026 at 6:33 pm

    Full Text Search (FTS) is the terminology for the database functionality you desire. There’s:

    • Native MySQL support (requires that the table be MyISAM)

      WHERE MATCH(column) 
              AGAINST('Rose', 'Crown') 
      
    • Sphinx (3rd party)

    • Lucene/SOLR (3rd party)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a MySQL InnoDB table with a status column. The status can be
I am new to MySQL and want to have InnoDB table type for my
I have got a Mysql (5.1.58-1ubuntu1) 'users' table ( InnoDB storage engine, utf8 general
I have an InnoDB table in MySQL which used to contain about 600k rows.
I have the following MySQL (version 5.1) table (InnoDB): Username varchar(50) Sequence int(11) FileType
I have a MySQL-InnoDB table with 350,000+ rows, containing a couple of things like
I have a MySQL InnoDB table on a RedHat Enterprise Linux 4 server, and
I have a MySQL InnoDB table with 238 columns. 56 of them are TEXT
I have a MySQL InnoDB table laid out like so: id (int), run_id (int),
I have an InnoDB table in mysql with utf8 charset and utf8_general_ci collation. After

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.