Hacker News new | ask | show | jobs
by sandGorgon 5018 days ago
I have an axiom "any sufficiently complex if-then-else ruleset can be modeled as a search problem with boosts".

I have modeled a logistics lookup system (assign "best" courier for an ecommerce setup) using a search solution. The rules were modeled as documents in a search index and looked up using weights. Fundamentally, what I did was flatten an if-then-else hierarchy and assign weights based on (roughly) level of nesting.

The con of this model is obvious - it is at best a heuristic. However, with clever overrides built in (as a separate search index?), you can get pretty close to the ideal solution.

The pro of this model is scalability - when your rules are in millions, this system scales beautifully.