Closed olivernn closed 7 years ago
Looks great to me :+1:
I like having a one search method, and rest of It derived from the query object.
var query = new idx.query( {
term:'foo AND bar',
limit:10,
page:1
})
idx.search(query)
this way idx.query
will take care of all the parsing before passing it to search. And no need to include new method for new additions.
I agree on this one - I tried playing around with it some but it was a little more than I wanted to take on. As an experiment, I tried building one of your 'index' objects for each attribute, then combine the results.
I was imagining a json interface, because you could always have a query language that parsed into that if it was really necessary.
I would love this feature, and also to add in a search type: exclusion. For instance being able to do pageview -entry
to show all "pageview" terms that do not include "entry."
Just to throw in my two cents, I like the proposed interface a lot (the callback with specific search functions defined in scope)..
This seems great! Would love to have facets!
OR based query support is a feature I could really use. What's the status on this?
+1
I agree with this one. OR based queries are what I need. For now, i used the same trick as the one described here
It turned out differently the described in this issue, but the latest version of Lunr does provide more control over performing queries.
A more advanced query interface is something that lunr definitely needs. I'm not entirely sure what the interface would look like for this, perhaps a different method on the index and a query object itself:
This is just a very rough idea, but I think it is the right direction. It hopefully exposes a more powerful interface to the search. The
idx.search
method would still exist as a quick way to perform searches, but it would probably be built onto of this query method.Any input or feedback is much appreciated.