 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
php|architect: Full-text Search with SQLite
by Chris Cornutt November 15, 2011 @ 09:53:50
On the php|architect site there's a recent tutorial from Jeremy Kendall about full-text searching in SQLite, a lightweight database alternative that, since it's stored locally, can be used without a full database server.
Full-text search with SQLite is so ridiculously easy to implement, there are only two valid reasons you haven't done it yet. The first is you don't need the full-text capability, and the second is you didn't know it could be done.
In his method he creates a full-text search table (using fts4) and populating it with your data. You can use the "MATCH" keyword in your SQL to find the closest matches and even handy modifiers like "NEARBY", wildcards and token/prefixes in queries. For more detailed information, check out the SQLite documentation for a full guide.
voice your opinion now!
fulltext sqlite search fts4 table
Content with Style: Fulltext searches with Xapian and PHP
by Chris Cornutt November 04, 2009 @ 08:19:13
New on the Content with Style blog today there's this tutorial looking at full-text searching combining Xapian and PHP to replace the slower full-text methods in something like a MySQL database.
Sometimes MySQL just isn't quick enough. Especially when it comes to fulltext searches. Everything needs to be indexed correctly, and if we're using different fields with different weights for a relevance percentage, things get very complicated quickly. Xapian to the rescue.
The Xapian library can be compiled and installed as a binding for your PHP installation. He includes some sample scripts to get you started - the SQL to build the table, a Xapian wrapper class, and three simple PHP scripts to search for, view and delete records. Some sample results are also included.
voice your opinion now!
fulltext search xapian mysql database tutorial
PHPFreaks.com: Simple SQL Search
by Chris Cornutt May 08, 2009 @ 09:30:06
In a new article on PHPFreaks.com Brad Jacobs takes a look at creating a simple search of the information in your database. Their example will search a table containing article information (title, story content, etc).
The aim of this tutorial is to provide users with a basic layout and the logic behind creating a multiple field search in MySQL. As often time users tend to over do the search and add a lot of unnecessary code. By following and understanding this tutorial you should be able to implement this search into your own site and provide a nice and simple SQL Search of your own database. So roll up your sleeves and be prepared to get dirty.
Everything's provided for you - the SQL to build and fill the tables and the code to perform the search. They opted to go with LIKE statements in the where clause instead of using something like full-text searching. The former works for a lot of situations, but can get slower and slower the more rows there are in the table.
voice your opinion now!
simple tutorial sql search mysql fulltext article content title
Markus Wolff's Blog: Fulltext search as a webservice
by Chris Cornutt May 07, 2008 @ 12:57:47
In a recent blog entry about a fulltext searching solution, Markus Wolff hacked together in a few hours with Zend_Search_Lucene:
While working at some really old code that provided a fulltext search feature, I was at one point incredibly pissed rather unsatisfied due to the fact that said code resisted all attempts to debug it. This lead to the decision to sit down on a rainy weekend to try if I couldn't come up with something more useful, and most importantly, scalable.
His method allowed for separation between the indexing and the main app and how he changes some of his methods when he learned that Solr did something very similar. He also lays out some example XML content and how it's handled in his script (via a SimpleXML object).
voice your opinion now!
fulltext search xml document zendsearchlucene zendframework solr
Developer.com: Creating a Code Search Engine with PHP and MySQL
by Chris Cornutt April 12, 2007 @ 09:30:00
Developer.com has posted a new tutorial by Jason Gilmore about the creation of a simple search engine based around a MySQL database and using PHP to perform the queries.
In this article I'll offer a simplified version of this search engine, introducing you to some compelling PHP and MySQL features along the way. You might adopt what you learn towards building your own search engine, or towards other applications.
He starts with the base of the application - the database schema (including loading data into it) - and works up from there. He opts to go with the fulltext search type as it can provide a huge performance boost over just using something like LIKE statements in your query. He also includes a bit of HTML for help make the output easier to use.
voice your opinion now!
searchengine mysql fulltext html schema searchengine mysql fulltext html schema
roScripts.com: PHP search engine
by Chris Cornutt March 30, 2007 @ 09:55:00
The roScripts website has a new tutorial that anyone just starting out to create a search engine with PHP and MySQL should get their hands...er eyes on. It steps through the creation of a simple PHP-based search engine, showing multiple methods to achieve the goal.
The right search engine on your website won't bring you more traffic but it will help your visitors to better locate things so it will keep them on your pages. A good search engine implemented can increase your hits with almost 30% and this is tested. I'm not talking just to have a tutorial.
The different methods the show how to implement include:
- using a straight LIKE on each word entered
- paring down those results using ORs on other columns too
- implementing the Porter Stemmer algorithm
- finding matches that contain the term but not only one part of it
- Full-text searches
It's a good overview of some of the basic steps to getting your own search up and running, but some of them, when applied to sites with larger amounts of data behind them, wouldn't be useful at all (slowness mainly).
voice your opinion now!
searchengine like fulltext match porterstemmer searchengine like fulltext match porterstemmer
Wolfgang Drews' Blog: Some thoughts on indexes & searching in MySQL / PHP
by Chris Cornutt June 05, 2006 @ 06:03:05
Giving your users a tool to find relevant invormation from the vast ocean that is the content of your site isn't easy sometimes. Even with the powerful combination of PHP and MySQL, it can be difficult to find what you're looking for. Wolfgang Drews shares in some of this frustration in his new blog post.
Using MySQL most of you will be familiar with this: searching in textfields for keywords is quite uncomfortable when using other table handler then MyISAM. If you use MyISAM, you can utilise the Fulltext-Search with MATCH … AGAINST. Otherwise you are thrown back to "simple" string comparison functions (LIKE). Not really satisfying. As this won't change with the 5.1er Version of MySQL, i have to search for another solution.
His other suggestions include the use of two other tables (terms in one, references back to content in another) or an external search option, such as the Zend Framework's implementation of the lucene functionality - Zend_Search.
voice your opinion now!
search mysql fulltext like lucene zend framework search mysql fulltext like lucene zend framework
|
Community Events
Don't see your event here? Let us know!
|