Jump to content

Simple search engine for database.

I currently have a database full of data, with tags written to them. But just to find something. I need go search down the whole database which contains over 30000 links. So, is there a way to create a simple search engine for my database. And this might sound stupid but my database is just a MySQL file with links arranged like this:

INSERT INTO `searchengine` (`id`, `title`, `description`, `url`, `keywords`) VALUES

My database is connected to my server and I would like to be able to access it using the web. So the searchengine has to be on the web.

Technology Entertainment Creativity

Technology Electricity Control

Technology Electronics Computers

Link to comment
Share on other sites

Link to post
Share on other sites

Why can't you do this using SQL? From the wording it comes across as if you are manually searching through each record...

The single biggest problem in communication is the illusion that it has taken place.

Link to comment
Share on other sites

Link to post
Share on other sites

FileZilla can do DB Searches, but not the best.

Link to comment
Share on other sites

Link to post
Share on other sites

Why can't you do this using SQL? From the wording it comes across as if you are manually searching through each record...

It has to be public. Its a public database. So everyone should be able to go on my website. Search for something and get results from our database.

Technology Entertainment Creativity

Technology Electricity Control

Technology Electronics Computers

Link to comment
Share on other sites

Link to post
Share on other sites

It has to be public. Its a public database. So everyone should be able to go on my website. Search for something and get results from our database.

 

So the question still stands; why can't you use SQL? Simply abstract the queries away behind some of your web UI that you might build up for the purpose.

The single biggest problem in communication is the illusion that it has taken place.

Link to comment
Share on other sites

Link to post
Share on other sites

write a php page that will allow you to do searches.

Can Anybody Link A Virtual Machine while I go download some RAM?

 

Link to comment
Share on other sites

Link to post
Share on other sites

SQL has built in search as mentioned by users above. You don't need any fancy PHP or other web based server code to perform parsing etc, if anything that's probably the most inefficient way to do it.

Just make sure the user can't perform SQL injection as I'm guessing the searches would be passed straight from the user input to the SQL query.

Speedtests

WiFi - 7ms, 22Mb down, 10Mb up

Ethernet - 6ms, 47.5Mb down, 9.7Mb up

 

Rigs

Spoiler

 Type            Desktop

 OS              Windows 10 Pro

 CPU             i5-4430S

 RAM             8GB CORSAIR XMS3 (2x4gb)

 Cooler          LC Power LC-CC-97 65W

 Motherboard     ASUS H81M-PLUS

 GPU             GeForce GTX 1060

 Storage         120GB Sandisk SSD (boot), 750GB Seagate 2.5" (storage), 500GB Seagate 2.5" SSHD (cache)

 

Spoiler

Type            Server

OS              Ubuntu 14.04 LTS

CPU             Core 2 Duo E6320

RAM             2GB Non-ECC

Motherboard     ASUS P5VD2-MX SE

Storage         RAID 1: 250GB WD Blue and Seagate Barracuda

Uses            Webserver, NAS, Mediaserver, Database Server

 

Quotes of Fame

On 8/27/2015 at 10:09 AM, Drixen said:

Linus is light years ahead a lot of other YouTubers, he isn't just an average YouTuber.. he's legitimately, legit.

On 10/11/2015 at 11:36 AM, Geralt said:

When something is worth doing, it's worth overdoing.

On 6/22/2016 at 10:05 AM, trag1c said:

It's completely blown out of proportion. Also if you're the least bit worried about data gathering then you should go live in a cave a 1000Km from the nearest establishment simply because every device and every entity gathers information these days. In the current era privacy is just fallacy and nothing more.

 

Link to comment
Share on other sites

Link to post
Share on other sites

Create a simple html form that the user can enter the search criteria and submit the form to a php page. Note: You should create a separate index for each field in the table to get at the results in a timely fashion. 

 

To have each field as a criteria, create a form with input boxes for title,description, url and keywords. Then you can find the results by using a query like this:

select se.id      ,se.title      ,se.description      ,se.url      ,se.keywords  from searchengine se where 1=1   and (se.title like '%$title%' or se.description like '%$description%' or se.url like '%$url%' or se.keywords like '%$keywords%');

Or if you want a single "search" criteria to look at all the fields, create a form with a single input called search and then you can find the results:

select se.id      ,se.title      ,se.description      ,se.url      ,se.keywords  from searchengine se where 1=1   and (se.title like '%$search%' or se.description like '%$search%' or se.url like '%$search%' or se.keywords like '%$search%');

Use the Id field to go to a detail page and pull up the individual record if desired.

select se.id      ,se.title      ,se.description      ,se.url      ,se.keywords  from searchengine se where 1=1   and se.id = $id;

Hope that helps lead you in the right direction.

Model3TrackerModelXTracker / @ShuttleAkajor: 2017 Tesla Model X P100D

Link to comment
Share on other sites

Link to post
Share on other sites

If all you want is a simple search where you assume people will be writing things correctly, what sparkle128 suggested is the easiest (for now) to integrate, and is your best bet.

 

If you want partial searches (AND|OR), multiple keywords, aggregations, ranking data by specificity to search, or to allow word deviations then you're best off looking at seeding a solution like elasticsearch. When you'd add/update/delete/etc a row to your MySQL db, you'd also update the entry in elasticsearch; elasticsearch isn't a permanent data store RDBMS, it's a NoSQL search. PHP library: https://github.com/elastic/elasticsearch-php

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×