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_document.h
Go to the documentation of this file.
1 /*
2 ** Copyright 2014-2016 The Earlham Institute
3 **
4 ** Licensed under the Apache License, Version 2.0 (the "License");
5 ** you may not use this file except in compliance with the License.
6 ** You may obtain a copy of the License at
7 **
8 ** http://www.apache.org/licenses/LICENSE-2.0
9 **
10 ** Unless required by applicable law or agreed to in writing, software
11 ** distributed under the License is distributed on an "AS IS" BASIS,
12 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 ** See the License for the specific language governing permissions and
14 ** limitations under the License.
15 */
16 
22 #include "jansson.h"
23 
24 #include "lucene_library.h"
25 #include "typedefs.h"
26 
27 
28 
29 
36 typedef struct LuceneDocument
37 {
38  json_t *ld_store_p;
39 
41 
42 
43 
44 
45 
46 #ifdef __cplusplus
47 extern "C"
48 {
49 #endif
50 
62 
63 
71 
72 
74 
75 
82 GRASSROOTS_LUCENE_API bool AddFieldToLuceneDocument (LuceneDocument *doc_p, const char *key_s, const char *value_s);
83 
84 
85 
86 GRASSROOTS_LUCENE_API size_t GetDocumentFieldSize (const LuceneDocument *doc_p, const char *key_s);
87 
88 
89 GRASSROOTS_LUCENE_API bool IsDocumentFieldMultiValued (const LuceneDocument *doc_p, const char *key_s, size_t *num_values_p);
90 
91 
92 GRASSROOTS_LUCENE_API const char *GetDocumentFieldValue (const LuceneDocument *doc_p, const char *key_s);
93 
94 
95 GRASSROOTS_LUCENE_API const char *GetDocumentFieldMultiValue (const LuceneDocument *doc_p, const char *key_s, size_t index);
96 
97 
GetDocumentFieldMultiValue
const GRASSROOTS_LUCENE_API char * GetDocumentFieldMultiValue(const LuceneDocument *doc_p, const char *key_s, size_t index)
GetCopyOfDocuemnt
GRASSROOTS_LUCENE_API json_t * GetCopyOfDocuemnt(const LuceneDocument *doc_p)
LuceneDocument
A datatype for holding Lucene Documents.
Definition: lucene_document.h:36
LuceneDocument::FreeLuceneDocument
GRASSROOTS_LUCENE_API void FreeLuceneDocument(LuceneDocument *doc_p)
Free a LuceneDocument.
GRASSROOTS_LUCENE_API
#define GRASSROOTS_LUCENE_API
Definition: lucene_library.h:46
LuceneDocument::AddFieldToLuceneDocument
GRASSROOTS_LUCENE_API bool AddFieldToLuceneDocument(LuceneDocument *doc_p, const char *key_s, const char *value_s)
Add a field to a LuceneDocument.
LuceneDocument::AllocateLuceneDocument
GRASSROOTS_LUCENE_API LuceneDocument * AllocateLuceneDocument(void)
Allocate a LuceneDocument.
typedefs.h
GetDocumentFieldValue
const GRASSROOTS_LUCENE_API char * GetDocumentFieldValue(const LuceneDocument *doc_p, const char *key_s)
GetDocumentFieldSize
GRASSROOTS_LUCENE_API size_t GetDocumentFieldSize(const LuceneDocument *doc_p, const char *key_s)
ClearLuceneDocument
GRASSROOTS_LUCENE_API void ClearLuceneDocument(LuceneDocument *doc_p)
IsDocumentFieldMultiValued
GRASSROOTS_LUCENE_API bool IsDocumentFieldMultiValued(const LuceneDocument *doc_p, const char *key_s, size_t *num_values_p)
LuceneDocument::ld_store_p
json_t * ld_store_p
Definition: lucene_document.h:38
lucene_library.h