Discussion:
Attribute syntax and search filters
Michael
2015-10-29 19:57:06 UTC
Permalink
I originally had a request from developers to allow substr searches on the "drawId" integer attribute you see below. As you know, substr searches on integers are not supported so I changed the schema and modified the attribute type to a numeric string. This worked as expected but now they are coming back to me asking why negative numbers are not being matched in their search filters. After some reading I understand the numeric string syntax is used to hold strings comprised of one or more ASCII numeric digits digits and/or space characters. The hyphen is not allowed, so it is not possible to represent negative values. Is there any alternative here?


Original schema entry
attributetype ( 3.0.0.3 NAME 'drawId' DESC 'ID of the retailer a user is assigned to' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )

Current schema entry.
attributetype ( 3.0.0.3 NAME 'drawId' DESC 'ID of the retailer a user is assigned to' EQUALITY numericStringMatch SUBSTR numericStringSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.36 SINGLE-VALUE )
Michael Ströder
2015-10-30 08:34:49 UTC
Permalink
Michael wrote:
> I originally had a request from developers to allow substr searches on the
> "drawId" integer attribute you see below. As you know, substr searches on
> integers are not supported so I changed the schema and modified the
> attribute type to a numeric string. This worked as expected but now they
> are coming back to me asking why negative numbers are not being matched in
> their search filters. After some reading I understand the numeric string
> syntax is used to hold strings comprised of one or more ASCII numeric
> digits digits and/or space characters. The hyphen is not allowed, so it is
> not possible to represent negative values. Is there any alternative here?

Your analysis is correct and the developers have to choose the syntax based on
the matching they need. They cannot have everything at once.

Also SUBSTR matching for Integers are most times a nasty work-around for
interval checking. So they rather might need an ORDERING matching rule.

Ciao, Michael.
Michael
2015-10-31 02:36:34 UTC
Permalink
Thanks for the feedback Michael.

> Subject: Re: Attribute syntax and search filters
> To: ***@hotmail.com; openldap-***@openldap.org
> From: ***@stroeder.com
> Date: Fri, 30 Oct 2015 09:34:49 +0100
>
> Michael wrote:
> > I originally had a request from developers to allow substr searches on the
> > "drawId" integer attribute you see below. As you know, substr searches on
> > integers are not supported so I changed the schema and modified the
> > attribute type to a numeric string. This worked as expected but now they
> > are coming back to me asking why negative numbers are not being matched in
> > their search filters. After some reading I understand the numeric string
> > syntax is used to hold strings comprised of one or more ASCII numeric
> > digits digits and/or space characters. The hyphen is not allowed, so it is
> > not possible to represent negative values. Is there any alternative here?
>
> Your analysis is correct and the developers have to choose the syntax based on
> the matching they need. They cannot have everything at once.
>
> Also SUBSTR matching for Integers are most times a nasty work-around for
> interval checking. So they rather might need an ORDERING matching rule.
>
> Ciao, Michael.
>
>
Loading...