Advo wrote:
>
i need to write a php search function which will search all
our pages in the directory depending on user keywords..
Er, no. You need to write a search engine, with actual search being
the easy part.
A search engine consists of three subsystems:
1. The crawler (aka the search bot) indexes the site (goes to the home
page, records its contents into a storage facility, usually in both the
original form and plain text, follows every link it can find and
records all the pages it can reach). Usually, the crawler is written
in a compiled language; often, it is implemented as a daemon (on Unix)
or a service (on Windows), so it works continuously.
2. The storage facility can be a database or a flat-file archive with a
full-text search utility.
3. The front end (what the uninitiated mistake for the search engine)
takes search queries from users and searches the storage facility based
on the search queries.
It is considered a good practice to deploy the search engine on a
separate physical machine optimized for this line of work. Google
actually makes those. Google Mini in its most basic version supports
up to 50,000 documents and costs $1,995:
http://www.google.com/enterprise/mini/
the thing is, this could be difficult as we may have
8000+ dynamic pages (these would also need
searching) plus we will be adding more and more
of these dynamic pages (so wont have a list of
page names).
Any ideas please?
Buy a Google Mini; it's probably going to be less of a headache than
developing your own search engine. Alternatively, try mnoGoSearch or
phpDig (they are free, but you will still need dedicated hardware):
http://www.mnogosearch.org/ http://www.phpdig.net/
Cheers,
NC