[nycphp-talk] Need Help About creating search
birgunj birgunj
birgunjp0071 at yahoo.com
Thu Nov 22 00:41:43 EST 2007
Dear All,
i did not understand how to use this ? please if anybody has any simple example about search,please give me link or share with us.i am beginer so please send me material for beginer.i want to use the search in my local site? how do i use this in my local site?
Jon Baer <jonbaer at jonbaer.com> wrote:
Build an index with Zend_Search_Lucene
http://framework.zend.com/manual/en/zend.search.lucene.html
It would be *really* nice to see Zend build a direct DB full-text
relation to index scheme that makes indexing easier so you don't have
to add your documents manually. @ MySQL camp the consensus was that
if you need fine tuning on your full text search, "use Lucene" ...
- Jon
On Nov 21, 2007, at 3:21 PM, David Krings wrote:
> csnyder wrote:
>> On Nov 21, 2007 6:43 AM, David Krings wrote:
>>> You want to use something else and not make it from scratch
>>> (unless you
>>> insist).
>>>
>> If you _do_ insist, or you have some reason why third-party solutions
>> won't work, the simplest search accepts a single term and looks it up
>> using wildcards and the LIKE comparator:
>> $safe_q = mysql_real_escape_string( $_GET['q'] );
>> $query = "SELECT * FROM pages WHERE title LIKE '%{$safe_q}%' OR
>> content LIKE '%{$safe_q}%' ";
>> In many applications this pattern is sufficient for users to find
>> what
>> they need.
>> It breaks down when searching hundreds of thousands of rows, or if
>> you
>> need boolean searches (search for foo or bar) or some other sort of
>> advanced search functionality like stemming.
>
> But isn't the original request about searching pages on a site? That
> would mean adding all page content into a db table, unless some
> keyword tagging for individual pages is employed. For a search
> function like this I'd use the database maybe to store some
> statistics about the entered search terms, but not for searching the
> pages themselves.
>
> David
> _______________________________________________
> New York PHP Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
>
> NYPHPCon 2006 Presentations Online
> http://www.nyphpcon.com
>
> Show Your Participation in New York PHP
> http://www.nyphp.org/show_participation.php
_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com
Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php
---------------------------------
Be a better pen pal. Text or chat with friends inside Yahoo! Mail. See how.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20071121/c2a8e677/attachment.html>
More information about the talk
mailing list