0

For example, there is a word "apple", I want to know no of times it has occurred in different rows.

Thanks!

EDIT

I have a database that contains textual data of what people are talking about. For example: People1 : I like apple. People2 : I like apple and stackoverflow. Ignoring common words we can see that Topic1 is apple which is talked about by 2 people. Topic2 is stackoverflow which is talked about by 1 people.

I want the indexing engine to fetch all the topics which are talked the most. It is similar to finding trending topics.

Amit Kumar
  • 2,685
  • 2
  • 37
  • 72

1 Answers1

0

You cannot by default. Full text search is not about counting occurrences, but about finding the most suitable results (Documents in Lucene terminology). Also talking about rows in this context is misleading. You really need to talk about indexed content/fields.

That said, you can get access to the underlying Lucene resources in Hibernate Search. Among others you can get access to the IndexReader which should allow you to get a term frequency for a given term.

Slightly related, there is also a faceting API, but it deals with concrete values.

Really you would have to provide more context about the problem you are trying to solve.

Hardy
  • 18,659
  • 3
  • 49
  • 65