Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A Distance-based Solr spatial clustering plugin

License

NotificationsYou must be signed in to change notification settings

Indoqa/solr-spatial-clustering

Repository files navigation

This project offers a distance-based spatial clustering search component for Apache Solr.It addresses the problem of reducing the amount of displayed markers on a map, described asSpatial Clustering,using adistance-based clustering algorithm based onGVM.

The 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.

Spatial Clustering

Installation

Download the plugin jar fromhttp://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.

Configuration

schema.xml

To enable spatial clustering, store the geo information (longitude and latitude) in your solr document:

<fieldTypename="pdouble"class="solr.DoublePointField" /><fieldname="latitude"type="pdouble"indexed="true"stored="true" /><fieldname="longitude"type="pdouble"indexed="true"stored="true" />

Note: For legacy support of old Solr 4SortableDoubleField, see branchlegacy/solr-4.3

solrconfig.xml

Define the search component and map field names for id, longitude and latitude, as well as the maximum allowed number of clusters:

<searchComponentclass="com.indoqa.solr.spatial.clustering.SpatialClusteringComponent"name="spatial-clustering">  <strname="fieldId">id</str>  <strname="fieldLon">longitude</str>  <strname="fieldLat">latitude</str>  <intname="maxSize">1000000</int></searchComponent>

After that, add the spatial component to your query component chain:

<requestHandlername="/search"class="solr.SearchHandler"default="true">  <arrname="last-components">    <str>spatial-clustering</str>  </arr></requestHandler>

Usage

Query Parameters

  • spatial-clustering=true -> Enables spatial clustering
  • spatial-clustering.size=20 -> Optionally sets the maximum number of clusters (=pins)
  • spatial-clustering.min-result-count=100 -> Optionally sets the minimum number of documents required to do clustering

Result

Similar to facets, the computed clusters are added to the search result after the requested documents. There are two types ofresult pins:

  • single: Represents a single document, including the id of the referenced document.
  • cluster: Represents an aggregated pin covering more than one document, including the cluster size.
<lstname="spatial-clustering">  <lstname="pin">    <strname="type">single</str>    <intname="size">1</int>    <doublename="longitude">16.345518</double>    <doublename="latitude">48.285202</double>    <stringname="reference">document-2313</string>  </lst>  <lstname="pin">    <strname="type">cluster</str>    <intname="size">3</int>    <doublename="longitude">16.2461115932</double>    <doublename="latitude">48.20259082573333</double>  </lst>  ...  ...</lst>

Build

Requirements

  • Apache Solr 7.5.0+
  • Java 8+

Build

  • Download the latest release
  • runmaven clean install

About

A Distance-based Solr spatial clustering plugin

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors4

  •  
  •  
  •  
  •  

Languages


[8]ページ先頭

©2009-2025 Movatter.jp