libgraviton / rql-parser

PHP RQL parser
31 stars 15 forks source link

Glob in eq() search #1

Closed hairmare closed 8 years ago

hairmare commented 9 years ago

I'm seeing unexpected globs in FIQL based eq() searches. I'm testing with rql rql:parser 'name=eq=*'

query
└─ query
   └─ eq
      ├─ name
      └─ //i

I was expecting the following result.

query
└─ query
   └─ eq
      ├─ name
      └─ "*"

Is this a case of me expecting the wrong thing or actually a parser bug?

The same thing also seems to happen with rql rql:parser 'name=*'. I might make sense to expect the following result in this case.

query
└─ query
   └─ like
      ├─ name
      └─ //i

edit: This is not related to FIQL as rql rql:parser 'eq(name,*)' does the same thing...

dontub commented 8 years ago

Actually I'm wondering why there is an extra Glob class. Why not just keep the string? The possibility to convert a glob to a regex could be provided in a utility class for those who need it.