I was following the instructions from 7 years ago (...) given here. When adding the block to the page it simply does not show. View results preview does not work with path either. The view is of my specific index. The chosen values are "Title" and "Latin first name" that are definitely indexed and used in other views successfully.
Following is the export of the view:
$view = new view();
$view->name = 'similar_data';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'search_api_index_partial_word_index';
$view->human_name = 'Similar data';
$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['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['style_plugin'] = 'default';
$handler->display->display_options['row_plugin'] = 'fields';
/* Header: Global: Text area */
$handler->display->display_options['header']['area']['id'] = 'area';
$handler->display->display_options['header']['area']['table'] = 'views';
$handler->display->display_options['header']['area']['field'] = 'area';
$handler->display->display_options['header']['area']['empty'] = TRUE;
$handler->display->display_options['header']['area']['content'] = 'Dummy header for texting block presentation.';
$handler->display->display_options['header']['area']['format'] = 'rich';
/* Field: Indexed Node: Title */
$handler->display->display_options['fields']['title']['id'] = 'title';
$handler->display->display_options['fields']['title']['table'] = 'search_api_index_partial_word_index';
$handler->display->display_options['fields']['title']['field'] = 'title';
$handler->display->display_options['fields']['title']['link_to_entity'] = 0;
/* Field: Indexed Node: Latin first name */
$handler->display->display_options['fields']['field_person_latin_fname']['id'] = 'field_person_latin_fname';
$handler->display->display_options['fields']['field_person_latin_fname']['table'] = 'search_api_index_partial_word_index';
$handler->display->display_options['fields']['field_person_latin_fname']['field'] = 'field_person_latin_fname';
/* Contextual filter: Search: More like this */
$handler->display->display_options['arguments']['search_api_views_more_like_this']['id'] = 'search_api_views_more_like_this';
$handler->display->display_options['arguments']['search_api_views_more_like_this']['table'] = 'search_api_index_partial_word_index';
$handler->display->display_options['arguments']['search_api_views_more_like_this']['field'] = 'search_api_views_more_like_this';
$handler->display->display_options['arguments']['search_api_views_more_like_this']['default_action'] = 'default';
$handler->display->display_options['arguments']['search_api_views_more_like_this']['default_argument_type'] = 'node';
$handler->display->display_options['arguments']['search_api_views_more_like_this']['default_argument_skip_url'] = TRUE;
$handler->display->display_options['arguments']['search_api_views_more_like_this']['summary']['format'] = 'default_summary';
$handler->display->display_options['arguments']['search_api_views_more_like_this']['fields'] = array(
'title' => 'title',
'field_person_latin_fname' => 'field_person_latin_fname',
);
/* Display: Block */
$handler = $view->new_display('block', 'Block', 'block_1');
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | similar_data_view.txt | 2.77 KB | amir simantov |
| #3 | similar_data_view.txt | 2.77 KB | amir simantov |
Comments
Comment #2
drunken monkeyAn exported view works better as an attachment (just use
.txtfile extension) than included in the IS body. Though it’s not that bad for such a simple view at least.Anyways, there are lots of reasons why that would not work. I assume you’re using Solr? Then please use these instructions to debug the Solr request that gets sent when the block should be shown. (Also works via live preview, to eliminate one potential source of problems.)
Your exported view works fine for me, in any case, so the problem probably lies somewhere else.
You did index all items in your index, right?
Comment #3
amir simantov commentedThanks for the comment and taking the time to check it in another context.
I am actually not using Solr but Database Search. It should be supported there, right?
Results are empty... Of course, everything is indexed (even re-index it, just in case).
See yet another simpler view: similar_data_view.txt
Comment #4
amir simantov commentedOh... Just saw this message in watchdog: "The search service "Database service" does not offer "More like this" functionality."
So? What should I do?
Comment #5
drunken monkeyUse Solr, or one of the other service classes supporting MLT.
Comment #6
amir simantov commentedThanks.