https://github.com/firesphere/silverstripe-solr-spatial
Add spatial searching to Solr in Silverstripe
https://github.com/firesphere/silverstripe-solr-spatial
Last synced: over 1 year ago
JSON representation
Add spatial searching to Solr in Silverstripe
- Host: GitHub
- URL: https://github.com/firesphere/silverstripe-solr-spatial
- Owner: Firesphere
- License: bsd-3-clause
- Created: 2021-09-05T03:32:03.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-09-05T03:55:23.000Z (almost 5 years ago)
- Last Synced: 2025-02-01T14:29:55.954Z (over 1 year ago)
- Language: PHP
- Size: 12.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Contributing: contributing.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Solr search Spatial
Extension for searching with `firesphere/solr-search` adding Spatial searching options.
## Installation
`composer require firesphere/solr-spatial`
## Configuration
Add the spatial extension to data objects you want/need to have Spatially searched:
```yaml
Your\Namespaced\DataObject:
extensions:
- Firesphere\SolrSpatial\SpatialDataObjectExtension
```
This will add a Lat and Lon field for latitude and longitude to your DataObject,
as well as a method named `getSpatial()`, which returns the latitude and longitude.
To add the spatial to your Solr core:
```yaml
Firesphere\SolrSearch\Indexes\BaseIndex:
MySearchCore:
Classes:
- Page
FulltextFields:
- Spatial
```
If your Spatial is on a relational Object (which is quite common), e.g. a City object, you can add it:
```yaml
Firesphere\SolrSearch\Indexes\BaseIndex:
MySearchCore:
Classes:
- Page
FulltextFields:
- City.Spatial
```
Everything else is taken care of. The Spatial/getSpatial field is defined as such, so Solr knows how to search for it.
## Filtering on spatial data
__To be completed__