SystemComponent "Resource Indexer Classes"

From FindAndLearn::Cookbook
C0629663338
Jump to: navigation, search


CanBeDeveloped Yes

Learn how to include custom indexers.

A custom indexer class must be implemented in accordance with this templates:

As used by Rails app when hit by e.g. Go app (on fact any TIKA data)

# dataspects-indexing-service/lib/indexers/YourIndexerClasses/your_first_indexer.rb
class YourFirstIndexer < Dataspects::Indexer

  def initialize
    @indexName =
    super
  end

  def store_to_index(document)

  end

end

Others

Requirements:

  1. Access to tika and es
  2. dataspects Ruby Gem
# [email protected]:~$ YourIndexerClasses/cfln_indexer.rb
class CFLNIndexer < Dataspects::Indexer

  def initialize(tika_url, escluster_url)
    @indexName =
    super
  end

  def sitemap_urls
    # From https://www.xml-sitemaps.com/
  end

  def store_to_index(document)

  end

end

myIndexingClass = CFLNIndexer.new(tika_url, escluster_url)
myIndexingClass.sitemap_urls.each do |document|
  store_to_index(document)
end
[email protected]:~/YourIndexerClasses$ ruby your_second_indexer.rb