Reputation: 3599
As the title, I have indexed emails, I stored email subject in lucene store field.
Now I want to perform a search by giving a subject, I found it nearly impossible to search by subject.
Upvotes: 0
Views: 108
Reputation: 33341
No, you can't search on that field. When you index a document with a StoredField
, that field will not be put into the search index in any way. It will only be stored with the document such that you can retrieve it from a document (usually, one found by searching other fields).
For an email subject, you should probably use TextField
, which can also be stored, if you wish, like:
Field subjectField = new TextField("subject", myEmailSubject, Field.Store.YES);
Upvotes: 2