Geofield undetected when using search api index and no fields using "entity field rendering"

Created on 14 May 2018, over 6 years ago
Updated 5 July 2023, over 1 year ago

Problem/Motivation

1. Setup a content type with a geofield
2. Setup Search API (a DB index should be fine. Solr is probably not required). Configure Search API to index your geofield as lat/long
3. /admin/structure/views/add and show "Index "
4. Add your lat/long field (and maybe some others). Ensure that all fields have "Use entity field rendering"
5. Change the view format to "Leaflet Map". In the settings, there is no field for "Data Source" and an error will show:

Please add at least one Geofield to the View and come back here to set it as Data Source.

Workaround:
1. Set the lat/long field to "Use entity field rendering"

However, now you won't be able to load as many results on the map because each result will use 10x the memory.

Proposed resolution

Support views that have no entities loaded.

Remaining tasks

1. More people test the current patch
2. Refine
3. Clean-up outstanding code todos.

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

Now supports Search API views that do not load entities. Greatly reduces memory consumption and allows for showing 10x the number of results on a map.

🐛 Bug report
Status

Active

Version

10.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
  • Performance

    It affects performance. It is often combined with the Needs profiling tag.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇩🇰Denmark ressa Copenhagen

    I store and use multipolygon values in Solr, and also got an error, but after I disabled a Leaflet Popup which was using a node entity, I no longer got an error.

    It now seems to almost work, but I am having problems getting the Multipolygon to display. I do get an output, but only points are shown, not polygons. If I switch to "Use entity field rendering" the polygons are rendered fine.

    I made sure all the steps on Create a search view that doesn’t load entities from the database were fulfilled.

    The Search API tips page "Create a search view that doesn’t load entities from the database" mentions using Xdebug:

    Finally, make sure there are actually no entity loads by either using XDebug and setting a break point at some point in the entity loading process, or add some debugging statement to that code.

    In which file would I place a break point, to verify whether or not entities are loaded?

    Should I create a separate issue about rendering Multipolygons as polygons, and not points?

  • 🇩🇰Denmark ressa Copenhagen

    I created 🐛 Add Geometries support for Search API Solr and Views integration Fixed , since the problem now seems more limited, a least in my case.

Production build 0.71.5 2024