wiki:front_end/filter

Filter

Instead of overloading part of the screen with dozens of different widgets which usually either take up lots of space or are crammed into a specific panel so that they give a horrible user experience, acco FE will only feature one input line where users can type in their filter expressions in an easy to remember, easy to write, forgiving filter expression language.

Next to the input line there are three buttons, one for saving filter expressions, one for loading saved filter expressions and one for opening a dialog where the user can create and modify filter expressions. A quick help with a list of keywords and basic instructions should be available. Assisted input would be desirable but will not be in the scope of a first release.

Filter language (DSL)

The language consists of a set of filter keywords which all end with a colon, e.g. "category:" or "country:". Each keyword is followed by a comma separated list of search terms, e.g. "country:es,pt", category:3.5. White spaces are ignored, neither keywords nor values are case sensitive. Keywords that expect numeric values additionally accept the following comparison operators: = <,>,<=,=>. Some keywords expect a datetime expression. In these cases malformed or incomplete values will work even as long as they can be parsed. all values in one parameter will be logically OR combined except for numeric values if any of the following operators is present: <,>,<=,=> The order of the keywords does not matter

Keyword list

  • country: two letter country code
  • region: region name or code
  • city: city name or code. Accepts * and ? as wildcards
  • category: integer or floating point number and optioanally < (greater than) <=/=< (greater equal) > (lower than) =>/>= (lower equal) = (equal). If now operator is specified equal is assumed
  • longitude: see category
  • latitude: see category
  • hotelname: name of the hotel. Accepts * and ? as wildcards
  • hotelcode: will only match complete code
  • active: true, false, yes, no. yes and no are mapped to true and false
  • supplier: supplier code
  • attribute: string will match exact strings but is not case sensitive. Accepts * and ? as wildcards
  • lastchanged: expects datetime or date expressions and can be used with comparison operators

Examples

The following expressions would mean exactly the same:

country:ES,PT, category:>=3, supplier:W2M,HOB, active:true
Country: PT, ES    Category: => 3    Supplier: W2M, HOB    active:Yes

The following expression would find all accommodations in Spain that have 'Beach' in their name

hotelname:*beach* country:ES

This one would find all hotels in a rectangle defined by longitude and latitude

longitude:>-9.42979,<-5.94586 latitude:<41.99619, >36.93895

Searching for cities

The city keyword accepts both (numeric) city ids and city names. Both can even be mixed together. City names accept * and ? as wildcards.

city:16,354,873,23, M?nchen, Stuttgart, Memming*
Last modified 3 months ago Last modified on Oct 11, 2017 4:22:12 PM