2016-06-08 180 views

回答

1

請記住,Solr只是一個單位的文件集合。它不關心這些文件之間的關係。

這是誰家的幻燈片份額是誰在使用卡桑德拉和Solr一起

http://www.slideshare.net/planetcassandra/an-introduction-to-distributed-search-with-cassandra-and-solr

數據被髮送到卡桑德拉然後將其發送到Solr的索引。 Solr支持對Cassandra數據進行全文搜索,即使泰坦在混音中,這也是一個很好的用例。

+0

是的,我知道平面文件的約束。但我想將關係索引爲原子文檔(我們使用連接實現與sql db相同)。我們目前保持與泰坦之間的關係,我想索引它們。卡桑德拉是泰坦的後端,卡桑德拉的數據和柱子系由泰坦管理。我無法直接爲它們編制索引。 –

2

據其documentation,泰坦支持使用Solr的作爲索引後臺做:

  • 全文:支持所有文字謂詞來搜索一個給定的詞,前綴或常規匹配文本屬性表達。
  • 地理:支持Geo.WITHIN條件來搜索給定圓內的點。僅支持用於索引和圈子查詢的點。
  • 數字範圍:支持比較中的所有數字比較。
  • TTL:支持自動過期索引元素。
  • 時間:毫秒粒度時間索引。

如果你在Titan中定義了一個使用Solr作爲索引後端的mixed index,Titan會將這些數據放入Solr進行索引。您仍然應該能夠通過Solr直接訪問該數據。 Titan文檔中的示例僅顯示如何通過圖表訪問數據,因爲這是Titan的用途:graph。 Solr不會用於存儲整個圖形數據結構,只是混合索引的內容。

請參閱泰坦關於如何將Titan和Solr一起使用的文檔。

+0

我經歷了文檔。根據我的理解,在泰坦中使用solr作爲後端創建的索引只能用於Titan中的搜索查詢。我想使用solr webapp來索引數據(因爲我們使用數據導入來索引sql db),這樣我就可以提供solr REST服務來搜索這些數據。如果我錯了,請糾正我。 –

+0

更新了我的答案 –

1

可以將Solr用作Titan圖形數據庫的索引後端。爲此目的應該考慮一些不同的參數。這些參數如下。

# Configure a Solr backend named "search" at localhost:8983 
# and path prefix /solr/titan.solr1. 
# The collection must already exist -- see the manual for info. 
# The indexing backend used to extend and optimize Titan's query 
# functionality. This setting is optional. Titan can use multiple 
# heterogeneous index backends. Hence, this option can appear more than 
# once, so long as the user-defined name between "index" and "backend" is 
# unique among appearances.Similar to the storage backend, this should be 
# set to one of Titan's built-in shorthand names for its standard index 
# backends (shorthands: lucene, elasticsearch, es, solr) or to the full 
# package and classname of a custom/third-party IndexProvider 
# implementation. 
# 
# Default: elasticsearch 
# Data Type: String 
# Mutability: GLOBAL_OFFLINE 
# 
# Settings with mutability GLOBAL_OFFLINE are centrally managed in Titan's 
# storage backend. After starting the database for the first time, this 
# file's copy of this setting is ignored. Use Titan's Management System 
# to read or modify this value after bootstrapping. 
index.search.backend=solr 

# The operation mode for Solr which is either via HTTP (`http`) or using 
# SolrCloud (`cloud`) 
# 
# Default: cloud 
# Data Type: String 
# Mutability: GLOBAL_OFFLINE 
# 
# Settings with mutability GLOBAL_OFFLINE are centrally managed in Titan's 
# storage backend. After starting the database for the first time, this 
# file's copy of this setting is ignored. Use Titan's Management System 
# to read or modify this value after bootstrapping. 
index.search.solr.mode=http 

# List of URLs to use to connect to Solr Servers (LBHttpSolrClient is 
# used), don't add core or collection name to the URLS. 
# 
# Default: http://localhost:8983/solr 
# Data Type: class java.lang.String[] 
# Mutability: MASKABLE 
index.search.solr.http-urls=http://localhost:8983/solr/ 

請注意,"search"參加這些參數的名稱應該是相同應用程序中的索引名。

相關問題