nodebb-plugin-solr icon indicating copy to clipboard operation
nodebb-plugin-solr copied to clipboard

Improve time based search queries

Open Dravere opened this issue 6 years ago • 4 comments

As mentioned in the pull-request #39 I would like to provide further changes to this plugin. One of those is an improvement in regards to time based search queries. Currently if someone is searching for a term X and wants them sorted by the date, the sorting by the date is done in NodeBB core while this plugin provides them in relevance order. Since we limit the result query by 500 this can have unexpected results.

Lets say someone is searching for a common term "book" and is sorting by post time in descending order. There is absolutely no guarantee that he will receive the most recent results that he would expect. Because if there are more than 500 results for that search term in Solr, they won't be sorted by this timestamp. Solr will provide a "random" set (e.g. not all, only 500) in regards to the timestamp. The sorting is done in NodeBB core.

That is why I requested additional data about the search query in the given hook: https://github.com/NodeBB/NodeBB/issues/6552

A lot of the tasks that are currently done in NodeBB could be directly done via Solr and thus probably better should be moved to the plugin side. And for a starter I at least would like to support better time based search queries. But to be able to do this improvements we need the timestamp in the Solr database which currently is not the case. Thus a re-index would be necessary.

Dravere avatar Jun 22 '18 11:06 Dravere