lucene-pylucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andi Vajda <>
Subject Re:
Date Tue, 12 Feb 2013 21:36:14 GMT

  Hi Thomas,

On Tue, 12 Feb 2013, Thomas Koch wrote:

> Thanks to your hints I was now able to build PyLucene4.1 and got further with the
- The imports should be OK now and most of the required changes are done I guess. However
I now reached another problem: I need to instantiate the class 'FacetsCollector' but get an
error when doing so:
>  File "samples/", line 222, in searchWithRequestAndQuery
>    facetsCollector = FacetsCollector(facetSearchParams, indexReader, taxoReader)
> NotImplementedError: ('instantiating java class', <type 'FacetsCollector'>)
> The java example has this line:
>    FacetsCollector facetsCollector = new FacetsCollector(facetSearchParams, indexReader,
> and javadocs state it has a public constructor:
> So what could be the reason for this behavior?

The FacetCollector class is declared abstract. Thus you can't instantiate 
it, constructor or not. I think the intent is to instantiate one of its 
concrete inner subclasses.
See lucene-java-4.1/lucene/facet/src/java/org/apache/lucene/facet/search/

> I have another problem with the constructor of FacetSearchParams: it is expecting arguments:
>  (List<FacetRequest> facetRequests, FacetIndexingParams indexingParams)
> but neither
> FacetSearchParams(Arrays.asList([facetRequest,]), indexingParams)
> nor
> FacetSearchParams([facetRequest,], indexingParams)
> does it here.  I get
> lucene.InvalidArgsError: (<type 'FacetSearchParams'>, '__init__', (<List: [root/a
nRes=10 nLbl=10]>, <FacetIndexingParams: org.apache.lucene.facet.params.FacetIndexingParams@f97ad3c0>))

There are four constructors on FacetSearchParams, none of which seems to match your call:
   public FacetSearchParams(FacetRequest... facetRequests)
   public FacetSearchParams(List<FacetRequest> facetRequests)
   public FacetSearchParams(FacetIndexingParams indexingParams, FacetRequest... facetRequests)
   public FacetSearchParams(FacetIndexingParams indexingParams, List<FacetRequest> facetRequests)

See lucene-java-4.1/lucene/facet/src/java/org/apache/lucene/facet/params/

You seem to be passing FacetIndexingParams last.


> I thought that JavaList could help, but I cannot import it:
>>>> from lucene.collections import JavaList
> Traceback (most recent call last):
>  File "<stdin>", line 1, in <module>
>  File "/Users/koch/.virtualenvs/pylucene/lib/python2.7/site-packages/lucene-4.1-py2.7-macosx-10.8-x86_64.egg/lucene/",
line 17, in <module>
>    from org.apache.pylucene.util import \
> ImportError: No module named pylucene.util
> That's probably because I had to disable in Makefile
> ## JARS+=$(HIGHLIGHTER_JAR)        # needs memory contrib
> ## JARS+=$(EXTENSIONS_JAR)         # needs highlighter contrib
> Do you think that's a type cast issue and that JavaList would help here?
> I need to define a 'typed' list , e.g. List<FacetRequest>
> FacetSearchParams API docs:
> Current version of
> Any hints?
> regards,
> Thomas
> --
> Am 12.02.2013 um 09:19 schrieb Andi Vajda <>:
>> On Tue, 12 Feb 2013, Andi Vajda wrote:
>>> Indeed. I reproduced that error here.
>>> A new method was added to the FieldCache.Parser interface.
>>> I added it to the classes missing it (rev 1445048).
>>> I then found that the test case from hell,, has majorly changed
again and needs to be ported again. Sigh.
>> That being said, you should be able to build PyLucene 4.1 again and proceed with The needed work shouldn't be blocking you.
>> Andi..

View raw message