Grassroots Infrastructure
The Grassroots Infrastructure is a suite of computing tools to help users and developers use scientific data infrastructure that can easily be interconnected.
LuceneTool Struct Reference

A Tool for running Lucene jobs. More...

#include <lucene_tool.h>

Collaboration diagram for LuceneTool:
[legend]

Public Member Functions

const LUCENE_TOOL_PREFIX char *LUCENE_ID_S LUCENE_TOOL_VAL ("id")
 The identifier used to uniquely specify a Lucene document. More...
 
GRASSROOTS_LUCENE_API LuceneToolAllocateLuceneTool (GrassrootsServer *grassroots_p, uuid_t id)
 Allocate a LuceneTool to run searches with. More...
 
GRASSROOTS_LUCENE_API void FreeLuceneTool (LuceneTool *tool_p)
 Free a LuceneTool. More...
 
GRASSROOTS_LUCENE_API bool SearchLucene (LuceneTool *tool_p, const char *query_s, LinkedList *facets_p, const char *search_type_s, const uint32 page_index, const uint32 page_size, const QueryMode qm)
 Run a Lucene Search. More...
 
GRASSROOTS_LUCENE_API OperationStatus IndexLucene (LuceneTool *tool_p, const json_t *data_p, bool update_flag)
 Index data in Lucene. More...
 
GRASSROOTS_LUCENE_API OperationStatus DeleteLucene (LuceneTool *tool_p, const char *query_s, const QueryMode qm)
 Delete data in Lucene. More...
 
GRASSROOTS_LUCENE_API bool SetLuceneToolOutput (LuceneTool *tool_p, char *output_s)
 Set the name of the output file that the LuceneTool will write its results to. More...
 

Data Fields

char * lt_name_s
 
const char * lt_index_class_s
 
const char * lt_search_class_s
 
const char * lt_delete_class_s
 
const char * lt_classpath_s
 
const char * lt_index_s
 
const char * lt_taxonomy_s
 
const char * lt_working_directory_s
 
const char * lt_facet_key_s
 
char * lt_output_file_s
 
uint32 lt_num_total_hits
 
uint32 lt_hits_from_index
 
uint32 lt_hits_to_index
 
uuid_t lt_id
 
LinkedListlt_facet_results_p
 

Detailed Description

A Tool for running Lucene jobs.

Member Function Documentation

◆ LUCENE_TOOL_VAL()

const LUCENE_TOOL_PREFIX char *LUCENE_ID_S LUCENE_TOOL_VAL ( "id"  )

The identifier used to uniquely specify a Lucene document.

◆ AllocateLuceneTool()

GRASSROOTS_LUCENE_API LuceneTool * AllocateLuceneTool ( GrassrootsServer grassroots_p,
uuid_t  id 
)

Allocate a LuceneTool to run searches with.

Returns
A newly-allocated LuceneTool or NULL upon error.

◆ FreeLuceneTool()

GRASSROOTS_LUCENE_API void FreeLuceneTool ( LuceneTool tool_p)

Free a LuceneTool.

Parameters
tool_pThe LuceneTool to free.

◆ SearchLucene()

GRASSROOTS_LUCENE_API bool SearchLucene ( LuceneTool tool_p,
const char *  query_s,
LinkedList facets_p,
const char *  search_type_s,
const uint32  page_index,
const uint32  page_size,
const QueryMode  qm 
)

Run a Lucene Search.

Parameters
tool_pThe LuceneTool to run.
query_sThe query to run.
facets_pAn optional list of KeyValuePairNodes for facets to run with. This can be NULL
Returns
true if the LuceneTool ran successfully, false otherwise.

◆ IndexLucene()

GRASSROOTS_LUCENE_API OperationStatus IndexLucene ( LuceneTool tool_p,
const json_t *  data_p,
bool  update_flag 
)

Index data in Lucene.

Parameters
tool_pThe LuceneTool to index with.
data_pThe data to index
update_flagIf this is true then add to the current index. If this false, then the index will be cleared before indexing the given data.
Returns
The OperationStatus from running the indexing.

◆ DeleteLucene()

GRASSROOTS_LUCENE_API OperationStatus DeleteLucene ( LuceneTool tool_p,
const char *  query_s,
const QueryMode  qm 
)

Delete data in Lucene.

Parameters
tool_pThe LuceneTool to index with.
query_sThe query to run for deleting matching documents
Returns
The OperationStatus from running the deletion.

◆ SetLuceneToolOutput()

GRASSROOTS_LUCENE_API bool SetLuceneToolOutput ( LuceneTool tool_p,
char *  output_s 
)

Set the name of the output file that the LuceneTool will write its results to.

The LuceneTool makes a copy of the specified filename so it does not need to remain in scope.

Parameters
tool_pThe LuceneTool to set the output file for.
output_sThe name of the output file
Returns
true if the LuceneTool's output filename was updated successfully, false otherwise.

Field Documentation

◆ lt_name_s

char* lt_name_s

◆ lt_index_class_s

const char* lt_index_class_s

◆ lt_search_class_s

const char* lt_search_class_s

◆ lt_delete_class_s

const char* lt_delete_class_s

◆ lt_classpath_s

const char* lt_classpath_s

◆ lt_index_s

const char* lt_index_s

◆ lt_taxonomy_s

const char* lt_taxonomy_s

◆ lt_working_directory_s

const char* lt_working_directory_s

◆ lt_facet_key_s

const char* lt_facet_key_s

◆ lt_output_file_s

char* lt_output_file_s

◆ lt_num_total_hits

uint32 lt_num_total_hits

◆ lt_hits_from_index

uint32 lt_hits_from_index

◆ lt_hits_to_index

uint32 lt_hits_to_index

◆ lt_id

uuid_t lt_id

◆ lt_facet_results_p

LinkedList* lt_facet_results_p

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