You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Allison, Timothy B." <ta...@mitre.org> on 2014/03/19 13:53:20 UTC

ensuring codec can index offsets in test framework

This is similar to David Smiley's question on Feb 16th, but SuppressCodecs would be too broad of a solution, I think.



I'm using LuceneTestCase's newIndexWriterConfig, and I have a test that requires IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS.  The test passes quite often (famous last words), but I occasionally get an UnsupportedOperationException: this codec cannot index offsets.



Is there a way to have LuceneTestCase randomly select a codec (with particular subcomponents/configurations) that supports indexing offsets?



The codec that fails:



codec=Lucene46: {f1:MockVariableIntBlock(baseBlockSize=71)}, docValues:{}, ...



Most often, however Lucene46 does not fail.

RE: ensuring codec can index offsets in test framework

Posted by "Allison, Timothy B." <ta...@mitre.org>.
Perfect.  As always, thank you.

________________________________________
From: Robert Muir [rcmuir@gmail.com]
Sent: Wednesday, March 19, 2014 10:29 AM
To: dev@lucene.apache.org
Subject: Re: ensuring codec can index offsets in test framework

for now you can use an assume, there is a helper in LuceneTestCase:

String pf = TestUtil.getPostingsFormat("dummy");
boolean supportsOffsets = !doesntSupportOffsets.contains(pf);

another option is to suppress the codecs that don't support it
(anything using Sep layout).

This is annoying though, maybe we should remove Sep layout?
Realistically it was the precursor to the block layout that Lucene41
introduced, which was a big change, but i am unsure if its really
helping us anymore, because it just falls behind on things and i dont
think has any "interesting" qualities for real use or that would be
useful in testing, either..

On Wed, Mar 19, 2014 at 8:53 AM, Allison, Timothy B. <ta...@mitre.org> wrote:
> This is similar to David Smiley's question on Feb 16th, but SuppressCodecs
> would be too broad of a solution, I think.
>
>
>
> I'm using LuceneTestCase's newIndexWriterConfig, and I have a test that
> requires IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS.  The test
> passes quite often (famous last words), but I occasionally get an
> UnsupportedOperationException: this codec cannot index offsets.
>
>
>
> Is there a way to have LuceneTestCase randomly select a codec (with
> particular subcomponents/configurations) that supports indexing offsets?
>
>
>
> The codec that fails:
>
>
>
> codec=Lucene46: {f1:MockVariableIntBlock(baseBlockSize=71)}, docValues:{},
> ...
>
>
>
> Most often, however Lucene46 does not fail.

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


Re: ensuring codec can index offsets in test framework

Posted by Robert Muir <rc...@gmail.com>.
for now you can use an assume, there is a helper in LuceneTestCase:

String pf = TestUtil.getPostingsFormat("dummy");
boolean supportsOffsets = !doesntSupportOffsets.contains(pf);

another option is to suppress the codecs that don't support it
(anything using Sep layout).

This is annoying though, maybe we should remove Sep layout?
Realistically it was the precursor to the block layout that Lucene41
introduced, which was a big change, but i am unsure if its really
helping us anymore, because it just falls behind on things and i dont
think has any "interesting" qualities for real use or that would be
useful in testing, either..

On Wed, Mar 19, 2014 at 8:53 AM, Allison, Timothy B. <ta...@mitre.org> wrote:
> This is similar to David Smiley's question on Feb 16th, but SuppressCodecs
> would be too broad of a solution, I think.
>
>
>
> I'm using LuceneTestCase's newIndexWriterConfig, and I have a test that
> requires IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS.  The test
> passes quite often (famous last words), but I occasionally get an
> UnsupportedOperationException: this codec cannot index offsets.
>
>
>
> Is there a way to have LuceneTestCase randomly select a codec (with
> particular subcomponents/configurations) that supports indexing offsets?
>
>
>
> The codec that fails:
>
>
>
> codec=Lucene46: {f1:MockVariableIntBlock(baseBlockSize=71)}, docValues:{},
> ...
>
>
>
> Most often, however Lucene46 does not fail.

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