Thanks @mschoch , that actually is helpful - in that it gives me a starting point, and a birds I view of what the Field interface does.
I'll have a read through the existing Field implementations and see if I can figure it out from here.
It would be great it there were more extensive comments in document/field.go giving an overview and explaining the role of each of the methods.
An unrelated question - what is the status of the Scorch backend now? Is it ready for production use?
And how do we turn it on? Do we just set
Config.DefaultIndexType = scorch.Name and specify
bleve.NewUsing(path, mapping, "scorch", "scorch", nil)? Or are there other things we need to do?
How does performance compare with Rocksdb?
Thanks again for all the pointers. They will help me make sense of what the code is doing.
I think I will start with storing the IP addresses as the 16 byte ipv6 address and do an inefficient
full table scan for cidr matches.
On the other hand, cidr matches all have the same prefix, so if I can search for the lowest member and scan forward from there, I should be able to get efficient CIDR matches.
What happens if we want to be able to store multiple IPs in a field?
Or for that matter, multiple keywords in a text field?
Is this something that bleve handles naturally? Or should I generate multiple documents - if I have 5 IPs should I generate 5 copies of my document, one for each IP?