【发布时间】:2016-10-08 06:40:11
【问题描述】:
我需要使用 solr 索引一个图形数据库(Titan,Cassandra 作为后端)。这个可以吗?
【问题讨论】:
标签: search indexing solr lucene titan
我需要使用 solr 索引一个图形数据库(Titan,Cassandra 作为后端)。这个可以吗?
【问题讨论】:
标签: search indexing solr lucene titan
根据其documentation,Titan 支持使用 Solr 作为索引后端来做:
如果您在 Titan 中定义一个使用 Solr 作为索引后端的 mixed index,Titan 会将这些数据放入 Solr 中以进行索引。您应该仍然可以通过 Solr 直接访问该数据。 Titan 文档中的示例仅显示如何通过图形访问数据,因为这就是 Titan 的用途:图形。 Solr 不会用于存储整个图形数据结构,仅用于存储混合索引的内容。
有关如何一起使用 Titan 和 Solr,请参阅 Titan 文档。
【讨论】:
请记住,Solr 只是一个平面文档集合。它不关心这些文档之间的关系。
这是一起使用 Cassandra 和 Solr 的人的幻灯片分享
数据被发送到 Cassandra,然后 Cassandra 将其发送到 Solr 进行索引。 Solr 支持对 Cassandra 数据进行全文搜索,这将是一个很好的用例,即使与 Titan 混合使用。
【讨论】:
可以使用 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" 部分应与您的应用程序中的索引名称相同。
【讨论】: