Weighted Search #10

Merged
merged 1 commit into from Aug 21, 2012

Projects

None yet

2 participants

@kbsymanz

I implemented a weighted search. Performance benchmarks are about the same as before in my tests. All original tests still pass.

Kurt

@tj tj merged commit 91c5f97 into tj:master Aug 21, 2012
@tj
Owner

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.

Owner
tj replied Aug 23, 2012

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

@tj
Owner
tj commented on 1f11787 Aug 21, 2012

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?

Owner
tj replied Aug 23, 2012

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment