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!

4
  • a db will always be more efficient than a flat file
    – user557846
    Jul 25, 2011 at 9:14
  • Define "large". What is the size of the database you are looking at?
    – Sukumar
    Jul 25, 2011 at 9: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, 2011 at 9: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. Jul 27, 2011 at 14:11

3 Answers 3

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

2
  • +1 - for anything other than trivial examples, Lucene is the way to go. Jul 25, 2011 at 9:32
  • Thanks, definitely I will check this out. Jul 27, 2011 at 14:06
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.

2
  • 1
    It's not built in, it's a pecl extension.
    – gnud
    Jul 25, 2011 at 9:50
  • Thanks, I will looked into it, and hopped that it supports to search for thousands of words in a text at ones. Jul 27, 2011 at 14:06
0

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

1
  • 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. Jul 27, 2011 at 14:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.