SlideShare una empresa de Scribd logo
1 de 19
Descargar para leer sin conexión
Apache Solr v4
Geo Spatial Search
@mknkisk
13年7月21日日曜日
Geo Spatial Search
位置情報(緯度経度)を使った検索
店舗検索
ナビゲーションサービス
13年7月21日日曜日
Geo Spatial Search
Google Map
Foursquare
13年7月21日日曜日
Solr v3 => v4
v3 でも空間検索はサポート
v4.3.1 では v3 形式もサポート
v4.3.1 時点での example の schema.xml
はまだ v3 の空間検索方式
13年7月21日日曜日
Solr v3 => v4
Solr v4 で検索/設定方法が変更
fieldType の追加 (location_rpt)
geodist() の使用を非推奨
13年7月21日日曜日
Dependency library
空間検索ロジックは OSS の spatial4j
solr.war に入ってる
ポリゴンを検索したい場合
jts.jar が必要
solr.war には入ってない
13年7月21日日曜日
Put jts.jar in solr.war
jts.jar をダウンロード
http://sourceforge.net/projects/jts-topo-
suite/
solr.war を解凍
WEB-INF/lib 配下に jts.jar を配置
solr.war に再度アーカイブ
13年7月21日日曜日
Put jts.jar in solr.war
http://stackoverflow.com/questions/
13282014/how-to-install-spatial4j-into-
solr4
13年7月21日日曜日
MEMO
JTS
The JTS Topology Suite is an API for modelling and manipulating 2-
dimensional linear geometry.
WKT (Well Known Text)
Well-known text (WKT) is a text markup language for representing vector
geometry objects on a map, spatial reference systems of spatial objects and
transformations between spatial reference systems.
13年7月21日日曜日
Example: schema.xml
<types>
....
<fieldType name="location_rpt"
class="solr.SpatialRecursivePrefixTreeFieldType"
geo="true" distErrPct="0.025"
maxDistErr="0.000009" units="degrees" />
....
</types>
13年7月21日日曜日
Example: schema.xml
<fields>
....
<field name="store" type="location_rpt"
indexed="true" stored="true"/>
....
</fields>
13年7月21日日曜日
Example: schema.xml
solr.war/example/solr/collection1/conf/
schema.xml の設定
WGS84 (世界測地系)
単位: degrees (度分秒)
13年7月21日日曜日
Example: schema.xml
Solr Wiki を見てるとWGS84以外は注
意点が多そう
Indexing時にWGS84に変換してやるの
が良さそう
13年7月21日日曜日
Example: Indexing (Point)
金閣寺
<field name=”store”>135.729 35.039</field>
銀閣寺
<field name=”store”>135.798 35.026</field>
京都駅
<field name=”store”>135.757 34.986</field>
13年7月21日日曜日
Example: Indexing (Python)
import pysolr
def main():
solr = pysolr.Solr('http://localhost:8983/solr/', timeout=10)
solr.add([
{
"id": "1",
"name": u"金閣寺",
"store": "135.729 35.039"
},
{
"id": "2",
"name": u"銀閣寺",
"store": "135.798 35.026"
},
{
"id": "3",
"name": u"京都駅",
"store": "135.757 34.986"
}
])
solr.optimize()
if __name__ == '__main__':
main()
13年7月21日日曜日
Example: Searching
京都駅を中心, 周辺10km, キーワード: “寺”
http://localhost:8983/solr/collection1/select?
q={!geofilt score=distance sfield=store pt=34.986,2C135.757 d=10}
&fq=name:寺&sort=score asc&fl=*,score
13年7月21日日曜日
Example: Searching
docs: [
{
id: "2",
store: "135.798 35.026",
name: "銀閣寺",
score: 0.052228004
},
{
id: "1",
store: "135.729 35.039",
name: "金閣寺",
score: 0.057749357
}
]
score が中心点からの
距離(distance)
単位は degrees
13年7月21日日曜日
Units, Conversion
距離の単位変換はSolr Wikiを参考に
http://wiki.apache.org/solr/SolrAdaptersForLuceneSpatial4#Units.
2C_Conversion
Degrees to kilometers:
degrees * 111.1951
Degrees to miles:
degrees * 69.09341
13年7月21日日曜日
More Information
Solr Wiki: Spatial Search
http://wiki.apache.org/solr/SpatialSearch
Solr Wiki: Lucene / Solr 4 Spatial
http://wiki.apache.org/solr/SolrAdaptersForLuceneSpatial4
Github: spatial4j
https://github.com/spatial4j/spatial4j
13年7月21日日曜日

Más contenido relacionado

Último

Último (11)

LoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアルLoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
 
業務で生成AIを活用したい人のための生成AI入門講座(社外公開版:キンドリルジャパン社内勉強会:2024年4月発表)
業務で生成AIを活用したい人のための生成AI入門講座(社外公開版:キンドリルジャパン社内勉強会:2024年4月発表)業務で生成AIを活用したい人のための生成AI入門講座(社外公開版:キンドリルジャパン社内勉強会:2024年4月発表)
業務で生成AIを活用したい人のための生成AI入門講座(社外公開版:キンドリルジャパン社内勉強会:2024年4月発表)
 
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
 
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
 
LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイス
LoRaWANスマート距離検出センサー  DS20L  カタログ  LiDARデバイスLoRaWANスマート距離検出センサー  DS20L  カタログ  LiDARデバイス
LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイス
 
Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)
Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)
Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)
 
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
 
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
 
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
 
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
 
新人研修 後半 2024/04/26の勉強会で発表されたものです。
新人研修 後半        2024/04/26の勉強会で発表されたものです。新人研修 後半        2024/04/26の勉強会で発表されたものです。
新人研修 後半 2024/04/26の勉強会で発表されたものです。
 

Destacado

Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Destacado (20)

Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 

Apache Solr v4 Spatial Search