Problem/Motivation

'Maximum number of items in Autocomplete' configuration is not giving correct results.

Steps to reproduce

Set value of 'Maximum number of items in Autocomplete' to 10 and observe the autosuggestion results. Result should show 10 suggestions as per the configuration. Its showing incorrect result.

Comments

renukakulkarni created an issue. See original summary.

renukakulkarni’s picture

Fixed this issue temporarily with this patch attached.

boromino’s picture

StatusFileSize
new5.03 KB

The module applies the maximum number of items on the view that retrieves the autocomplete results. As these may query for items other than that in the autocomplete filter, the number is not correct. This patch applies the maximum number on the matches for the autocomplete filter.

boromino’s picture

Status: Active » Needs review
boromino’s picture

StatusFileSize
new5.05 KB
new798 bytes

The pager has to remain and be set to zero for some special cases.

jelle_s’s picture

StatusFileSize
new3.89 KB

Reroll of #5.

vasike’s picture

Version: 8.x-1.3 » 2.0.x-dev
Status: Needs review » Closed (works as designed)
Related issues: +#3393550: Allow other modules to alter the autocomplete values

It's a known issue if we have duplicate values.

I'm afraid the patches here could not be considered here.
As it's not desired to make a query for "millions" of results ... which actually is possible if the limit is empty.
But if someone decides a limit is needed ... then query limit is desired.

However we could:
- Add info to project about this https://www.drupal.org/project/views_autocomplete_filters/issues/3387912...
- And maybe try to have this altering solution ... maybe it could help in such cases
https://www.drupal.org/project/views_autocomplete_filters/issues/3393550