Monday, March 28, 2011

Partly Cloudy - Node.js and the IFS

With Node.js surfing the hype wave, we have received some requests from our clients on how to use Node.js to poll the IFS web services.

This is actually a good idea ... let me add another buzz word to explain why: SEO.

In the following scenario we'll make Node.js call the casa.keru search service from the Tredix IFS and serve the results as HTML to the browser. The result will be a static web page listing some properties for sale.

It is very important to understand the difference between a static and a dynamic web page. In most of our other examples (including the casa.keru.pt web application itself), we are calling the IFS web services from within the browser. This technology is commonly known as AJAX; the DOM is manipulated on the fly. AJAX is really cool and fun to use, because all the magic happens dynamically within your page without any page reloads. However, in SEO terms, AJAX is not helpful at all. When the Google bot stops by, it can only index the static content of our page (which is usually not much more than a HTML wrapper) - but not the dynamically generated content. However, this is where the beef is.

So the good old fashioned static web page can still be desirable, especially in terms of SEO. With Node.js, there's no need to write a server side program in yet another language such as PHP, Python, Ruby or ASP.NET/C#. Instead, JavaScript developers can use their client-side JavaScript skills to let rip on the server.

Plus: It's incredibly simple! Check out the basic example below which sets up a web server on 127.0.0.1:8124, calls the IFS search service, and delivers a static list of properties to the browser. Each time you hit refresh, you'll skip to the next page of property listings. The code is pretty self-explanatory and should allow for an instant start - enjoy!

// tested on Node.js 0.4.x

var http=require('http');

var GroupID='PT-08_ABF_01'; // Freguesia Albufeira
var counter=0, html="";

http.createServer(function (req, nodeResponse) {

  // Ignore browser requests for Favicon
  // console.log(req.url);
  if (req.url=="/favicon.ico") return false;

  counter++;
  var options = {
    host: 'arrakis.tredix.com',
    method: 'GET',
    port: 59180,
    path: '/apache-tomcat/Tredix/ISS?Context=Tredix/IFS/ImmoPT/ProtoTyp2/Search&ContentType=json'+
    '&BusinessType=SALE' +
    // '&PropertyType=' +
    '&MinPrice=0' +
    '&MaxPrice=0' +
    '&NumberOfBedrooms=' +
    '&Language=PT' +
    '&IncludeObjectsWithPriceOnApplication=true' +
    '&IncludeBoundaries=false' +
    '&IncludeMisses=false' +
    '&Currency=EUR' +
    // '&Tags=' +
    '&ListNumberOfPage=' + counter +
    '&ListItemsPerPage=5' +
    '&GroupID='+GroupID +
    '&SortBy=PriceASC' +
    '&ResponseDetails=List',
    headers: {
      "User-Agent": "Tredix CaKe Client"
    }
  };

  var ifsRequest = http.request(options, function(ifsResponse) {

    var responseBody = "";
    ifsResponse.setEncoding("utf8");

    // echo some IFS response details
    console.log('STATUS: ' + ifsResponse.statusCode);
    console.log('HEADERS: ' + JSON.stringify(ifsResponse.headers));
    console.log('counter: ' + counter);
    console.log('################');

    ifsResponse.on("data", function(chunk) {
      responseBody += chunk;
    });

    ifsResponse.on("end", function() {
      // build static HTML for the client
      html="<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01//EN' 'http://www.w3.org/TR/html4/strict.dtd'>";
      html+="<html><head><title>"+GroupID+"</title></head><body><table>";
      var hits = JSON.parse(responseBody),
      results = hits.SearchResult.ListHits,
      length = results.length;
      for (var i = 0; i <= (length-1); i++) {
        html+="<tr><td><b>"+results[i].Title + "</b></td><td><b>"+ results[i].Price+"</b></td></tr>";
        html+="<tr><td colspan='2'>"+results[i].Description + "</td></tr>";
      }
      html+="</table></body></html>";

      nodeResponse.writeHead(200, {
        'Content-Type': 'text/html; charset=UTF-8'
      });
      nodeResponse.end(html);

    });
  });

  ifsRequest.end();

}).listen(8124, "127.0.0.1");

console.log('Node server running at http://127.0.0.1:8124/');

Friday, March 11, 2011

What's that bird?

