Thanks Marvin and Peter for your comments.

I tried to make the library work for Lexicons, but I am receiving a
Segfault. I believe I am not able to initialize the LexiconReader
correctly. I could not find any samples anywhere. I put my code snippet to
the end of the message. As I mentioned earlier, I simply would like to have
an access to the tokens for a specific field. Those fields do not have any

I have a few questions for the following code snippet. In order to create a
LexiconReader*, I create IndexReader. Then I initialize the LexReader. I am
really suspicious on what I am doing, because LexReader_init method takes a
LexReader (self) as argument and return the LexReader. In order to do this
I had to malloc a LexiconReader pointer, otherwise LexReader_init fails.
Since sizeof(lucy_LexiconReader) fails, I malloc with 10000 bytes. The
program crashes at line:
lucy_Lexicon * lexicon = LexReader_Lexicon(lexiconReader, field_str,
(cfish_Obj*) term_str);.

The lldb output for this crash is below.

Is anyone able to see what I am doing wrong here.

Thanks in advance,

    frame #0: 0x00000001000036ab
field=0x0000000100508910, term=0x00000001005086e0) + 27 at
   272 extern LUCY_VISIBLE uint32_t LUCY_LexReader_Lexicon_OFFSET;
   273 static CFISH_INLINE lucy_Lexicon*
   274 LUCY_LexReader_Lexicon(lucy_LexiconReader* self, cfish_String*
field, cfish_Obj* term) {
-> 275    const LUCY_LexReader_Lexicon_t method =
   276    return method(self, field, term);
   277 }
(lldb) n
Process 68332 stopped
* thread #1: tid = 0x17272f5, 0x000000010000549f
testSuggester`cfish_method(klass=0x0000000000000000, offset=192) + 31 at
cfish_parcel.h:108, queue = '', stop reason =
EXC_BAD_ACCESS (code=1, address=0xc0)
    frame #0: 0x000000010000549f
testSuggester`cfish_method(klass=0x0000000000000000, offset=192) + 31 at
   105 cfish_method(const void *klass, uint32_t offset) {
   106    union { char *cptr; cfish_method_t *fptr; } ptr;
   107    ptr.cptr = (char*)klass + offset;
-> 108    return ptr.fptr[0];
   109 }
lucy_FSFolder *folder = lucy_FSFolder_new(folder_str);
lucy_IndexReader *indexReader = lucy_IxReader_open((cfish_Obj *)
folder_str, NULL, NULL);
cfish_Vector *segments = IxReader_Get_Segments(indexReader);
lucy_Snapshot *snapshot = IxReader_Get_Snapshot(indexReader);
int32_t seg_tick = IxReader_Get_Seg_Tick(indexReader);

//sizeof does not work for lexiconreader or for datareader. Put 10000 for
lucy_LexiconReader * lexiconReader = (lucy_LexiconReader*) malloc(10000);
lucy_LexReader_init(lexiconReader, schema, (lucy_Folder*) folder, snapshot,
segments, seg_tick);
cfish_String *field_str = Str_newf(field);
cfish_String *term_str = Str_newf(term);
lucy_Lexicon * lexicon = LexReader_Lexicon(lexiconReader, field_str,
(cfish_Obj*) term_str);

char *out;

cfish_Obj *out_str = Lex_Get_Term(lexicon);
out = Str_To_Utf8((cfish_String*) out_str);
printf("%s\n", out);
while(Lex_Next(lexicon)) {
cfish_Obj *out_str = Lex_Get_Term(lexicon);
out = Str_To_Utf8((cfish_String*) out_str);
printf("%s\n", out);
On Wed, May 3, 2017 at 2:30 PM, Peter Karman <[EMAIL PROTECTED]> wrote:
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB