The format of the original document when stored have a bigger performance issue. At the moment, we don't optimize anything, the document value is stored as a []byte JSON string. In that manner, we need do json.Unmarshal every time we need the document content, and this operation can be very expensive.
I really like the second option because only in rare cases the user will ask for all of the document fields. If we add the requirement of user need ask only the fields he want in the API, then (maybe) we can benefit a lot in performance. If the document is bigger, one seek in the disk can be much slower than N seeks for specific fields. But for the inverse, for small documents, we can lost some performance too...
The format of the original document when stored have a bigger performance issue. At the moment, we don't optimize anything, the document value is stored as a []byte JSON string. In that manner, we need do json.Unmarshal every time we need the document content, and this operation can be very expensive.
https://github.com/NeowayLabs/neosearch/blob/master/index/index.go#L168
Some ideas that we can try:
I really like the second option because only in rare cases the user will ask for all of the document fields. If we add the requirement of user need ask only the fields he want in the API, then (maybe) we can benefit a lot in performance. If the document is bigger, one seek in the disk can be much slower than N seeks for specific fields. But for the inverse, for small documents, we can lost some performance too...