[
https://issues.apache.org/jira/browse/LUCENE-4069?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13285744#comment-13285744
]
Mark Harwood commented on LUCENE-4069:
--------------------------------------
This fails if you add docs with title and text fields:
{code:title=ThisCrashes.java}
Codec fooCodec=new Lucene40Codec() {
@Override
public PostingsFormat getPostingsFormatForField(String field) {
if ("text".equals(field)) {
return new MemoryPostingsFormat(false);
}
if ("title".equals(field)) {
return new MemoryPostingsFormat(true);
}
else {
return super.getPostingsFormatForField(field);
}
}
};
{code}
Exception in thread "main" java.io.IOException: Cannot overwrite:
C:\temp\luceneCodecs\_2_Memory.ram
This also fails:
{code:title=ThisToo.java}
Codec fooCodec=new Lucene40Codec() {
SimpleTextPostingsFormat theSimple = new SimpleTextPostingsFormat();
@Override
public PostingsFormat getPostingsFormatForField(String field) {
if ("text".equals(field)) {
return new SimpleTextPostingsFormat();
}
if ("title".equals(field)) {
return new SimpleTextPostingsFormat();
}
else {
return super.getPostingsFormatForField(field);
}
}
};
{code}
with
Exception in thread "main" java.io.IOException: Cannot overwrite:
C:\temp\luceneCodecs\_1_SimpleText.pst
Whereas sharing the same instance of a PostingsFormat class across fields works:
{code:title=ThisWorks.java}
Codec fooCodec=new Lucene40Codec() {
SimpleTextPostingsFormat theSimple = new SimpleTextPostingsFormat();
@Override
public PostingsFormat getPostingsFormatForField(String field) {
if (("text".equals(field))|| ("title".equals(field))) {
return theSimple;
}
else {
return super.getPostingsFormatForField(field);
}
}
};
{code}
> Segment-level Bloom filters for a 2 x speed up on rare term searches
> --------------------------------------------------------------------
>
> Key: LUCENE-4069
> URL: https://issues.apache.org/jira/browse/LUCENE-4069
> Project: Lucene - Java
> Issue Type: Improvement
> Components: core/index
> Affects Versions: 3.6, 4.0
> Reporter: Mark Harwood
> Priority: Minor
> Fix For: 4.0, 3.6.1
>
> Attachments: BloomFilterCodec40.patch,
> MHBloomFilterOn3.6Branch.patch, PrimaryKey40PerformanceTestSrc.zip
>
>
> An addition to each segment which stores a Bloom filter for selected fields
> in order to give fast-fail to term searches, helping avoid wasted disk access.
> Best suited for low-frequency fields e.g. primary keys on big indexes with
> many segments but also speeds up general searching in my tests.
> Overview slideshow here:
> http://www.slideshare.net/MarkHarwood/lucene-bloomfilteredsegments
> Benchmarks based on Wikipedia content here: http://goo.gl/X7QqU
> Patch based on 3.6 codebase attached.
> There are no 3.6 API changes currently - to play just add a field with "_blm"
> on the end of the name to invoke special indexing/querying capability.
> Clearly a new Field or schema declaration(!) would need adding to APIs to
> configure the service properly.
> Also, a patch for Lucene4.0 codebase introducing a new PostingsFormat
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]