lucene-pylucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andi Vajda <va...@apache.org>
Subject Re: instantiating Set()
Date Wed, 09 Jun 2010 15:47:47 GMT

On Jun 9, 2010, at 8:36, "Dirk Rothe" <d.rothe@semantics.de> wrote:

> I'm trying to play with extractTerms() a method of the Query() class 
> [1]. This method expects a java Set<Term> instance - but  
> instantiating one failes with a NotImplementedError. Any clues whats  
> missing:

A Java Set is an interface and as such cannot be instantiated.  
Instead, use a Java class such as TreeSet or HashSet that implements  
this interface.

PyLucene also ships with PythonSet, a Java implentation of Set backed  
by a Python set. See module in PyLucene's python directory.

Andi..

>
> =================================================
> In [1]: import lucene
>
> In [2]: lucene.initVM()
> Out[2]: <jcc.JCCEnv object at 0x005BD3B0>
>
> In [3]: lucene.Se
> lucene.Searchable                     
> lucene.SegmentInfo                   lucene.SerialMergeScheduler
> lucene.Searcher                       
> lucene.SegmentInfos                  lucene.Serializable
> lucene.SecurityException             lucene.SegmentInfos 
> $FindSegmentsFile lucene.Set
> lucene.SecurityManager                
> lucene.SegmentReader                 lucene.SetBasedFieldSelector
>
> In [3]: lucene.Set
> Out[3]: <type 'Set'>
>
> In [4]: lucene.Set()
> --- 
> --- 
> ---------------------------------------------------------------------
> NotImplementedError                       Traceback (most recent  
> call last)
> ===================================================
>
> thnx, dirk
>
> [1] http://lucene.apache.org/java/3_0_1/api/all/org/apache/lucene/search/Query.html#extractTerms(java.util.Set)

Mime
View raw message