3

Currently I am trying to perform text searches against large dictionaries using php or mysql. Until now I haven't found the best way to do that. For example there is a Text:Scan module written in Perl

http://search.cpan.org/~iwoodhead/Text-Scan-0.28/Scan.pm

which is exactly what I need for php. If you are aware of some way to do that in php please share this knowledge with me! :)

Thanks for Your help!

Nikola Obreshkov
  • 1,698
  • 4
  • 21
  • 32
  • a db will always be more efficient than a flat file –  Jul 25 '11 at 09:14
  • Define "large". What is the size of the database you are looking at? – Sukumar Jul 25 '11 at 09:41
  • Do you need to search a string in PHP *or* do you need to perform the search at the database level? – hakre Jul 25 '11 at 09:45
  • large means thousands of words, and the size of the corpus will be 10 - 20 pages of plain text or in a db text field. So, it makes no difference for me whether I will search a string or perform db queries. Whatever it takes just I want to work. – Nikola Obreshkov Jul 27 '11 at 14:11

3 Answers3

3

As far as I understood, what you may need is something like Zend_Search_Lucene. You will get more information from http://framework.zend.com/manual/en/zend.search.lucene.overview.html

Shameer
  • 3,036
  • 1
  • 21
  • 27
1

Have a look at Sphinx.

We are using it in one of our projects and it's serving well.

Moreover PHP has PECL extension for it.

Jatin Dhoot
  • 4,294
  • 9
  • 39
  • 59
0

MySQL has in-built support for full-text indexing and search: here. This might be what you are looking for

T9b
  • 3,312
  • 5
  • 31
  • 50
  • Yes, but this feature search one word at a time. You can add more with the OR connector but this is a very limited. What I want is to be able to search for thousands of words in a text at ones. – Nikola Obreshkov Jul 27 '11 at 14:05