Skip to content

Solr ( Search API solr)

Marie-Louise edited this page Sep 5, 2019 · 5 revisions

debugging indexes using solar

problem:

  • the search isn't picking up certain keywords in 'Find Grants Awarded' page.

Solution:

  • the content is in the database, it's just not being located correctly. This is an indexing problem.

which index is 'Find Grants Awarded' using ? :

  • previously it was Funded project index, now it's the multi entity index - why is funded project index being phased out ?.....ask annika & dipak

The index is populated with a long list of fields, where are they coming from?

  • Solr needs to be configured to include fields for each index. The function public function alterItems(array &$items) located -> /corporate/www/sites/all/modules/custom/corp_search/includes/callback_paragraph_view.inc adds the fields within a paragraph to the index.

the values (paragraph types) that were being passed into the array within the function were field_paragraphs_content which generates x amount of fields, field_sections which generates x amount of fields however it seems as though these were linked to the whole site except the content in the 'Find Grants Awarded' page.

to try to solve the issue I had to identify (path structure > paragraph bundles) the paragraph type that was actually being used in that page and pass the machine name in as a value field_grantholder_institution

  public function alterItems(array &$items) {
    $paragraphs_fields = array('field_paragraphs_content', 'field_sections', 'field_grantholder_institution');

Questions

  • why is funded project index not being used any more ?
  • how can I find the call back function for that index ?
  • why when i add the paragraph field to the function, I don't need to tick/ include it in the UI?

Solr set up

to check details for solr etc this is the place to go, click solr, open

to update solr, go to the drupal UI > configuration > search and meta data > Search API > Corporate prod (0verridden)

solr host: localhost

path : 8983

solr path: /solr/d7

save settings

Clone this wiki locally