{"id":19538510,"url":"https://github.com/indoqa/solr-spatial-clustering","last_synced_at":"2025-04-26T16:30:49.019Z","repository":{"id":26510997,"uuid":"29963692","full_name":"Indoqa/solr-spatial-clustering","owner":"Indoqa","description":"A Distance-based Solr spatial clustering plugin","archived":false,"fork":false,"pushed_at":"2023-10-19T07:50:47.000Z","size":606,"stargazers_count":30,"open_issues_count":2,"forks_count":8,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-04T15:03:46.601Z","etag":null,"topics":["distance","indoqa-library","java","solr","spatial-clusters"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Indoqa.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-01-28T11:03:20.000Z","updated_at":"2023-12-30T20:51:17.000Z","dependencies_parsed_at":"2024-11-11T02:35:38.317Z","dependency_job_id":"6d9b37d6-df77-4908-abf9-58cbfcfd24c8","html_url":"https://github.com/Indoqa/solr-spatial-clustering","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Indoqa%2Fsolr-spatial-clustering","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Indoqa%2Fsolr-spatial-clustering/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Indoqa%2Fsolr-spatial-clustering/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Indoqa%2Fsolr-spatial-clustering/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Indoqa","download_url":"https://codeload.github.com/Indoqa/solr-spatial-clustering/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251017231,"owners_count":21523539,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["distance","indoqa-library","java","solr","spatial-clusters"],"created_at":"2024-11-11T02:35:08.653Z","updated_at":"2025-04-26T16:30:44.012Z","avatar_url":"https://github.com/Indoqa.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Indoqa Solr Spatial Clustering\n\nThis project offers a distance-based spatial clustering search component for Apache Solr. \nIt addresses the problem of reducing the amount of displayed markers on a map, described as [Spatial Clustering](https://wiki.apache.org/solr/SpatialClustering), \nusing a [distance-based](https://developers.google.com/maps/articles/toomanymarkers#distancebasedclustering) clustering algorithm based on [GVM](http://www.tomgibara.com/clustering/fast-spatial/).\n\n\nThe search component aggregates all possible search results to a maximum amount of pins and adds this information to the standard search result representation. Like faceting, it can be used to query for a paged result slice (eg. for a result list) and a geographic overview of ALL search result items (spatial clusters) at once. \n\n![Spatial Clustering](https://raw.githubusercontent.com/Indoqa/solr-spatial-clustering/master/spatial_clustering.png)\n\n## Installation\n\nDownload the plugin jar from http://repo1.maven.org/maven2/com/indoqa/solr/spatial-clustering/7.5.0/spatial-clustering-7.5.0-jar-with-dependencies.jar and copy it into the `/lib` directory of your solr core.\n\n## Configuration\n\n### schema.xml\n\nTo enable spatial clustering, store the geo information (longitude and latitude) in your solr document:\n\n```xml\n\u003cfieldType name=\"pdouble\" class=\"solr.DoublePointField\" /\u003e\n\n\u003cfield name=\"latitude\" type=\"pdouble\" indexed=\"true\" stored=\"true\" /\u003e\n\u003cfield name=\"longitude\" type=\"pdouble\" indexed=\"true\" stored=\"true\" /\u003e\n```\n\nNote: For legacy support of old Solr 4 `SortableDoubleField`, see branch `legacy/solr-4.3`\n\n### solrconfig.xml\n\nDefine the search component and map field names for id, longitude and latitude, as well as the maximum allowed number of clusters:\n\n```xml\n\u003csearchComponent class=\"com.indoqa.solr.spatial.clustering.SpatialClusteringComponent\" name=\"spatial-clustering\"\u003e\n  \u003cstr name=\"fieldId\"\u003eid\u003c/str\u003e\n  \u003cstr name=\"fieldLon\"\u003elongitude\u003c/str\u003e\n  \u003cstr name=\"fieldLat\"\u003elatitude\u003c/str\u003e\n\n  \u003cint name=\"maxSize\"\u003e1000000\u003c/int\u003e\n\u003c/searchComponent\u003e\n```\n\nAfter that, add the spatial component to your query component chain:\n\n```xml\n\u003crequestHandler name=\"/search\" class=\"solr.SearchHandler\" default=\"true\"\u003e\n  \u003carr name=\"last-components\"\u003e\n    \u003cstr\u003espatial-clustering\u003c/str\u003e\n  \u003c/arr\u003e\n\u003c/requestHandler\u003e\n```\n\n## Usage\n\n### Query Parameters\n\n * `spatial-clustering=true` -\u003e Enables spatial clustering\n * `spatial-clustering.size=20` -\u003e Optionally sets the maximum number of clusters (=pins)\n * `spatial-clustering.min-result-count=100` -\u003e Optionally sets the minimum number of documents required to do clustering\n\n### Result\n\nSimilar to facets, the computed clusters are added to the search result after the requested documents. There are two types of\nresult pins:\n\n  * `single`: Represents a single document, including the id of the referenced document.\n  * `cluster`: Represents an aggregated pin covering more than one document, including the cluster size.  \n  \n\n```xml\n\u003clst name=\"spatial-clustering\"\u003e\n  \u003clst name=\"pin\"\u003e\n    \u003cstr name=\"type\"\u003esingle\u003c/str\u003e\n    \u003cint name=\"size\"\u003e1\u003c/int\u003e\n    \u003cdouble name=\"longitude\"\u003e16.345518\u003c/double\u003e\n    \u003cdouble name=\"latitude\"\u003e48.285202\u003c/double\u003e\n    \u003cstring name=\"reference\"\u003edocument-2313\u003c/string\u003e\n  \u003c/lst\u003e\n  \u003clst name=\"pin\"\u003e\n    \u003cstr name=\"type\"\u003ecluster\u003c/str\u003e\n    \u003cint name=\"size\"\u003e3\u003c/int\u003e\n    \u003cdouble name=\"longitude\"\u003e16.2461115932\u003c/double\u003e\n    \u003cdouble name=\"latitude\"\u003e48.20259082573333\u003c/double\u003e\n  \u003c/lst\u003e\n  ...\n  ...\n\u003c/lst\u003e\n```\n\n## Build\n\n### Requirements\n\n  * Apache Solr 7.5.0+\n  * Java 8+\n  \n### Build\n\n  * Download the latest release\n  * run `maven clean install`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findoqa%2Fsolr-spatial-clustering","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Findoqa%2Fsolr-spatial-clustering","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findoqa%2Fsolr-spatial-clustering/lists"}