We proudly present Keru's new testemonial: a Peregrine Falcon!

Since our maps based sites use the bird's eye view for primary navigation, the choice of a bird was rather obvious. But why didn't we go for a funny parrot, a peaceful dove, a Portuguese stork, or some odd duck?

The Peregrine is renowned for its speed, reaching speeds of up to 290 to 390 km/h (180 to 240 mph), making it the fastest extant member of the animal kingdom. With a vision five times more powerful the human eye's, falcons spot their targets quicker than most other birds.

We liked these analogies to the speed of casa.keru and a growing number of other maps-based applications. Under the hood, instantaneous search, clustering and navigation are provided by the Tredix IFS.

Thanks again to our designer friend Rabea of La Bam for providing both a great concept and perfect realisation of Keru's new CI. Well done, right on time for the upcoming IMOBITUR real estate trade show in Porto.

PS: Our agency did tell us that we are not the first to use the Peregrine metaphor for speed ... ever heard of the Suzuki Hayabusa (or GSX1300R)?

Monday, March 7, 2011

casa.keru adds 50.000 properties around Porto

Just a quick note that, as of today, casa.keru is also covering the greater Metropolitan Area of Porto (Oporto). Right from the start, there are more 50.000 listings available in the district of Porto alone.

Located along the Douro river estuary in northern Portugal, Porto is one of the oldest European centres, and registered as a World Heritage Site by UNESCO in 1996. The area is very popular with travellers and home seekers alike.

In total, casa.keru is now promoting more than 100.000 properties for sale and rent in Portugal. Currently, the website is focussing on the two largest Portuguese cities - Lisbon and Porto - and the popular Algarve region. Full coverage of Continental Portugal is being scheduled for Q2/11.

Tuesday, March 1, 2011

casa.keru now covering the Lisbon Metropolitan Area

We are proud to announce the immediate availability of casa.keru in the Lisbon area.

Since it's launch less than ten weeks ago, casa.keru covered the Algarve exclusively. Meanwhile, there are more than 25.000 offers available in the district of Faro. 

As of today, casa.keru is presenting another 25.000 properties in and around the Portuguese capital. Within Portugal, the district of Lisbon has got by far the most agile real estate market. For the initial Lisbon data set, we have been working with almost a hundred real estate agents.

The doubling of the number of offers (50K+ in total) immediately reflects in casa.keru's local mirror sites (Spain, UK, Germany).

It is our declared objective to cover all areas of continental Portugal by Q2/11.

Saturday, February 19, 2011

Tredix IFS - Information retrieval done right

The Tredix Internet Find Store (IFS) is a custom framework developed for just one purpose: Search. Or to be more specific: Find.

IFS results are all about quality, relevance, and speed. Let's take a closer look at some of the IFS search services:


Full text search - The royal league of search

So the user enters some free text - but what does it mean? The IFS knows, because it understands linguistics: Language form, language meaning, and language in context. It works multi-lingual with language-specific stemming, lemmatisation, stop words, and normalisation. Distributed words as well as phrases are recognized and contribute to the quality rank. Synonyms and decomposed compounds provide additional hits. In case of literal errors, the IFS suggests language-independent phonetic similarities aka "Did You Means". Custom filters allow for flexible result manipulation.

If this is technobabble to you, here's a real world example of the IFS result quality. We recently built a demo for German fancy foods distributor "Bos Food". They have tens of thousands of special delicacies on stock. Since the goods originate from all seven continents, of course the product names are mostly foreign-language - and sometimes even made-up. French and spanish names might still sound familiar to the mainly German Bos customers, but what about those African or ethno food names? Clients simply couldn't spell the products, so Bos' classic SQL-based search failed continuously. People couldn't find the products and Bos lost massive business on his web shop.

When we replaced their SQL with the Tredix IFS (which by the way never got rolled out on their web site), search worked perfectly: Salsa Fumy would find Sansai Fumi, general queries like poultry or pastry would deliver both duck and chicken or cookie and pie; fishing would also find fish; and a solid German compound like Holzboot would even find Schiffchen aus Holz. Finally, just for the records, users of keyboards without diacritics would still be able to find Öl or Rougié, of course.

Selling is all about finding in the first place, isn't it?


Suggestions - Instant dynamic feedback

