tags:

views:

313

answers:

2

Hi! I'm working on a project for which I want to build a tag cloud by reading a Lucene index and pruning it down. I didn't set up the Lucene engine, it was someone else in the team, now I just want to read its index. Do you how to do that in Java?

+2  A: 

Not sure what you mean by "reading" an Index:

  1. If you want to query it you can use IndexSearcher class.

  2. IndexReader allows you to open the index in read mode.

If you want to view the contents of the index, you can use Luke

Mikos
Thanks! Luke seems like the solution I was looking for!
John Manak
+1  A: 

what you need to look for is how to use IndexReader class, the .terms() method will give you back all the terms in the index.

fuzzy lollipop
This looks even better! Is there any chance you know how to access the index if it's in the WEB-INF/index folder? I use OpenCMS and that's the default location.
John Manak
from the API docs.Concrete subclasses of IndexReader are usually constructed with a call to one of the static open() methods, e.g. open(String).
fuzzy lollipop