Having some trouble running tests with custom codec

2015-10-09 Thread Sigbjørn Lund Olsen
As part of my master's thesis I am planning on implementing a custom Lucene
codec for compression experiments.

To get started with my prototype, I've tried following the instructions
here (but using the more recent Lucene 5.3.1):

http://opensourceconnections.com/blog/2013/06/05/build-your-own-lucene-codec/


However, I am having some trouble getting the codec to load when running
Lucene tests.

I've uploaded a minimal project at https://github.com/sigbjornlo/codecs

Running *mvn package* generates a jar with a file
*META-INF/services/org.apache.lucene.codecs.Codec* containing a single line:

edu.ntnu.sigbjornlo.codecs.HelloCodec

...which is where the codec class resides at. It's just a FilterCodec
subclass that does nothing extra.

Running *ant -Dtestcase=TestSegmentTermDocs -Dtests.codec=HelloCodec -lib
/path/to/hello-1.0.jar* test gives me the following error:

java.lang.IllegalArgumentException: An SPI class of type
org.apache.lucene.codecs.Codec with name 'HelloCodec' does not exist. You
need to add the corresponding JAR file supporting this SPI to your
classpath. The current classpath supports the following names: [SimpleText,
Asserting, CheapBastard, FastCompressingStoredFields,
FastDecompressionCompressingStoredFields,
HighCompressionCompressingStoredFields, DummyCompressingStoredFields,
Lucene53]

What might I be doing wrong here? Is there any way to make Lucene's SPI
loader log what it's trying and/or failing to load, and why?
(Be adviced: I have also asked this question on StackOverflow:
http://stackoverflow.com/questions/33039973/how-to-configure-lucene-to-use-a-custom-codec-from-external-jar
)

Sincerely,
Sigbjørn Lund Olsen


Re: Equivalent API in Lucene 5.x.x for ResultMode.setResultMode and ResultMode.setDepth

2015-10-09 Thread Gimantha Bandara
any help on this please?

On 10/6/15, Gimantha Bandara  wrote:
> Hi,
>
> I want to get the top categories (all the categories) recursively in one
> call. I know that in Lucene 4.x.x we can simply set the ResultMode to
> PER_NODE_IN_TREE [1] and set the depth, so we can get the categories
> recursively to the level we want in the tree. How do I achieve the same in
> Lucene 5.2.1?
>
> [1] http://shaierera.blogspot.com/2012/12/lucene-facets-under-hood.html
> Thanks,
>


-- 
Gimantha Bandara
Software Engineer
WSO2. Inc : http://wso2.com
Mobile : +94714961919

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