Re[2]: [PHP] Searching in a long text
| From: | Vicente | Date: | Sat, 03 Jan 2009 10:46:21 +0000 |
| Subject: | Re[2]: [PHP] Searching in a long text | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-285395@lists.php.net to get a copy of this message | ||
Richard wrote:
> You could look into using Zend_Search_Lucene, which is part of the
> Zend framework. It's file based and so doesn't require the use of
> MySQL. Might make it slightly more portable if that's a concern. It
> will be a little more work than simply using MySQL, but it would be
> worth it I think.
well, that's more devoted to obtain a typical search engine results
in a Google style. What I need is something similar of what happens
searching inside books in Google Books:
http://books.google.com/books?hl=en&id=uaZQAAAAMAAJ&dq=pghp+advanced&q=engine&pgis=1#search_anchor
about Robert thoughts:
> I'd store each line of text in the database along with
> the page and line number for indexing. Then using full text search I'd
> retrieve appropriate lines that match the search query. Upon retrieving
> the matching lines, I'd then proceed to pull the accompanying lines by
> incrementing/decrementing the line number found and using an IN() clause
> for matching the various IDs in a single query.
I wonder if storing every line in its field can cause an enormous
table of registers. The book has 580 pages, 40 lines/page gives a
table with 23.200 registers.
Is this size a bad idea regarding resources and speed results?.
Because I will need to parse every field contents when searching the
words.
I'm asking before starting to divide and import the book.
Thanks for the help,