New answers tagged

0

Simple: Title provided for Views from Content entity. Title (indexed field) provided for Views from SOLR. For example: You have 1000 contents, and you want to show 10 of these, titles of that starts "Z" letter. If you use Title as filter - Drupal will use it by Views handlers, so: It will request data from SOLR server, in our case - all 1000 ...


1

My answer I found in search_api_solr module search_api_solr.api.php file. I used hook_search_api_solr_field_mapping_alter /** * Change the way the index's field names are mapped to Solr field names. * * @param SearchApiIndex $index * The index whose field mappings are altered. * @param array $fields * An associative array containing the index field ...


0

Let me summarize the question anno 2021: Create a Solr server + Default Solr content index (/admin/config/search/search-api) Edit your server (/admin/config/search/search-api/server/your_default_solr_server/edit). Open the advanced tab and select:Retrieve result data from Solr, Retrieve highlighted snippets Edit your index and select the datasources (/...


0

You can add this: foreach ($fields as $field) { $field->addValue($custom_field); $field->addValue($custom_field); }


0

If you really really want to do this which you probably wont with JSON API Views and serialisation https://www.drupal.org/docs/8/api/serialization-api/serialization-api-overview eg: dump(Drupal::service('serializer')->serializer->serialize($entity, 'json')); But if you really want to ... $node = \Drupal::entityTypeManager()->getStorage('node')->...


0

I managed to do something, despite not being optimal: in the postprocessSearchResults when necessary I send a RedirectResponse with new search params thus "reloading" the page and "re-running the search. /** * * @SearchApiProcessor( * id = "my_processor", * label = @Translation("A label"), * description = @...


0

Initially I tried some different approach: extending SearchApiString an event subscriber of KernelEvents::REQUEST altering the incoming url because by default facets\search api rely on the query_params of the url and the "values" of the relative facets various objects of the modules. Both of those those approaches kinda failed, because the first ...


Top 50 recent answers are included