Closed dimaqq closed 4 years ago
What are you trying to achieve with a query of +*
? I'd say that kind of query would be the pathological case, certainly with the current implementation of lunr.
If you are trying to get all documents from the index, that is better done outside of lunr. It's not really designed to be a general purpose store of documents.
I was trying to make it work like this:
foo bar%$%$
%$...
, split the input, remove whitespace, convert each word into searchy thingy+foo* +bar*
in lunr.js
Obv., I had a small bug, and empty user input was converted into +*
.
I understand that that would return entire dataset and can have some overhead, but I was surprised at just how slow it was.
So I figure, maybe there's a bug? (or maybe I just shouldn't do this)
(or maybe I just shouldn't do this)
Yes. :)
What behaviour would you expect when entering this query? What did Lunr return?
It might be possible to intercept certain queries and return something (what though?) to improve performance, I'm not yet sold on this though.
At the time I used to think that should return everything. But it seems that's not entirely accurate, I think that objects that are build of only empty strings won't actually match. Anyway, feel free to close or whatever.
index.search("+*")
is really really really slow:I guess I just have to validate the search terms before searching, don't I?