Unlike with a full text search box where you have to type a full search term and hit return, results in a suggest box will appear instantly as you type, helping you see where you're headed, every step of the way. The IFS Suggester supports pretty much all the search logic like its full text sibling, however quality and weight of the suggestions need to be calculated in a more "predictive" way. Since suggestions appear while you still type, we prefer to call them predictions as they actually help guide your search. So result ranking is vitally important.

Now apart from the different levels of match quality, usually popularity makes one of the most important ranking factors. However, under certain circumstances popularity can be misleading. Think about our casa.keru map application where you can jump to a geographic location by entering a location's name into a suggest box. In Portugal, many towns have the same name; for example, there are more than a dozen places called "Luz" all over the country. Imagine you are currently navigating around Faro on the southern coast of Portugal and want to zoom into the Luz area in the Eastern Algarve. If the IFS Suggester would simply rank the most popular (most searched for) city of Luz best, you would be taken to the city of Luz north of Lisbon.

Fortunately, the IFS framework exposes plugin interfaces to further customize each service. Since we are not searching for the best text match but the best location match, we added geographic distance calculation to the ranking algorithm in casa.keru. You guessed it: The IFS would now suggest to take you to the city of Luz in the Faro neighbourhood, which is usually the desired effect for people hunting for homes on casa.keru. This is a good example on how to transform a simple text suggestion into a smart location prediction.


Geologic - More intelligence for maps

Talking about location, the IFS provides native search on maps, too. The IFS Geofinder usually returns a set of coordinates for a given filter set and map section. In this context, result representation poses the biggest challenge. Geo point density must be adjusted in relationship to the map dimensions and zoom level. So the IFS Geofinder combines stacked coordinate pairs into clusters where necessary. This way, a perfect representation on the map is always guaranteed. For more non-technical information on the advantages of clustering, please see my post "Clustering is key to map application success".

On top, the IFS Geofinder also provides all the necessary geopolygon logic to identify area relationships, distances, proportions etc. on the server-side. Geo points can be allocated within areas like city limits or administrative divisions. Apart from providing the parent subnational entities like parish, district, etc. for any given coordinate, geopolygon logic is also extremely useful for tagging the Geo points. If, for example, you got a polygon of a nature reserve or a polyline of the coastline, the coordinate could automatically get tagged with "Ria Formosa" and "beach-front". Tags are supported in any IFS search service.


Today we have learned about some key features of the IFS search services. But how about reusability, integration, scalability, and customization of these services? I'll talk about the design of the IFS framework in one of my next posts. So keep following - further blog updates are on their way.

Wednesday, February 16, 2011

Improxy and Keru sign partnership agreement

Porto, Feb. 14, 2011:  Improxy, Lda (Vila Nova de Gaia, Portugal) and Tredix Keru, Lda (Arroteia, Portugal) have signed a partnership agreement which will allow all real estate companies using Improxy's Gimob.net solutions to export their properties into the Keru portals. Besides feeding casa.keru.pt, Improxy will be the charter data supplier for arrenda.keru.pt, Keru's upcoming portal for long-term rentals in Portugal. Additionally, Gimob.net will provide deep links into Keru's map applications.

About Improxy

Improxy is a software house founded in 1998 with headquarters in Portugal. The company focuses on software and Internet solutions for the real estate business. Considered a main player in the Portuguese market, Improxy is now also serving countries like Brazil, Angola and Mexico. 

Improxy - Tecnologias de Informação, Lda
Paulo Alexandre
Tel.: +351 223 749100
EMail: palexandre@improxy.pt


About Tredix Keru

Tredix Keru, founded in 2011, is privately owned by Tredix GmbH and Mr. Felix Schormann. The company specializes in maps based consumer portals, utilizing innovative search technologies provided by Tredix GmbH, Germany.

Tredix Keru, Lda
Felix Schormann
Tel.: +351 289 798041
EMail: felix@tredix.com

Five pretty cool features in casa.keru

Have you already discovered these usability features?

1. Even in list view, the map is alive - move around just like in the big map:




2. Navigate faster with the Drag & Zoom feature - just click the magnifying glass icon:




3. Narrow your result set by setting tags - just click the Tags button:




4. Some statistics will help you learn about the area - just click the number of properties:




5. Use your browser's history to navigate back - it works for areas and property listings:




... and now try for yourself at casa.keru.pt !