Please add support for additional filters such as

  • SQL 'Like'
  • greater than
  • less than
  • Use case: I want to get anyone who has been on a grant that starts with VIVO. In SQL I would say:

    select person from person,grant where person in grant and grant.name like 'VIVO%'

    Comments

    Anonymous’s picture

    Title: Support for additional Filter Criteria » Support for additional Filter Criteria for strings

    This will definitely be a helpful addition.

    scor posted a patch for greater than and less than in #1145250: Add more numeric operators such as less/greater than which I still need to review and commit.

    For the LIKE functionality, we can use SPARQL's regex function. I would see the options being something like the following, which are from views_handler_filter_string:

    • Contains
    • Does not contain
    • Starts with
    • Does not start with
    • Ends with
    • Does not end with

    Can anyone think of any other options that should be available for this?

    scor’s picture

    check out views_handler_filter_string for an exhaustive list. missing are:
    'Contains any word'
    'Contains all words'
    'Length is shorter than'
    'Length is longer than'

    Anonymous’s picture

    I left those 4 out because I don't see them being that useful, but if others think that they are useful I can include them.

    bryanhirsch’s picture

    @linclard thanks for all your work on this!

    All these operators would definitely be useful.

    More important, for my own use case right now, is the operator "Is not equal to". Can I add this to the list?

    Specifically, the filter I'm looking to add is: "Is not equal to" [blank].

    I have an exposed filter for record ID numbers. I want users to be able to look up records by ID number. But I do not want users to see an unfiltered list of all records and random IDs all at once. The way I plan to do this with Views is to include the following two filters:

    Filter 1:
    ID number "is not equal to" [blank]

    Filter 2 (exposed:
    ID number "is equal to" [string]

    Anonymous’s picture

    Title: Support for additional Filter Criteria for strings » [META] Support for additional Filter Criteria for strings