nextapps-de / flexsearch

Next-Generation full text search library for Browser and Node.js
Apache License 2.0
12.53k stars 491 forks source link

Pagination with OR query #178

Closed divyamakkar26 closed 3 years ago

divyamakkar26 commented 4 years ago

I want to use page: true with bool: 'or', when I use each of them individually it gives me proper results but when I use them together in field search it gives me blank array

My code - const searchIndex = new FlexSearch({ doc: { id: 'searchId', field: ['searchContent'], }, }); searchIndex.search([{ suggest: true, limit: 10, page: true, query: 'program', field: 'searchContent', bool: 'or',

}, {
  suggest: true,
  limit: 10,
  page: true,
  query: 'assets',
  field: 'searchContent',
  bool: 'or',

}], (results) => {
  res.send({ status: 200, results });
});
ts-thomas commented 3 years ago

Please change over to the version >= 0.7.x, thanks a lot.