Antler

Search
Skip to content

Monthly Archives: July 2014

Elasticsearch, Missing Handbook, PHP, Programming

Descending sort of Elasticsearch results with PHP API

2014/07/18 Rudolf Vavruch 1 Comment

Using the Elasticsearch PHP API to do an ascending sort is simple:

$params['sort'] = array('updated_at');

However I found performing a descending sort much less intuitive. Eventually I figured out it should be:

$params['sort'] = array('updated_at:desc');
elasticsearchphp

Everything is as it should be

Recent Posts

  • Setup an HTTPS custom domain for Intercom Educate with LetsEncrypt & Nginx
  • Installing Vagrant VirtualBox Guest Additions plugin on Linux Mint Debian Edition
  • How to install and package Frei0r plugins using FPM
  • Postgresql Datatype mismatch default for column cannot be cast to type integer
  • Install Debian wheezy-backports repository

Recent Comments

  • Savage Randy on SQL – Find the last DISTINCT items
  • Romain B on Install Node.js & NPM on Debian Stable (Wheezy / 7)
  • Alex Traikov on Descending sort of Elasticsearch results with PHP API
  • sumant on Install Node.js & NPM on Debian Stable (Wheezy / 7)
  • CokoTracy Mirindi on Install Node.js & NPM on Debian Stable (Wheezy / 7)

Archives

  • March 2018
  • May 2015
  • January 2015
  • October 2014
  • September 2014
  • July 2014
  • June 2014
  • April 2014
  • November 2013
  • October 2013
  • November 2009
  • July 2009
  • May 2009
  • April 2009
  • October 2008
  • May 2007

Categories

  • ActionScript
  • Android
  • Bash
  • Database
  • Elasticsearch
  • Events
  • Linux
  • Missing Handbook
  • Nginx
  • Node.js
  • Packages
  • PHP
  • Postgresql
  • Programming
  • Security
  • SQL
  • Vagrant
  • Web Development

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
Proudly powered by WordPress