lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grant Ingersoll <gsing...@apache.org>
Subject Re: Is it possible to retrieve Terms from a Document?
Date Sat, 01 Aug 2009 02:30:50 GMT
See the Term Vector capability. http://www.lucidimagination.com/search/?q=term+vectors#/ 
p:lucene

By default the information is _not_ stored in the index.  You will  
need to add Field.TermVector.YES to your indexing in order for this  
information to be available.

-Grant

On Jul 31, 2009, at 8:15 PM, Phil Whelan wrote:

> Hi,
>
> I know you can use Field.Store.YES, but I want to inspect the terms /
> tokens and their order related to the field name at search time. Is
> this possible? Obviously this information is stored in the index, but
> I can not find any API to access it. I'm guessing the answer might be
> that Terms point to a Document and not the other way around. Is this
> right?
>
> eg.
> Document doc = .... ;
> Term[] terms = doc.getTerms();
>
> Or...
> String[] values = doc.getTermValues();
>
> Thanks,
> Phil
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>

--------------------------
Grant Ingersoll
http://www.lucidimagination.com/

Search the Lucene ecosystem (Lucene/Solr/Nutch/Mahout/Tika/Droids)  
using Solr/Lucene:
http://www.lucidimagination.com/search


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message