how to search the whole yii webapp? - php

I have a webapp build with Yii framework, I want to add a search box to make a search overall the website including the dynamic pages (data from database) and the static pages (data in the file itself).
When I searched for some extensions, I found Zend Lucene, but I didn't like its mechanism, so do you suggest any other extensions that can do such search methods? in case that there is no extension better than Lucene, could you give some tutorials and examples?

My suggestion is to use Solr. You then use the Solr's Data Importer Handler to import your data into a Solr/Lucene index. From your PHP code, you can use Solarium. It is a nice PHP client to communicate with Solr. I always do that for my work.

Related

Is there a free php search engine that doesn't use MySQL?

I've found several paid options and several options with PHP/MySQL, but does anyone know a free option for implementing a site search option on my page that doesn't use a MySQL database?
If you want to programme the search functionality yourself and you're using PHP, then you could try the Lucene component that's in Zend Framework. It'll create a file-based index for you, so no MySQL, and you can use a variety of search syntax on it. The index file should also be compatible with the Java implementation of Lucene.
http://framework.zend.com/manual/en/zend.search.lucene.html
http://framework.zend.com/manual/en/learning.lucene.html

joomla integrate dynamic php pages to project

I am trying to integrate to a joomla project, a list of php pages setup that update their content from db, and give select options to the user, to navigate through this content. Select is also dynamic. All dynamic features work with url parsing.
For example, pageone.php gets some data from db and creates a list of selectable links to page2.php?data=fetcheddata. Page 2 gets url variables and performs queries to db to select the data.
How am I going to integrate this to Joomla? Should I make a module to include the basic php page, and how url parsing will then work? Should I make an i-frame wrapper? Please enlighten me..
You just described the way Joomla works. Depending on the content you want to present, there may already be an extension that does that, or at least does something close that can be modified. Without any more details it is hard to say, but what you are describing could probably be accomplished with a CCK http://extensions.joomla.org/extensions/news-production/content-construction. You could definitely do it with a combination of Chronoforms and Chrono Connectivity -
http://extensions.joomla.org/extensions/contacts-and-feedback/forms/1508
http://extensions.joomla.org/extensions/directory-a-documentation/faq/5661
If not, then you will probably need to code a component - http://docs.joomla.org/Developing_a_Model-View-Controller_Component_-_Part_1
1) iframe solution is the easiest one. But it has its limitations...
2) you can write Joomla component (not a module) that will do the job, but I'm afraid in this case you will either have to switch to Joomla URL format... unless you find some trick how to workaround that.
If your site is not very complex a simple approach is to write your application in plain php, and integrate your Joomla template to your application so your visitors can't tell any difference. Then, you will place links from your Joomla to your application and vice-versa accordingly.
However, the best approach if you are more familiar with Joomla is to develop a component. Here you can understand the difference between Joomla Components, Modules and Plugins. Please read Joomla documentation for further understanding:
http://docs.joomla.org/Extension
http://docs.joomla.org/Component

php search engines

Can anyone help me with a good list of php site search engines. I am thinking of implementing a google site search, but I would rather not pay for that and I would rather have as much control as I can over it.
Read through Roll your own Search Engine with Zend_Lucene.
The article is rather old though, so have a look at the ZF Reference Guide about Zend_Lucene too. Searching for Zend Lucene on Google should yield plenty useful results too.
Sphinx is pretty good, but it isn't written in PHP. It has got PHP libraries to interface with it though. You could also have a look at Zend_Search_Lucene from Zend Framework. Both of these make search indexes so you can do fast searches.
You can try the Zend Lucene implementation:
http://framework.zend.com/manual/en/zend.search.lucene.html
http://devzone.zend.com/article/91
You don't have to pay for Google Site Search and there's a small chance for much control means greater quality of results.
If your site is very specific you need to write you own code for search.
Sphinx is one of the best Open Source Search Engines. It has an excellent PHP API. Has very good community and forum too. PHP API for Sphinx comes embedded with the tar/zip file that you will download and with ease it can be embedded on top of your database. Has great vertical search capabilities. Its pretty simple to implement, try it out.
Here is a new PHP Search engine script, that can be implemented in any website, it is made with PHP 5.4+, MySQL, and Ajax.
https://sourceforge.net/projects/site-search-engine-php-ajax/
It crawls and indexes automatically the site pages, similar to Sphider.
It can uses PDO or MySQLi for connecting to MySQL database.

open source php search and pagination script?

i have a database full of rows of data.
i need an open source php search and pagination script.
so all i need to do is hook it up to the database, and results will be paginated. also the searching function optimized already....
Your question is so "freeform" so my answer is also. Take a look at the Zend Framework Pagintor and Search modules:
http://framework.zend.com/manual/en/zend.paginator.html
http://framework.zend.com/manual/en/zend.search.lucene.html
Paginator is very good and easy to use. Easy to integrate with somesort of caching and etc, but I have never really used search, so I cant comment on that.
Yii framework has exactly what you need. Take a look here:
http://www.yiiframework.com/doc/api/CPagination

Shortcuts for creating/modifying web forms in PHP?

I'm new to PHP and before I waste a lot of time doing things the hard way, I wanted to find out if there are shortcuts/techniques to creating PHP web forms apps. All this app will do is display web forms with data from 1 or more tables. In addition to displaying data, the user must be able to update the form and add new data to the forms. I know how to to do all this by manually writing all the PHP/HTML code. But I'm looking for anything that can save me time.
Unfortunately, I can't use any of the fancy PHP libraries such as CakePHP for this. I'm restricted to using the core PHP framework, Oracle for the database and the OCI library for Oracle access.
Given these constraints, what the easiest way to support CRUD operations in a basic PHP forms app? Are there code generators or other tools that can help?
Unfortunately, I can't use any of the fancy PHP libraries such as CakePHP for this. I'm restricted to using the core PHP framework,
Most PHP frameworks are written in PHP. So you wouldn't have to install anything to use them.
That said, forms are rather non-trivial. Treating a form as a separate component only works to some extend. Because of that, many frameworks have forms deeply integrated into them, and not as a standalone component.
You could take a peek at Zend Framework's (now known as Laminas) Form component
. It's fairly self-sufficient and feature-rich.
I build all of my forms on top of a "fillInFormValues($html, $request, $formErrors);" function. See my article at OnLamp for details and full source code.

Categories