user349026
user349026

Reputation:

Lucene - Always necessary to provide Fields?

I was wondering if it is always necessary to provide fielded data to lucene before it can index the data? Or are there any options where non fielded data can be pushed to the index. Supposing I have a text file that contains text that has no fielded information and this needs to be indexed.

Thanks

Wajih

Upvotes: 0

Views: 39

Answers (1)

deceze
deceze

Reputation: 522041

Lucene behaves much like a traditional database, you need to define a schema. You can't put a text file into a database without specifying into which column in which table the text should go. In the same vein, you can just make a schema that contains a single field like text and put all your text file contents into that.

Upvotes: 1

Related Questions