Treat uints the same as ints
ClosedPublic

Authored by astippich on Nov 11 2018, 6:26 PM.

Details

Summary

When data is fed into Baloo, integer variables
will be added to the Document, while uints
will fall through to the standard path used
for strings, and consequently will be added
to the TermGenerator. Treat uints like
integers.

Diff Detail

Repository
R293 Baloo
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
astippich created this revision.Nov 11 2018, 6:26 PM
Restricted Application added projects: Frameworks, Baloo. · View Herald TranscriptNov 11 2018, 6:26 PM
Restricted Application added subscribers: Baloo, kde-frameworks-devel. · View Herald Transcript
astippich requested review of this revision.Nov 11 2018, 6:26 PM

Disclaimer: this is really just from looking at the code without knowing much about the internals of Baloo.
While KFileMetaData is currently not using uints anywhere, doubles are definitely there.

@bruns do you consider this useful or shall I abandon?

ngraham added a subscriber: ngraham.

Makes sense to me, but let's let @bruns have the final say.

bruns added a comment.Dec 1 2018, 5:26 PM

I think support for non-integers is useful in general, but there are a few things we should consider:

Currently, only integral numbers can be searched. For floats, we definitely want Less/Greater matches to work, exact matches for floats are not very useful.

As you are referring to the TermGenerator, I suppose the (float) variant gets converted to something like "-5.73", which is mangled by the TermGenerator to something like "X42-5.73", i.e. dropping the sign? (See D17284)

Ideally, this were backed by some unit tests. The comparision test can be added to the postingdbtest, but AFAICS there are currently no tests covering Baloo::Result

Okay, so there is more work to do for floats. What about then reducing this patch to uints for now, and doubles are added when everything else is in place?
I have something in the pipeline for the Result class, which I added for figuring out how string lists are handled, I can probably post that tomorrow. I could then extend the test for floats

bruns added a comment.Dec 1 2018, 5:44 PM

Yes, UInt should be fine (actually, all our current integral numeric properties are unsigned).

astippich updated this revision to Diff 46679.Dec 2 2018, 10:57 AM
  • only add uints for now
astippich retitled this revision from Treat uints and doubles the same as integers to Treat uints the same as ints.Dec 2 2018, 10:58 AM
astippich edited the summary of this revision. (Show Details)
bruns accepted this revision.Dec 2 2018, 1:09 PM
This revision is now accepted and ready to land.Dec 2 2018, 1:09 PM
This revision was automatically updated to reflect the committed changes.