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.
lucene_tool.h File Reference
#include "uuid_defs.h"
#include "lucene_library.h"
#include "typedefs.h"
#include "string_hash_table.h"
#include "linked_list.h"
#include "lucene_document.h"
#include "grassroots_server.h"
#include "service_job.h"
Include dependency graph for lucene_tool.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  LuceneTool
 A Tool for running Lucene jobs. More...
 

Enumerations

enum  QueryMode { QM_PARSER, QM_TERMS, QM_NUM_MODES }
 The internal method that the Lucene engine will use to build the query to search for. More...
 

Functions

const LUCENE_TOOL_PREFIX char *LT_EXACT_SEARCH_OP_S LUCENE_TOOL_VAL ("=")
 
const LUCENE_TOOL_PREFIX char *LT_NUM_TOTAL_HITS_S LUCENE_TOOL_VAL ("total_hits")
 
const LUCENE_TOOL_PREFIX char *LT_HITS_START_INDEX_S LUCENE_TOOL_VAL ("from")
 
const LUCENE_TOOL_PREFIX char *LT_HITS_END_INDEX_S LUCENE_TOOL_VAL ("to")
 
const LUCENE_TOOL_PREFIX char *LT_FACETS_S LUCENE_TOOL_VAL ("facets")
 
GRASSROOTS_LUCENE_API OperationStatus ParseLuceneResults (LuceneTool *tool_p, const uint32 from, const uint32 to, bool(*lucene_results_callback_fn)(const json_t *document_p, const uint32 index, void *data_p), void *data_p)
 
GRASSROOTS_LUCENE_API bool SetLuceneToolName (LuceneTool *tool_p, const char *name_s)
 
GRASSROOTS_LUCENE_API void SetLuceneToolId (LuceneTool *tool_p, uuid_t id)
 
GRASSROOTS_LUCENE_API bool AddLuceneFacetResultsToJSON (LuceneTool *tool_p, json_t *metadata_p)
 
GRASSROOTS_LUCENE_API bool AddFacetResultToLucene (LuceneTool *tool_p, const char *name_s, const uint32 count)
 
GRASSROOTS_LUCENE_API OperationStatus IndexData (struct ServiceJob *job_p, const json_t *data_to_index_p, const char *job_name_s)
 

Enumeration Type Documentation

◆ QueryMode

enum QueryMode

The internal method that the Lucene engine will use to build the query to search for.

Enumerator
QM_PARSER 

Use a org.apache.lucene.queryparser.classic.QueryParser to build the query by passing it a string and letting it determine how to build thw query.

QM_TERMS 

Create one or more Term/Phrase queries and programmatically combine them into a BooleanQuery.

QM_NUM_MODES 

The number of different QueryModes.

Function Documentation

◆ LUCENE_TOOL_VAL() [1/5]

const LUCENE_TOOL_PREFIX char* LT_EXACT_SEARCH_OP_S LUCENE_TOOL_VAL ( )

◆ LUCENE_TOOL_VAL() [2/5]

const LUCENE_TOOL_PREFIX char* LT_NUM_TOTAL_HITS_S LUCENE_TOOL_VAL ( "total_hits"  )

◆ LUCENE_TOOL_VAL() [3/5]

const LUCENE_TOOL_PREFIX char* LT_HITS_START_INDEX_S LUCENE_TOOL_VAL ( "from"  )

◆ LUCENE_TOOL_VAL() [4/5]

const LUCENE_TOOL_PREFIX char* LT_HITS_END_INDEX_S LUCENE_TOOL_VAL ( "to"  )

◆ LUCENE_TOOL_VAL() [5/5]

const LUCENE_TOOL_PREFIX char* LT_FACETS_S LUCENE_TOOL_VAL ( "facets"  )

◆ ParseLuceneResults()

GRASSROOTS_LUCENE_API OperationStatus ParseLuceneResults ( LuceneTool tool_p,
const uint32  from,
const uint32  to,
bool(*)(const json_t *document_p, const uint32 index, void *data_p)  lucene_results_callback_fn,
void *  data_p 
)

◆ SetLuceneToolName()

GRASSROOTS_LUCENE_API bool SetLuceneToolName ( LuceneTool tool_p,
const char *  name_s 
)

◆ SetLuceneToolId()

GRASSROOTS_LUCENE_API void SetLuceneToolId ( LuceneTool tool_p,
uuid_t  id 
)

◆ AddLuceneFacetResultsToJSON()

GRASSROOTS_LUCENE_API bool AddLuceneFacetResultsToJSON ( LuceneTool tool_p,
json_t *  metadata_p 
)

◆ AddFacetResultToLucene()

GRASSROOTS_LUCENE_API bool AddFacetResultToLucene ( LuceneTool tool_p,
const char *  name_s,
const uint32  count 
)

◆ IndexData()

GRASSROOTS_LUCENE_API OperationStatus IndexData ( struct ServiceJob job_p,
const json_t *  data_to_index_p,
const char *  job_name_s 
)