SemanticSearchImplementation
Public Member Functions | List of all members
SemanticSearchImplementation.ISearchClient Interface Reference

Provides all necessary functions to implement a document-based search engine. More...

Inheritance diagram for SemanticSearchImplementation.ISearchClient:
SemanticSearchImplementation.ElasticsearchSearchClient

Public Member Functions

Task< IDictionary< string, string > > GetMappingAsync ()
 Queries the mappings of the current index. More...
 
Task CreateIndexAsync (JObject content, string index)
 Creates an index with the given settings and mappings. More...
 
Task AddDocumentsAsync (IEnumerable< JObject > documents)
 Adds the given documents as a bulk upload. More...
 
Task SwitchAliasAsync (string from, string to)
 Changes the alias from the old to the new index. More...
 
Task DeleteIndexAsync (string index)
 Deletes the given index. More...
 
Task AddDocumentAsync (string graphName, IDictionary< string, JObject > documents)
 Adds/updates a new document and possibly changes existing documents. More...
 
Task DeleteDocumentAsync (string graphName, IDictionary< string, JObject > documents)
 Deletes a document and possibly changes other existing documents. More...
 
void ChangeIndex (string index)
 Updates the current index. More...
 
Task< IDictionary< string, double > > SearchAsync (string query, IEnumerable< string > projects, bool advanced, int size, int from, string sorting)
 Searches the index using the alias. More...
 

Detailed Description

Provides all necessary functions to implement a document-based search engine.

Member Function Documentation

◆ AddDocumentAsync()

Task SemanticSearchImplementation.ISearchClient.AddDocumentAsync ( string  graphName,
IDictionary< string, JObject >  documents 
)

Adds/updates a new document and possibly changes existing documents.

Additional rules can influence the mapping of existing metadata graphs.

Parameters
graphNameID of the metadata graph to be added/updated.
documentsA dictionary containing the ID of metadata graphs (key) and corresponding JSON objects (value).
Returns
A task that represents the asynchronous save operation.

Implemented in SemanticSearchImplementation.ElasticsearchSearchClient.

◆ AddDocumentsAsync()

Task SemanticSearchImplementation.ISearchClient.AddDocumentsAsync ( IEnumerable< JObject >  documents)

Adds the given documents as a bulk upload.

Parameters
documentsAn enumerator of all documents as JSON object.
Returns
A task that represents the asynchronous save operation.

Implemented in SemanticSearchImplementation.ElasticsearchSearchClient.

◆ ChangeIndex()

void SemanticSearchImplementation.ISearchClient.ChangeIndex ( string  index)

Updates the current index.

Parameters
indexName of new current index.

Implemented in SemanticSearchImplementation.ElasticsearchSearchClient.

◆ CreateIndexAsync()

Task SemanticSearchImplementation.ISearchClient.CreateIndexAsync ( JObject  content,
string  index 
)

Creates an index with the given settings and mappings.

Parameters
contentJSON object containing the settings and mappings.
indexThe index name.
Returns
A task that represents the asynchronous save operation.

Implemented in SemanticSearchImplementation.ElasticsearchSearchClient.

◆ DeleteDocumentAsync()

Task SemanticSearchImplementation.ISearchClient.DeleteDocumentAsync ( string  graphName,
IDictionary< string, JObject >  documents 
)

Deletes a document and possibly changes other existing documents.

Additional rules can influence the mapping of existing metadata graphs.

Parameters
graphNameID of the metadata graph to be deleted.
documentsA dictionary containing the ID of metadata graphs (key) and corresponding JSON objects (value).
Returns
A task that represents the asynchronous delete operation.

Implemented in SemanticSearchImplementation.ElasticsearchSearchClient.

◆ DeleteIndexAsync()

Task SemanticSearchImplementation.ISearchClient.DeleteIndexAsync ( string  index)

Deletes the given index.

Parameters
indexName of the index.
Returns
A task that represents the asynchronous delete operation.

Implemented in SemanticSearchImplementation.ElasticsearchSearchClient.

◆ GetMappingAsync()

Task<IDictionary<string, string> > SemanticSearchImplementation.ISearchClient.GetMappingAsync ( )

Queries the mappings of the current index.

Returns
A dictionary containing the fields and corresponding types.

Implemented in SemanticSearchImplementation.ElasticsearchSearchClient.

◆ SearchAsync()

Task<IDictionary<string, double> > SemanticSearchImplementation.ISearchClient.SearchAsync ( string  query,
IEnumerable< string >  projects,
bool  advanced,
int  size,
int  from,
string  sorting 
)

Searches the index using the alias.

Parameters
queryThe search query of the user.
projectsList of allowed projects (of a user).
advancedFlag to specify simple or advanced search syntax.
sizeNumber of results.
fromPosition from which the results should be returned.
sortingSorting of the results (see https://www.elastic.co/guide/en/elasticsearch/reference/current/sort-search-results.html).
Returns
The task result contains a dictionary containing the IDs of the found metadata graphs (key) and the corresponding ranking (value).

Implemented in SemanticSearchImplementation.ElasticsearchSearchClient.

◆ SwitchAliasAsync()

Task SemanticSearchImplementation.ISearchClient.SwitchAliasAsync ( string  from,
string  to 
)

Changes the alias from the old to the new index.

Parameters
fromName of old index.
toName of new index.
Returns

Implemented in SemanticSearchImplementation.ElasticsearchSearchClient.


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