Autocomplete suggestion always return Solr results(string) in small case/letter.

Created on 12 June 2024, 5 months ago
Updated 30 June 2024, 5 months ago

Problem/Motivation

Search Autocomplete suggestion always return Solr results(Title) in small case/letter. Requirement would be return titles in actual case.

Steps to reproduce

1: Install Modules: Search API, Search API Autocomplete, Search API Solr, Search API Solr Autocomplete.
2: Setup Server & Index from search api configuration page.
3: Created a view for Search (Using Index created step 2).
4: In Autocomplete settings select the Search view (Created in step 3).
5: Edit the Autocomplete settings and Enable the suggester.
6: Enable the suggester to "Retrieve from server".
5: Save the settings.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

💬 Support request
Status

Fixed

Version

4.0

Component

Code

Created by

🇮🇳India vsujeetkumar Delhi

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

Comments & Activities

  • Issue created by @vsujeetkumar
  • 🇮🇳India kalpanajaiswal

    I've been working on replicating this locally, and I believe it's functioning as expected after addressing other issues in the queue.
    After looking into the issue " https://www.drupal.org/project/search_api_autocomplete/issues/3024266 Avoid multiple results for the same keyword Needs work "
    The goal is to eliminate duplicate suggestions.

    The specific question I have is regarding keywords that appear in both lowercase and uppercase.
    For example, if we have "Backup" and "BACKUP," should the suggestions include both "backup" and "BACKUP," or just "backup"?
    This needs to be aligned with the fix for issue 3024266.

    I couldn't find a specific option to enable case-sensitive suggestions. However, if we want the suggestions to be case-sensitive, then the results should also be case-sensitive.

  • Status changed to Fixed 5 months ago
  • 🇦🇹Austria drunken monkey Vienna, Austria

    This is expected behavior, and based on your problem description you might also have configured Autocomplete incorrectly. As you’re referring to “Solr results”, it seems like you might want to get results as suggestions, not keywords? In this case, please choose the “Live results” suggester instead of “Retrieve from server”.

    The “Retrieve from server” suggester uses the backend plugin (the Solr backend plugin, in your case) to retrieve matching words from the search index to suggest words that the user might currently be typing – so, a “proper” autocomplete. Anyways, by this description, you see that this will only ever yield words as suggestions that are present in the Solr index. Since your fulltext fields are pretty certainly configured to ignore case, the Solr index will only have lowercase words indexed, so those are what will be suggested by Autocomplete.
    If you want autocomplete to perserve the case, you will need to use a separate fulltext field that preserves the case during indexing, use that just for Autocomplete and the other fulltext field(s) for actual searching.

    In any case, the behavior of the “Retrieve from server” suggester depends entirely on the backend, so I’m moving this issue to the Solr issue queue accordingly.

    @kalpanajaiswal: Thanks for the help!

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024