search

Drupal 8: Creating A Views Results Area Plugin

Drupal Views is a great way of exposing data to users via a search interface. This can be done directly via the database or via a Solr server. Plenty of Views plugins exist to allow reacting to the search input and outputĀ in a variety of different ways.

The other day I needed to add a personalised message to Views output to inform a user that their search keyword didn't find any results. There is a plugin for Views that allows this, but it only shows a basic search string.

philipnorton42 Mon, 03/23/2020 - 21:37
How To Change No Search Results Text In Drupal 6

Every Drupal project I finish will usually have the same request at some point. This usually happens when the client tries to do a search that produces no results and sees the search hinting text about blue smurfs.

philipnorton42 Thu, 02/02/2012 - 11:49
Case Insensitive Like Searches In MySQL

I needed to create a query that did a case insensitive search using the LIKE command in MySQL and I quickly realised that in order to do this I would need to alter both the parameter and the table data to be the same case. This can be done by using the MySQL UPPER() command on the table data and the strtoupper() PHP function on the input data.

philipnorton42 Sat, 07/02/2011 - 18:59
Filtering Node Types In Drupal 6 Search

A common practice when creating sites in Drupal is to create different node types for different purposes. Sometimes these node types can be functionality based rather than content based and are used for creating a rotating banner or something similar. A side effect of this is that you will then see these nodes appearing in search results, which can cause some confusing results to be displayed.

philipnorton42 Mon, 01/31/2011 - 09:06

Related Items Block Using Drupal 6 Search

23rd May 2010

A related items block looks at the current content of the page and tries to present the user with a list of items that relate to the current content. Creating a related items block is quite easy, and is a good way of introducing the search module api without having to get to involved in the search module.

Getting Started With Zend_Lucene

20th February 2009

Zend_Lucene is an implementation of the Lucene search engine in PHP5 and is included as part of the Zend Framework from version 1.6. Lucene implements all of the standard search engine query syntaxes (eg. boolean and wildcard searches) and stores its index as files so it doesn't need a database server to run. Lucene can be used if you want to add search functionality to a site but don't want to go down the route of building a querying syntax from scratch.

Search Engine Spider Detection With PHP

29th September 2008

Part of any search engine optimisation strategy should always be that the user and the search engine see the same thing. If you start delivering different content you will either end up not performing or just getting outright banned. However, there are certain circumstances where you will want to detect the presence of a search engine spider. For example, lets say that you had a link to a section of your site, and you wanted to add a counter to it that registered an action every time a user clicked on the link.

Enable Custom Field Searching With Wordpress 2.6

I have previously talked about enable custom field search in Wordpress, but that involved altering the main Wordpress files, which is a big no-no.

So is there an alternative? Well, yes, otherwise I wouldn't have bothered writing the post! To enable custom field (also called Wordpress metadata) searching you need to set up two things.

First you need to have created a custom field (or two) and added this to a number of posts.

philipnorton42 Fri, 09/05/2008 - 12:52