hurelhuyag
hurelhuyag

Reputation: 1753

How can I get lucene's docId from search result?

I'm implementing FastVectorHighlighter in my application. But It requires docId.

Upvotes: 0

Views: 32

Answers (1)

Guillaume Smet
Guillaume Smet

Reputation: 10519

You have to use a projection.

See this paragraph in the reference documentation: https://docs.jboss.org/hibernate/stable/search/reference/en-US/html_single/#projections You even have an example of how to do it.

See especially the FullTextQuery.DOCUMENT_ID projection.

Upvotes: 2

Related Questions