IndexingSetup "Indexing a file system directory"

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


Workflow

Carried out by Role "Search Engineer":

  1. Download dataspects-indexer
  2. Configure indexer-config.json
  3. Create my_fsd_indexer.rb
  4. Run dataspects-indexer

HasResourceSelectionCode

dataspects-indexer is a dataspects Go application that runs on any modern Linux, Windows or Mac.

[email protected]:~$ tree
.
├── dataspects-indexer
└── indexer-config.json

indexer-config.json

1 {
2   "FilenameRegex": ".pdf",
3   "RootFolder": "/home/someUser/documents_to_index/",
4   "IndexerClassName": "MyFileSystemDirectoryIndexer"
5   ...
6 }

HasResourceEnitizationCode

MyIndexerClasses is a code repository.

[email protected]:~$ tree
.
└── dataspects-indexing-service
    └── lib
        └── MyIndexerClasses
            └── my_fsd_indexer.rb

my_fsd_indexer.rb

1 class MyFileSystemDirectoryIndexer < Dataspects::Indexer
2   ...
3   def store_to_index(resource)
4 
5   end
6 end

HasIndexingExecutionCode

ShellCommand

[email protected]:~$ \
  ./dataspects-indexer \
    --config indexer-config.json \
    --indexer YourIndexerLabel