【问题标题】:Can we index graph databases using solr?我们可以使用 solr 索引图形数据库吗?
【发布时间】:2016-10-08 06:40:11
【问题描述】:

我需要使用 solr 索引一个图形数据库(Titan,Cassandra 作为后端)。这个可以吗?

【问题讨论】:

    标签: search indexing solr lucene titan


    【解决方案1】:

    根据其documentation,Titan 支持使用 Solr 作为索引后端来做:

    • 全文:支持所有文本谓词来搜索与给定单词、前缀或正则表达式匹配的文本属性。
    • Geo:支持 Geo.WITHIN 条件来搜索落在给定圆内的点。仅支持点索引和圆查询。
    • 数值范围:支持 Compare 中的所有数值比较。
    • TTL:支持自动过期的索引元素。
    • 时间:毫秒粒度的时间索引。

    如果您在 Titan 中定义一个使用 Solr 作为索引后端的 mixed index,Titan 会将这些数据放入 Solr 中以进行索引。您应该仍然可以通过 Solr 直接访问该数据。 Titan 文档中的示例仅显示如何通过图形访问数据,因为这就是 Titan 的用途:图形。 Solr 不会用于存储整个图形数据结构,仅用于存储混合索引的内容。

    有关如何一起使用 Titan 和 Solr,请参阅 Titan 文档。

    【讨论】:

    • 我浏览了文档。据我了解,在 Titan 中使用 solr 作为后端创建的索引将仅用于 Titan 中的搜索查询。我想使用 solr webapp 来索引数据(因为我们使用数据导入索引 sql db),这样我就可以提供 solr REST 服务来搜索该数据。如果我错了,请纠正我。
    【解决方案2】:

    请记住,Solr 只是一个平面文档集合。它不关心这些文档之间的关系。

    这是一起使用 Cassandra 和 Solr 的人的幻灯片分享

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

    数据被发送到 Cassandra,然后 Cassandra 将其发送到 Solr 进行索引。 Solr 支持对 Cassandra 数据进行全文搜索,这将是一个很好的用例,即使与 Titan 混合使用。

    【讨论】:

    • 是的,我知道平面文档的限制。但我想将关系索引为原子文档(我们使用连接实现相同的 sql db)。我们目前维护 Titan 中的关系,我想索引它们。 Cassandra 是 Titan 的后端,Cassandra 中的数据和列族由 Titan 管理。我不能直接索引它们。
    【解决方案3】:

    可以使用 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" 部分应与您的应用程序中的索引名称相同。

    【讨论】:

      猜你喜欢
      • 2020-04-21
      • 2016-05-20
      • 2016-01-04
      • 2014-10-25
      • 1970-01-01
      • 1970-01-01
      • 2023-03-22
      • 2012-12-03
      • 2011-12-20
      相关资源
      最近更新 更多