Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google-like Search Engine in PHP/mySQL [closed]

Tags:

We have OCRed thousands of pages of newspaper articles. The newspaper, issue, date, page number and OCRed text of each page has been put into a mySQL database.

We now want to build a Google-like search engine in PHP to find the pages given a query. It's got to be fast, and take no more than a second for any search.

How should we do it?

like image 749
lkessler Avatar asked Feb 02 '09 05:02

lkessler


People also ask

What is Mysql_query?

mysql_query() sends a query to the currently active database on the server that's associated with the specified link identifier. If link_identifier isn't specified, the last opened link is assumed. If no link is open, the function tries to establish a link as if mysql_connect() was called with no arguments, and use it.

Is MySQL a search engine?

MySQL is not a search engine MySQL is a relational database, not a search engine. While it does provide some tools to search inside the data it holds, you're better of integrating a real search engine if you're looking for a full-fledged solution.

What is like in PHP?

The LIKE operator is used in a WHERE clause to search for a specified pattern in a column. There are two wildcards often used in conjunction with the LIKE operator: The percent sign (%) represents zero, one, or multiple characters. The underscore sign (_) represents one, single character.


2 Answers

You can also try out SphinxSearch. Craigslist uses sphinx and it can connect to both mysql and postgresql.

like image 63
cnu Avatar answered Oct 01 '22 02:10

cnu


There are some interesting search engines for you to take a look at. I don't know what you mean by "Google like" so I'm just going to ignore that part.

  • Take a look at the Lucene engine. The original is high performance but written in Java. There is a port of Lucene to PHP (already mentioned elsewhere) but it is too slow.
  • Take a serious look at the Xapian Project. It's fast. It's written in C++ so you'll most probably have to build it for your target server(s) but has PHP bindings.
like image 35
Glenn Avatar answered Oct 01 '22 01:10

Glenn