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

  • Home
  • SEARCH
  • 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 690629
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:27:22+00:00 2026-05-14T02:27:22+00:00

Use Case When a user goes to my website, they will be confronted with

  • 0

Use Case

When a user goes to my website, they will be confronted with a search box much like SO. They can search for results using plan text. “.net questions”, “closed questions”, “.net and java”, etc.. The search will function a bit different that SO, in that it will try to as much as possible of the schema of the database rather than a straight fulltext search. So “.net questions” will only search for .net questions as opposed to .net answers (probably not applicable to SO case, just an example here), “closed questions” will return questions that are closed, “.net and java” questions will return questions that relate to .net and java and nothing else.

Problem

I’m not too familiar with the words but I basically want to do a keyword to SQL driven search. I know the schema of the database and I also can datamine the database. I want to know any current approaches there that existing out already before I try to implement this. I guess this question is for what is a good design for the stated problem.

Proposed

My proposed solution so far looks something like this

  1. Clean the input. Just remove any special characters
  2. Parse the input into chunks of data. Break an input of “c# java” into c# and java Also handle the special cases like “‘c# java’ questions” into ‘c# java’ and “questions”.
  3. Build a tree out of the input
  4. Bind the data into metadata. So convert stuff like closed questions and relate it to the isclosed column of a table.
  5. Convert the tree into a sql query.

Thoughts/suggestions/links?

  • 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-14T02:27:22+00:00Added an answer on May 14, 2026 at 2:27 am

    I run a digital music store with a “single search” that weights keywords based on their occurrences and the schema in which Products appear, eg. with different columns like “Artist”, “Title” or “Publisher”.

    Products are also related to albums and playlists, but for simpler explanation, I will only elaborate on the indexing and querying of Products’ Keywords.

    Database Schema

    Keywords table – a weighted table for every word that could possibly be searched for (hence, it is referenced somewhere) with the following data for each record:

    • Keyword ID (not the word),
    • The Word itself,
    • A Soundex Alpha value for the Word
    • Weight

    ProductKeywords table – a weighted table for every keyword referenced by any of a product’s fields (or columns) with the following data for each record:

    • Product ID,
    • Keyword ID,
    • Weight

    Keyword Weighting

    The weighting value is an indication of how often the words occurs. Matching keywords with a lower weight are “more unique” and are more likely to be what is being searched for. In this way, words occurring often are automatically “down-weighted”, eg. “the”, “a” or “I”. However, it is best to strip out atomic occurrences of those common words before indexing.

    I used integers for weighting, but using a decimal value will offer more versatility, possibly with slightly slower sorting.

    Indexing

    Whenever any product field is updated, eg. Artist or Title (which does not happen that often), a database trigger re-indexes the product’s keywords like so inside a transaction:

    1. All product keywords are disassociated and deleted if no longer referenced.
    2. Each indexed field (eg. Artist) value is stored/retrieved as a keyword in its entirety and related to the product in the ProductKeywords table for a direct match.
    3. The keyword weight is then incremented by a value that depends on the importance of the field. You can add, subtract weight based on the importance of the field. If Artist is more important than Title, Subtract 1 or 2 from its ProductKeyword weight adjustment.
    4. Each indexed field value is stripped of any non-alphanumeric characters and split into separate word groups, eg. “Billy Joel” becomes “Billy” and “Joel”.
    5. Each separate word group for each field value is soundexed and stored/retrieved as a keyword and associated with the product in the same way as in step 2. If a keyword has already been associated with a product, its weight is simply adjusted.

    Querying

    1. Take the input query search string in its entirety and look for a direct matching keyword. Retrieve all ProductKeywords for the keyword in an in-memory table along with Keyword weight (different from ProductKeyword weight).
    2. Strip out all non-alphanumeric characters and split query into keywords. Retrieve all existing keywords (only a few will match). Join ProductKeywords to matching keywords to in-memory table along with Keyword weight, which is different from the ProductKeyword weight.
    3. Repeat Step 2 but use soundex values instead, adjusting weights to be less relevant.
    4. Join retrieved ProductKeywords to their related Products and retrieve each product’s sales, which is a measure of popularity.
    5. Sort results by Keyword weight, ProductKeyword weight and Sales. The final summing/sorting and/or weighting depends on your implementation.
    6. Limit results and return product search results to client.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to use a case statement in my user-defined functions because I need
Use case: A does something on his box and gots stuck. He asks B
On a Use Case diagram can you show things that an actor cannot do,
Note: while the use-case described is about using submodules within a project, the same
Use case: 3rd party application wants to programatically monitor a text file being generated
My use case is this, I want to call out to a webservice and
My use case is very simple : I have a GUI application, and inside
What is a good use case for uncaught_exception?
Have a use case wherein need to maintain a connection open to a database
Usecase: The user makes font customizations to an object on the design surface, that

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.