I am using Fulltext Search Exposed Filter in Search API Views, and when the results are printed there is an extra comma is displaying in front of the titles, e.g.:
, First Title
, Second Title

When I remove the filter, then titles are shown fine as expected. This started happening after the recent module update.

Comments

Surinder P Sachdeva created an issue. See original summary.

drunken monkey’s picture

Status: Active » Postponed (maintainer needs more info)
Issue tags: -Fulltext Search, -views, -Search API

That's curious. Are you using the Solr backend, or the "Highlighting" processor (or both)?
Does this always occur when the filter (the search field) is present, or only when you input something there?
What are the view's style settings? Unordered list of Fields?
Do you have some additional modules (custom or contrib) installed that could influence this behavior (i.e., modules integrating with Views or Search API – particularly less popular ones). I'm pretty sure that this problem doesn't exist in most installations, so there's got to be something specific about your setup.
From which version did you update, 1.18?
If you are a bit tech-savvy, the optimum would be if you could do a git bissect to see which change in particular introduced the problem.

PS: It seems you (like many others – it's really easy to misinterpret) are confused by the "Issue tags" field. As the guidelines state, they aren't meant for free text tags related to the issue, but only for specific categorization purposes, usually by module maintainers.
So, if you aren't sure your current usage is correct, please just leave the field empty.

broeker’s picture

For what is is worth after making some various config changes to a previously working search API view, this started happening us also. An comma appears before every result title, and if you view source you find that there is an empty href in there pointing to the node:

<a href="node/1"></a>, <a href="node/1>My node</a>

I was able to fix by excluding the TITLE field from the excerpt settings within the Highlight processor...

drunken monkey’s picture

Are you maybe using a Solr backend and have incompatible processors enabled on your Search API index? (Most of them shouldn't be used along with Solr.)

dalemoore’s picture

I'm having this same issue. I'm using the search database module, not Solr or anything else. I do have the highlighting turned on.

It only occurs when using the fields that have the index name in the front, like "[Index Name]: [field] (indexed)", not the ones that start with Search:, like "Search: [Index Name] results"

Excluding the title / file name in the highlighting processor does seem to fix it, but I do want the word highlighted in there...

Here's my view's settings:
Format: HTML List
Show: Fields

Fields
Node Index: Title (indexed)
File Index: File name (indexed)
Search: Excerpt

Filter Criteria
Search: Fulltext search (exposed)
Node Index: Content type (indexed) (exposed)
File Index: File type (indexed) (exposed)

Sort Criteria
Search: Relevance (desc)

Here's the Export code for the view (I'm using the Page display):

$view = new view();
$view->name = 'intranet_search';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'search_api_multi';
$view->human_name = 'Search';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */

/* Display: Master */
$handler = $view->new_display('default', 'Master', 'default');
$handler->display->display_options['title'] = 'Search';
$handler->display->display_options['use_ajax'] = TRUE;
$handler->display->display_options['use_more_always'] = FALSE;
$handler->display->display_options['access']['type'] = 'none';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'full';
$handler->display->display_options['pager']['options']['items_per_page'] = '20';
$handler->display->display_options['pager']['options']['offset'] = '0';
$handler->display->display_options['pager']['options']['id'] = '0';
$handler->display->display_options['pager']['options']['quantity'] = '9';
$handler->display->display_options['style_plugin'] = 'list';
$handler->display->display_options['style_options']['default_row_class'] = FALSE;
$handler->display->display_options['style_options']['row_class_special'] = FALSE;
$handler->display->display_options['style_options']['wrapper_class'] = '';
$handler->display->display_options['row_plugin'] = 'search_api_multi';
$handler->display->display_options['row_options']['view_mode'] = array(
  'node' => 'search_result',
  'file' => 'search_result',
);
/* No results behavior: Global: Text area */
$handler->display->display_options['empty']['area']['id'] = 'area';
$handler->display->display_options['empty']['area']['table'] = 'views';
$handler->display->display_options['empty']['area']['field'] = 'area';
$handler->display->display_options['empty']['area']['label'] = 'No Results Found.';
$handler->display->display_options['empty']['area']['empty'] = TRUE;
$handler->display->display_options['empty']['area']['content'] = 'We\'re sorry, we couldn\'t find any results for your search.';
$handler->display->display_options['empty']['area']['format'] = 'full_html';
/* Field: Search: Node Index results */
$handler->display->display_options['fields']['node_index']['id'] = 'node_index';
$handler->display->display_options['fields']['node_index']['table'] = 'search_api_multi';
$handler->display->display_options['fields']['node_index']['field'] = 'node_index';
$handler->display->display_options['fields']['node_index']['label'] = '';
$handler->display->display_options['fields']['node_index']['element_type'] = 'h2';
$handler->display->display_options['fields']['node_index']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['node_index']['element_default_classes'] = FALSE;
$handler->display->display_options['fields']['node_index']['link_to_entity'] = 1;
$handler->display->display_options['fields']['node_index']['view_mode'] = 'full';
$handler->display->display_options['fields']['node_index']['bypass_access'] = 0;
/* Field: Search: File Index results */
$handler->display->display_options['fields']['file_index']['id'] = 'file_index';
$handler->display->display_options['fields']['file_index']['table'] = 'search_api_multi';
$handler->display->display_options['fields']['file_index']['field'] = 'file_index';
$handler->display->display_options['fields']['file_index']['label'] = '';
$handler->display->display_options['fields']['file_index']['element_type'] = 'h2';
$handler->display->display_options['fields']['file_index']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['file_index']['element_default_classes'] = FALSE;
$handler->display->display_options['fields']['file_index']['link_to_entity'] = 1;
$handler->display->display_options['fields']['file_index']['view_mode'] = 'teaser';
$handler->display->display_options['fields']['file_index']['bypass_access'] = 0;
/* Sort criterion: Search: Relevance */
$handler->display->display_options['sorts']['search_api_relevance']['id'] = 'search_api_relevance';
$handler->display->display_options['sorts']['search_api_relevance']['table'] = 'search_api_multi';
$handler->display->display_options['sorts']['search_api_relevance']['field'] = 'search_api_relevance';
/* Filter criterion: Search: Fulltext search */
$handler->display->display_options['filters']['search_api_multi_fulltext']['id'] = 'search_api_multi_fulltext';
$handler->display->display_options['filters']['search_api_multi_fulltext']['table'] = 'search_api_multi';
$handler->display->display_options['filters']['search_api_multi_fulltext']['field'] = 'search_api_multi_fulltext';
$handler->display->display_options['filters']['search_api_multi_fulltext']['operator'] = 'OR';
$handler->display->display_options['filters']['search_api_multi_fulltext']['group'] = 1;
$handler->display->display_options['filters']['search_api_multi_fulltext']['exposed'] = TRUE;
$handler->display->display_options['filters']['search_api_multi_fulltext']['expose']['operator_id'] = 'search_api_multi_fulltext_op';
$handler->display->display_options['filters']['search_api_multi_fulltext']['expose']['label'] = 'Keyword Search';
$handler->display->display_options['filters']['search_api_multi_fulltext']['expose']['operator'] = 'search_api_multi_fulltext_op';
$handler->display->display_options['filters']['search_api_multi_fulltext']['expose']['identifier'] = 'search_api_multi_fulltext';
$handler->display->display_options['filters']['search_api_multi_fulltext']['expose']['remember_roles'] = array(
  2 => '2',
  1 => 0,
  4 => 0,
  3 => 0,
  6 => 0,
);
/* Filter criterion: Node Index: Content type (indexed) */
$handler->display->display_options['filters']['node_index_type']['id'] = 'node_index_type';
$handler->display->display_options['filters']['node_index_type']['table'] = 'search_api_multi';
$handler->display->display_options['filters']['node_index_type']['field'] = 'node_index_type';
$handler->display->display_options['filters']['node_index_type']['value'] = array();
$handler->display->display_options['filters']['node_index_type']['group'] = 1;
$handler->display->display_options['filters']['node_index_type']['exposed'] = TRUE;
$handler->display->display_options['filters']['node_index_type']['expose']['operator_id'] = 'node_index_type_op';
$handler->display->display_options['filters']['node_index_type']['expose']['label'] = 'Filter by Content Type';
$handler->display->display_options['filters']['node_index_type']['expose']['operator'] = 'node_index_type_op';
$handler->display->display_options['filters']['node_index_type']['expose']['identifier'] = 'node_index_type';
$handler->display->display_options['filters']['node_index_type']['expose']['multiple'] = TRUE;
$handler->display->display_options['filters']['node_index_type']['expose']['remember_roles'] = array(
  2 => '2',
  1 => 0,
  4 => 0,
  3 => 0,
  6 => 0,
);
$handler->display->display_options['filters']['node_index_type']['expose']['reduce'] = 0;
/* Filter criterion: File Index: File type (indexed) */
$handler->display->display_options['filters']['file_index_type']['id'] = 'file_index_type';
$handler->display->display_options['filters']['file_index_type']['table'] = 'search_api_multi';
$handler->display->display_options['filters']['file_index_type']['field'] = 'file_index_type';
$handler->display->display_options['filters']['file_index_type']['value'] = array();
$handler->display->display_options['filters']['file_index_type']['exposed'] = TRUE;
$handler->display->display_options['filters']['file_index_type']['expose']['operator_id'] = 'file_index_type_op';
$handler->display->display_options['filters']['file_index_type']['expose']['label'] = 'Filter by File Type';
$handler->display->display_options['filters']['file_index_type']['expose']['operator'] = 'file_index_type_op';
$handler->display->display_options['filters']['file_index_type']['expose']['identifier'] = 'file_index_type';
$handler->display->display_options['filters']['file_index_type']['expose']['multiple'] = TRUE;
$handler->display->display_options['filters']['file_index_type']['expose']['remember_roles'] = array(
  2 => '2',
  1 => 0,
  4 => 0,
  3 => 0,
  6 => 0,
);
$handler->display->display_options['filters']['file_index_type']['expose']['reduce'] = 0;

/* Display: Page */
$handler = $view->new_display('page', 'Page', 'page');
$handler->display->display_options['defaults']['exposed_form'] = FALSE;
$handler->display->display_options['exposed_form']['type'] = 'better_exposed_filters';
$handler->display->display_options['exposed_form']['options']['submit_button'] = 'Search';
$handler->display->display_options['exposed_form']['options']['reset_button'] = TRUE;
$handler->display->display_options['exposed_form']['options']['bef'] = array(
  'general' => array(
    'allow_secondary' => 0,
    'secondary_label' => 'Advanced options',
    'collapsible_label' => NULL,
    'combine_rewrite' => NULL,
    'reset_label' => NULL,
    'bef_filter_description' => NULL,
    'any_label' => NULL,
    'filter_rewrite_values' => NULL,
  ),
  'search_api_multi_fulltext' => array(
    'bef_format' => 'default',
    'more_options' => array(
      'is_secondary' => 0,
      'any_label' => '',
      'bef_filter_description' => '',
      'tokens' => array(
        'available' => array(
          0 => 'global_types',
          'secondary_label' => NULL,
          'collapsible_label' => NULL,
          'combine_rewrite' => NULL,
          'reset_label' => NULL,
          'bef_filter_description' => NULL,
          'any_label' => NULL,
          'filter_rewrite_values' => NULL,
        ),
        'secondary_label' => NULL,
        'collapsible_label' => NULL,
        'combine_rewrite' => NULL,
        'reset_label' => NULL,
        'bef_filter_description' => NULL,
        'any_label' => NULL,
        'filter_rewrite_values' => NULL,
      ),
      'rewrite' => array(
        'filter_rewrite_values' => '',
        'secondary_label' => NULL,
        'collapsible_label' => NULL,
        'combine_rewrite' => NULL,
        'reset_label' => NULL,
        'bef_filter_description' => NULL,
        'any_label' => NULL,
      ),
      'secondary_label' => NULL,
      'collapsible_label' => NULL,
      'combine_rewrite' => NULL,
      'reset_label' => NULL,
      'filter_rewrite_values' => NULL,
    ),
    'secondary_label' => NULL,
    'collapsible_label' => NULL,
    'combine_rewrite' => NULL,
    'reset_label' => NULL,
    'bef_filter_description' => NULL,
    'any_label' => NULL,
    'filter_rewrite_values' => NULL,
  ),
  'node_index_type' => array(
    'bef_format' => 'bef',
    'more_options' => array(
      'bef_select_all_none' => 0,
      'bef_collapsible' => 0,
      'is_secondary' => 0,
      'any_label' => '',
      'bef_filter_description' => '',
      'tokens' => array(
        'available' => array(
          0 => 'global_types',
          'secondary_label' => NULL,
          'collapsible_label' => NULL,
          'combine_rewrite' => NULL,
          'reset_label' => NULL,
          'bef_filter_description' => NULL,
          'any_label' => NULL,
          'filter_rewrite_values' => NULL,
        ),
        'secondary_label' => NULL,
        'collapsible_label' => NULL,
        'combine_rewrite' => NULL,
        'reset_label' => NULL,
        'bef_filter_description' => NULL,
        'any_label' => NULL,
        'filter_rewrite_values' => NULL,
      ),
      'rewrite' => array(
        'filter_rewrite_values' => '',
        'secondary_label' => NULL,
        'collapsible_label' => NULL,
        'combine_rewrite' => NULL,
        'reset_label' => NULL,
        'bef_filter_description' => NULL,
        'any_label' => NULL,
      ),
      'secondary_label' => NULL,
      'collapsible_label' => NULL,
      'combine_rewrite' => NULL,
      'reset_label' => NULL,
      'filter_rewrite_values' => NULL,
    ),
    'secondary_label' => NULL,
    'collapsible_label' => NULL,
    'combine_rewrite' => NULL,
    'reset_label' => NULL,
    'bef_filter_description' => NULL,
    'any_label' => NULL,
    'filter_rewrite_values' => NULL,
  ),
  'file_index_type' => array(
    'bef_format' => 'bef',
    'more_options' => array(
      'bef_select_all_none' => 0,
      'bef_collapsible' => 0,
      'is_secondary' => 0,
      'any_label' => '',
      'bef_filter_description' => '',
      'tokens' => array(
        'available' => array(
          0 => 'global_types',
          'secondary_label' => NULL,
          'collapsible_label' => NULL,
          'combine_rewrite' => NULL,
          'reset_label' => NULL,
          'bef_filter_description' => NULL,
          'any_label' => NULL,
          'filter_rewrite_values' => NULL,
        ),
        'secondary_label' => NULL,
        'collapsible_label' => NULL,
        'combine_rewrite' => NULL,
        'reset_label' => NULL,
        'bef_filter_description' => NULL,
        'any_label' => NULL,
        'filter_rewrite_values' => NULL,
      ),
      'rewrite' => array(
        'filter_rewrite_values' => '',
        'secondary_label' => NULL,
        'collapsible_label' => NULL,
        'combine_rewrite' => NULL,
        'reset_label' => NULL,
        'bef_filter_description' => NULL,
        'any_label' => NULL,
      ),
      'secondary_label' => NULL,
      'collapsible_label' => NULL,
      'combine_rewrite' => NULL,
      'reset_label' => NULL,
      'filter_rewrite_values' => NULL,
    ),
    'secondary_label' => NULL,
    'collapsible_label' => NULL,
    'combine_rewrite' => NULL,
    'reset_label' => NULL,
    'bef_filter_description' => NULL,
    'any_label' => NULL,
    'filter_rewrite_values' => NULL,
  ),
  'secondary_label' => NULL,
  'collapsible_label' => NULL,
  'combine_rewrite' => NULL,
  'reset_label' => NULL,
  'bef_filter_description' => NULL,
  'any_label' => NULL,
  'filter_rewrite_values' => NULL,
);
$handler->display->display_options['exposed_form']['options']['input_required'] = 1;
$handler->display->display_options['exposed_form']['options']['text_input_required'] = 'Enter keywords to search for or choose from available filters.';
$handler->display->display_options['exposed_form']['options']['text_input_required_format'] = 'full_html';
$handler->display->display_options['defaults']['style_plugin'] = FALSE;
$handler->display->display_options['style_plugin'] = 'list';
$handler->display->display_options['style_options']['default_row_class'] = FALSE;
$handler->display->display_options['style_options']['row_class_special'] = FALSE;
$handler->display->display_options['style_options']['wrapper_class'] = '';
$handler->display->display_options['defaults']['style_options'] = FALSE;
$handler->display->display_options['defaults']['row_plugin'] = FALSE;
$handler->display->display_options['row_plugin'] = 'fields';
$handler->display->display_options['row_options']['default_field_elements'] = FALSE;
$handler->display->display_options['defaults']['row_options'] = FALSE;
$handler->display->display_options['exposed_block'] = TRUE;
$handler->display->display_options['defaults']['relationships'] = FALSE;
$handler->display->display_options['defaults']['fields'] = FALSE;
/* Field: Search: Node Index results */
$handler->display->display_options['fields']['node_index']['id'] = 'node_index';
$handler->display->display_options['fields']['node_index']['table'] = 'search_api_multi';
$handler->display->display_options['fields']['node_index']['field'] = 'node_index';
$handler->display->display_options['fields']['node_index']['label'] = '';
$handler->display->display_options['fields']['node_index']['exclude'] = TRUE;
$handler->display->display_options['fields']['node_index']['element_type'] = 'h2';
$handler->display->display_options['fields']['node_index']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['node_index']['element_default_classes'] = FALSE;
$handler->display->display_options['fields']['node_index']['hide_empty'] = TRUE;
$handler->display->display_options['fields']['node_index']['link_to_entity'] = 1;
$handler->display->display_options['fields']['node_index']['view_mode'] = 'search_result';
$handler->display->display_options['fields']['node_index']['bypass_access'] = 0;
/* Field: Search: File Index results */
$handler->display->display_options['fields']['file_index']['id'] = 'file_index';
$handler->display->display_options['fields']['file_index']['table'] = 'search_api_multi';
$handler->display->display_options['fields']['file_index']['field'] = 'file_index';
$handler->display->display_options['fields']['file_index']['label'] = '';
$handler->display->display_options['fields']['file_index']['exclude'] = TRUE;
$handler->display->display_options['fields']['file_index']['element_type'] = 'h2';
$handler->display->display_options['fields']['file_index']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['file_index']['element_default_classes'] = FALSE;
$handler->display->display_options['fields']['file_index']['hide_empty'] = TRUE;
$handler->display->display_options['fields']['file_index']['link_to_entity'] = 1;
$handler->display->display_options['fields']['file_index']['view_mode'] = 'search_result';
$handler->display->display_options['fields']['file_index']['bypass_access'] = 0;
/* Field: Node Index: Title (indexed) */
$handler->display->display_options['fields']['node_index_title']['id'] = 'node_index_title';
$handler->display->display_options['fields']['node_index_title']['table'] = 'search_api_multi';
$handler->display->display_options['fields']['node_index_title']['field'] = 'node_index_title';
$handler->display->display_options['fields']['node_index_title']['label'] = '';
$handler->display->display_options['fields']['node_index_title']['element_type'] = 'h2';
$handler->display->display_options['fields']['node_index_title']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['node_index_title']['element_default_classes'] = FALSE;
$handler->display->display_options['fields']['node_index_title']['hide_empty'] = TRUE;
$handler->display->display_options['fields']['node_index_title']['empty_zero'] = TRUE;
$handler->display->display_options['fields']['node_index_title']['link_to_entity'] = 1;
/* Field: File Index: File name (indexed) */
$handler->display->display_options['fields']['file_index_name']['id'] = 'file_index_name';
$handler->display->display_options['fields']['file_index_name']['table'] = 'search_api_multi';
$handler->display->display_options['fields']['file_index_name']['field'] = 'file_index_name';
$handler->display->display_options['fields']['file_index_name']['label'] = '';
$handler->display->display_options['fields']['file_index_name']['element_type'] = 'h2';
$handler->display->display_options['fields']['file_index_name']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['file_index_name']['element_default_classes'] = FALSE;
$handler->display->display_options['fields']['file_index_name']['hide_empty'] = TRUE;
$handler->display->display_options['fields']['file_index_name']['empty_zero'] = TRUE;
$handler->display->display_options['fields']['file_index_name']['link_to_entity'] = 1;
/* Field: Search: Excerpt */
$handler->display->display_options['fields']['search_api_excerpt']['id'] = 'search_api_excerpt';
$handler->display->display_options['fields']['search_api_excerpt']['table'] = 'search_api_multi';
$handler->display->display_options['fields']['search_api_excerpt']['field'] = 'search_api_excerpt';
$handler->display->display_options['fields']['search_api_excerpt']['label'] = '';
$handler->display->display_options['fields']['search_api_excerpt']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['search_api_excerpt']['element_default_classes'] = FALSE;
$handler->display->display_options['fields']['search_api_excerpt']['hide_empty'] = TRUE;
$handler->display->display_options['fields']['search_api_excerpt']['link_to_entity'] = 0;
$handler->display->display_options['defaults']['sorts'] = FALSE;
/* Sort criterion: Search: Relevance */
$handler->display->display_options['sorts']['search_api_relevance']['id'] = 'search_api_relevance';
$handler->display->display_options['sorts']['search_api_relevance']['table'] = 'search_api_multi';
$handler->display->display_options['sorts']['search_api_relevance']['field'] = 'search_api_relevance';
$handler->display->display_options['sorts']['search_api_relevance']['order'] = 'DESC';
$handler->display->display_options['defaults']['arguments'] = FALSE;
$handler->display->display_options['path'] = 'search-page';
drunken monkey’s picture

Please use attachments for adding Views exports, this is otherwise a pain to scroll over.
Did this work for you in a previous version, too?
Also, I see you're using the search_api_multi module for creating the view, which is another matter entirely. Can you re-create the problem with a normal view, based on a single index's base table, too? Otherwise, we should either move this issue or create a new one in the search_api_multi project.

dalemoore’s picture

Sorry for the delayed response, I ended up just excluding the title and moving on, but I've just ran into this issue again and went looking to how I solved it and found this post again.

It does seem to be only related to using the multi-index approach, I created a view that uses just the single index and it doesn't occur.

drunken monkey’s picture

Status: Postponed (maintainer needs more info) » Needs work

Hm, OK, that's at least something.
Still, it might be the highlighting processor after all, just triggered by the multi-index view.
Can you see if the attached patch resolves the problem for you? (Not an actual solution, but just for finding out where the bug is.)

drunken monkey’s picture

Oops, here's the patch.

dalemoore’s picture

StatusFileSize
new151.66 KB

It doesn't seem to have affected anything. I'm on Search API 7.x-1.22, Multi-index searches 7.x-1.4, Database search 7.x-1.6, Search views 7.x-1.22 if any of that matters.

I've attached a screenshot of what's happening.

drunken monkey’s picture

Component: General code » Views integration
Status: Needs work » Needs review
StatusFileSize
new584 bytes

Ah, now I think I've got it! Thanks for the continued feedback!
Patch attached, please test!

Status: Needs review » Needs work

The last submitted patch, 11: 2780799-11--fix_views_highlighting.patch, failed testing. View results

drunken monkey’s picture

Project: Search API » Search API Multi-Index Searches
Version: 7.x-1.19 » 7.x-1.x-dev
Component: Views integration » Code
Status: Needs work » Needs review

Ah, just had the wrong project set.

  • drunken monkey committed 53c2f89 on 7.x-1.x
    Issue #2780799 by drunken monkey, dalemoore: Fixed processing of...
drunken monkey’s picture

Status: Needs review » Fixed

Committed.
A review would have been nice, but still, thanks again for your help!

Status: Fixed » Closed (fixed)

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

dalemoore’s picture

Sorry for delayed response again. ಠ_ಠ I was wondering why I never get notifications on topics I follow, I had somehow turned off notifications by email in the "Issue notifications" tab of my settings... Anyhow, patch applied and working. Thanks!