olivernn / lunr.js

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

But how to get all data as result? Search what char, would get me all data? #441

Closed hoogw closed 4 years ago

hoogw commented 4 years ago

But how to get all data as result? Search what char, would get me all data?

I need this for pagination:

For page 1: you search something to get all dataset as result. Now you use for loop through, only get 1 to 10 records,then break for loop.

For page 2: you perform same search again, you should get the same result set as last time, but you this time you use for loop, from 11 to 20. Because offset is 10(you skip first 10).

and so on

For page x: you perform same search again, you should get the same result set as last time, but this time you use for loop, from (x 10+1) to ((x 10+1) +10). Because offset is x 10 (you skip first x 10).

hoogw commented 4 years ago

I test the answer is

             `idx.search('')  

                 or 

                 idx.search(' ')

                 or 

                  idx.search('  ')

`

search empty, or space, or 2 space, you will get all dataset as result.

olivernn commented 4 years ago

I'm going to close this as a duplicate of #440