I implemented a weighted search. Performance benchmarks are about the same as before in my tests. All original tests still pass.
Implemented weighted search
any specific reason for using the array instead?
No great reason. Redis multi sends each command through to the server where it is queued until exec.I thought that if the Redis DB was not local then latency might play in. Since there is no advantage to sending it piecemeal, sending it all as an array at the end eliminates that as a possible issue.
well multi returns a new Multi which queues the other calls, they're not actually sent right away (I wrote that part of node_redis), I didn't even know you could pass an array, but arrays are a lot uglier IMO
it would be nice if the weights were arbitrary, and word-count just happened to be one of the solutions
What other weighting were you thinking of? Support for quoted phrases where a matched phrase would weigh higher? Preference for certain source documents over others, say if the documents also had tags associated with that matched the search as well? What other ideas did you have?
mostly related to weighing the docs associated with the ids, which could be anything really but I guess you'd always be querying another db anyway so the sorting can be done there