olivernn / lunr.js

A bit like Solr, but much smaller and not as bright
http://lunrjs.com
MIT License
8.96k stars 548 forks source link

Is is possible to support OR operator? #182

Closed vu-dang closed 9 years ago

vu-dang commented 9 years ago

Great library and please add support for OR operator, something similar to Lucene http://lucene.apache.org/core/3_5_0/queryparsersyntax.html

Thanks, Vu

olivernn commented 9 years ago

Thanks!

The query interface is very basic currently, all the search terms must appear in a document for it to be a match. It is possible to mimic OR queries by performing multiple searches, i.e to search for "foo OR bar" you can do a search for "foo" and then a search for "bar" and combine the results.

I have plans to provide more powerful querying, but they're not going to materialise any time soon I'm afraid. It requires some non-trivial changes to the internals of lunr etc.