Sr. Web Developer
mediabistro.com
US-NY-New York

Justtechjobs.com Post A Job | Post A Resume

Comments for: dhar20040217

Message # 1019032:
Date: 02/23/04 19:31
By: Pablo Almunia
Subject: More easy with MySQL FullText

This is a alternative way:

=== TABLE ===

CREATE TABLE `pages` (
`id` int(11) NOT NULL auto_increment,
`url` varchar(100) NOT NULL default '',
`text` mediumtext NOT NULL,
PRIMARY KEY (`id`),
FULLTEXT KEY `text` (`text`)
) TYPE=MyISAM;

=== INDEX HTML FILE ====

$cText = strip_tags( file_get_contents($cURL) );

mysql_query("INSERT INTO pages ( url, text ) VALUES ( '". $cUrl ."', '". $cText ."')

=== QUERY ===

mysql_query( "SELECT url, SUBSTRING( TRIM( text ), 1, 200 ) as abstract FROM pages WHERE MATCH(text) AGAINST ('" . $cQuery . "')" );


This is a very easy FullText of HTML file with PHP.

Previous Message | Next Message


Comments:
Ä«/µå/µ¹·Á¸·±â·Î/¸Á°¡Áö½ÅºÐ/²À º¸¼¼¿ä!ÀÌÇýÁø12/05/04 00:00
Ä«,µå,¿¬,ü,ÀÚ/¿¹.Á¤.ÀÚ ´ë,Ãâ 100-1000¸¸¿øÀÌ´ÙÇö12/03/04 00:16
½Å.¿ë.ºÒ.·®/Ä«.µå.¿¬.ü/´ë.Ãâ/È¥ÀÚ/ÇØ.°áÇÏ´Â/¹æ.¹ý±èÇö¼­12/02/04 20:22
´ë'Ãâ'°Å'Àý'½Ã'100%µÇ'°Ô'ÇÏ'´Â'¹æ'¹ýÇѰæ¿í11/29/04 11:58
½Å.¿ë.ºÒ.·®.ÀÚ/´çÀÏ500/´ë.Ãâ.ºñ.¹ýÀÌÈñÁø11/21/04 20:40
½Å.¿ëºÒ.·®ÀÚ°¡ ¾Ë¾Æ¾ßÇÒ Á¤.º¸ ´ë.°ø.°³ ÀÌ´ÙÁø11/20/04 07:13
½Å.¿ë.ºÒ.·®.ÀÚ/´çÀÏ500/´ë.Ãâ.ºñ.¹ýÀÌÈñÁø11/20/04 05:54
We already haveAndrew Rodland03/23/04 15:23
RE: More easy with MySQL FullTextArmand Turpel02/26/04 03:39
More easy with MySQL FullTextPablo Almunia02/23/04 19:31
Keytable with fixed rows lengthArmand Turpel02/18/04 04:40
 

If you are looking for help, please post on the appropriate forum here. Your questions will be answered much more quickly.

Add A Comment:

Name:

Email:

Subject:

Message:

To reduce spam posts, messages are now manually approved

You are not [logged in]. That means your account will not get credit for this post.