-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Locate map pins by indexed WKT #336
Changes from all commits
26d8042
7818ed0
4ae117e
fd802ba
70b5b4c
aee8a1d
bd50b34
7e17e63
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,8 @@ | |
use Drupal\Component\Serialization\Yaml; | ||
use Drupal\localgov_directories\Constants as Directory; | ||
use Drupal\localgov_directories_location\ProximitySearchSetup; | ||
use Drupal\search_api\Entity\Index as SearchIndex; | ||
use Drupal\search_api\Item\Field as SearchIndexField; | ||
use Drupal\views\Entity\View; | ||
|
||
/** | ||
|
@@ -24,6 +26,15 @@ function localgov_directories_location_install($is_syncing) { | |
return; | ||
} | ||
|
||
$index = SearchIndex::load(Directory::DEFAULT_INDEX); | ||
$location_field = new SearchIndexField($index, Directory::LOCATION_FIELD_WKT); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
$location_field->setLabel('Location » Geo » location WKT'); | ||
$location_field->setDatasourceId('entity:node'); | ||
$location_field->setType('string'); | ||
$location_field->setPropertyPath('localgov_location:entity:location'); | ||
$index->addField($location_field); | ||
$index->save(); | ||
|
||
// Retrieves view display mode config and adds location-related sections to | ||
// the existing configuration. | ||
$module_path = \Drupal::service('extension.list.module')->getPath('localgov_directories_location'); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any use of this
Search: Rendered item
field anywhere in this View's display. If we drop this field, theembed_map
display loads about a thousand map pins without any memory exhaustion issues in our site. So I would request that thissearch_api_rendered_item
field be dropped.I am still running into memory exhaustion issues around 1500 map pins after dropping the
search_api_rendered_item
field. But I don't yet see any easy way out of that.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ekes fancy adding this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm almost tempted to go the other way. If we're not including a freetext search based on rendered item in the default view maybe we should be?