Semantic MediaWiki and related extensions
Public Member Functions | Public Attributes | List of all members
SMW\Elastic\Indexer\FileIndexer Class Reference

Public Member Functions

 __construct (Store $store, EntityCache $entityCache, FileHandler $fileHandler, FileAttachment $fileAttachment)
 
 setOrigin ( $origin)
 
 setVersions (array $versions)
 
 getIndexName ( $type)
 
 noSha1Check ()
 
 findFile (Title $title)
 
 index (DIWikiPage $dataItem, File $file=null)
 

Public Attributes

const INGEST_RESPONSE = 'es.ingest.response'
 

Detailed Description

File indexer to use the Elasticsearch ingest pipeline to index and retrieve data from an file (aka. attachment) and make the file content searchable outside of a normal wiki content (i.e. the indexed data is only stored in Elasticsearch).

GNU GPL v2+

Since
3.0
Author
mwjames

Constructor & Destructor Documentation

◆ __construct()

SMW\Elastic\Indexer\FileIndexer::__construct ( Store  $store,
EntityCache  $entityCache,
FileHandler  $fileHandler,
FileAttachment  $fileAttachment 
)
Since
3.0
Parameters
Indexer$indexer
EntityCache$entityCache
FileHandler$fileHandler
FileAttachment$fileAttachment

Member Function Documentation

◆ findFile()

SMW\Elastic\Indexer\FileIndexer::findFile ( Title  $title)
Since
3.1
Parameters
Title$title
Returns
File

◆ getIndexName()

SMW\Elastic\Indexer\FileIndexer::getIndexName (   $type)
Since
3.0
Parameters
string$type
Returns
string

◆ index()

SMW\Elastic\Indexer\FileIndexer::index ( DIWikiPage  $dataItem,
File  $file = null 
)

The ES ingest pipeline only does create (not update) index content which means any other content is deleted after the ingest process has finished therefore:

  • Read the document before, and retrieve any annotations that exists for that entity
  • Let ES ingest the file content and attach the earlier retrieved annotations
  • SMW doesn't know anything about the file attachment details ES has gather from the file hence update the SQLStore (!important not the ElasticStore) with the data
  • After the SQLStore update make sure that those attachment details (which are represented as subobject) are added to ES manually (means not through the standard Store::updateData to avoid an update circle) otherwise there will be invisible the any SMW user
Since
3.0
Parameters
DIWikiPage$dataItem
File | null$file

◆ noSha1Check()

SMW\Elastic\Indexer\FileIndexer::noSha1Check ( )
Since
3.0

◆ setOrigin()

SMW\Elastic\Indexer\FileIndexer::setOrigin (   $origin)
Since
3.0
Parameters
string$origin

◆ setVersions()

SMW\Elastic\Indexer\FileIndexer::setVersions ( array  $versions)
Since
3.0
Parameters
[]$versions

The documentation for this class was generated from the following file:

About | General disclaimer | Privacy policy