How can I read a Lucene document field tokens after they are analyzed?

前端 未结 1 1845
孤街浪徒
孤街浪徒 2021-01-21 09:24

If I create a document and add a field that is both stored and analyzed, how can I then read this field back as a list of tokens? I have the following:

                  


        
相关标签:
1条回答
  • 2021-01-21 10:00

    Check out document.getField("name").tokenStreamValue().

    EDIT: Actually this question gives you the full solution using the above TokenStream.

    0 讨论(0)
提交回复
热议问题