Autocomplete results with character limit

Created on 3 June 2024, 6 months ago

Problem/Motivation

Steps to reproduce

1. Install Drupal 10.2.4
2. Install Views autocomplete filters
3. Create contents for the required content type, example: Articles
4. Create new view with title & body field, and in the filter criteria, add "Global: Combine fields filter" and expose that field.
5. Select body field in "Choose fields to combine for filtering" and also enable "Use Autocomplete" option and save.

All of us knows that body field may have more like paragraphs.
So, in the combine field, when we type some words, say like, "arranging type for optimal pleasure", it will search and provide the autocomplete suggestions if any match is there.

Problem is,

#1. If the body field is limitted to some charecter limit, then, this is not searching beyond that limit.
example: In the field section, in body filed settings, I have used "Trim this field to a maximum number of characters" as 100, and if I search some words which is beyond 100chars, then I will not get results.
#2. If the body field is not limitted, and if I search some words, I will get full body content.

Proposed resolution

When we enable "Use autocomplete", we will get other options like,
Maximum number of items in Autocomplete,
Minimum number of characters to start filter,
Unformatted dropdown, etc.
Similarly, is there any possibility to provide an option to the user like, "Search results character limit"?
Can auto-suggestion be rely only on the field machine name, ex: body,title, etc, not on the trim limit set on the filed, and search full content and if results charecter limit has been set, only those limit of charecters has been coming up in auto-suggestion?

Remaining tasks

User interface changes

API changes

Data model changes

💬 Support request
Status

Active

Version

2.0

Component

Code

Created by

🇮🇳India sivagami Bangalore

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024