olivernn/lunr.js — pull request #36 by Rameshv (2013-06-16 12:38:27+00:00)
Title: Support for OR based queries

HI,
First of all, thanks @olivernn for your great work. Currently lunr `search` do `AND` queries for multiple terms. But the app i am working on requires OR queries. I am trying to integrate OR based queries to lunr. Its fairly straight forward returning the result set. By replacing the

var documentSet = documentSets.reduce(function (memo, set) {
return memo.intersect(set)
})

with

var documentSet = documentSets.reduce(function (memo, set) {
return memo.union(set)
})

in `lunr.Index.prototype.search` would do the trick. I have ran some tests and it seems ok. I have added few test cases too.

But my main concern is about the score calculation for OR queries because i am not very sure about how to test this specific case. If you think this is worth, have a look at it.