I need to get the title of a page in BoostingStrategy. I’m able to get it byaccessing the reader directly however accessing the title via the recommended way using the FieldCache returns just a word which is sometimes kind of related to the title but not the title itself. What do I miss?
BytesRef titleBuffer = new BytesRef();
FieldCache.DEFAULT.getTerms(subReader, "title").get(doc - subReaderContext.docBase, titleBuffer);
String title = titleBuffer.utf8ToString();
thank you very much for your help. Doing it your way shows other field names than going via reader.document - interesting. I was now able to use the field “content-name-untokenized” which contains the full title.