npgall / cqengine

Ultra-fast SQL-like queries on Java collections
Apache License 2.0
1.72k stars 253 forks source link

longestPrefix type index/query #253

Closed glockhart closed 4 years ago

glockhart commented 5 years ago

Given a cache with the following records

| id | code      | Operator |
| 0  | 35387   | Vodafone |
| 1  | 35385    | Eir |
| 2  | 353855 | A.N.Other |

A best prefix query using a query as shown below would return the entity with id 0

Query<Foo> query1 = bestPrefix(Foo.CODE, "35387123456"));

Similarly, queries with the following values would return these rows 353851234567 -> 1 353855234567 -> 2

npgall commented 5 years ago

Your pull request for this is now merged. This is a great contribution, many thanks!!

It will be included in the next release. I will keep this issue open though and I'll post an update here when the next release is out - hopefully in the next few days.

glockhart commented 5 years ago

That's great. Thank you @npgall

glockhart commented 4 years ago

hi @npgall, do you have an updated timeline for when this release might happen?

I'd like to get a release done internally on the components that rely on cqengine, but our process/tooling doesn't allow us to release with SNAPSHOT dependencies

npgall commented 4 years ago

Hi Glen. Sorry for the extreme delay - life got in the way!

This is now included in CQEngine 3.5.0. It has been released, and should sync to Maven central within a couple of hours.

Many thanks again for this contribution!!