Distinct at search erases the distinct in the settings

This commit is contained in:
Clément Renault 2024-06-11 17:02:39 -04:00
parent ee39309aae
commit 1991bd03da
No known key found for this signature in database
GPG Key ID: F250A4C4E3AE5F5F

View File

@ -752,8 +752,6 @@ pub fn execute_search(
// The candidates is the universe unless the exhaustive number of hits // The candidates is the universe unless the exhaustive number of hits
// is requested and a distinct attribute is set. // is requested and a distinct attribute is set.
if exhaustive_number_hits { if exhaustive_number_hits {
// TODO Should the distinct search parameter replace the distinct setting?
// Or should we return an error if the distinct search param is set at the same time as the setting is set?
let distinct_field = match distinct.as_deref() { let distinct_field = match distinct.as_deref() {
Some(distinct) => Some(distinct), Some(distinct) => Some(distinct),
None => ctx.index.distinct_field(ctx.txn)?, None => ctx.index.distinct_field(ctx.txn)?,