My company is looking to adopt CQEngine for use in a telco application. We have a requirement for a best / longest prefix match type search. While we could implement this in a library that makes use of CQEngine, we thought we'd see if this is something that could be built in.
The best prefix match requirement breaks down as the following:
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
Do you think this would be something that
- Would be feasible to implement in CQEngine?
- Would be something you'd like to see added?
If the answer to 1 and 2 above is yes, could you suggest a good place for us to start looking at this (we're happy to do the work, but aren't overly familiar with the internals of CQEngine and would appreciate any pointers you might have for us to get started)
thanks
Glen