[ 
https://issues.apache.org/jira/browse/LUCENE-584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12529632
 ] 

Paul Elschot commented on LUCENE-584:
-------------------------------------

As the current patch set is large, I've been pondering how to do this in a 
series of smaller patches that can each be applied by itself. This is possible 
in the following way:

1. introduce Matcher as superclass of Scorer and adapt javadocs to use matching 
consistently.
2. introduce MatchFilter as superclass of Filter and add a minimal 
DefaultMatcher to be used in IndexSearcher, i.e. add BitSetMatcher
3. change the current Searcher/Searchable API to use MatchFilter instead of 
Filter.

Step 1 can be reasonably done before a new a release.
After step 2 this issue might be closed, and all the rest could be treated as 
new issues.

After that three (almost) independent paths can be followed:
4. add more data structures to be used for filter caches.
5. adapt CachingWrapperFilter to provide a Matcher from a cached datastructure, 
for example SortedVIntList or BitSet or OpenBitSet.
6. further use of Matcher, mostly in BooleanScorer2.

My question is: shall I go ahead and provide a patch for step 1?

At the moment I'm refining BooleanScorer2. to use Matcher. This is for the case 
of multiple prohibited clauses, and also to allow the use of required and 
prohibited Matchers to allow adding filtering clauses to BooleanQuery.


> Decouple Filter from BitSet
> ---------------------------
>
>                 Key: LUCENE-584
>                 URL: https://issues.apache.org/jira/browse/LUCENE-584
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Search
>    Affects Versions: 2.0.1
>            Reporter: Peter Schäfer
>            Priority: Minor
>         Attachments: bench-diff.txt, bench-diff.txt, 
> Matcher-20070905-1ground.patch, Matcher-20070905-2default.patch, 
> Matcher-20070905-3core.patch, Some Matchers.zip
>
>
> {code}
> package org.apache.lucene.search;
> public abstract class Filter implements java.io.Serializable 
> {
>   public abstract AbstractBitSet bits(IndexReader reader) throws IOException;
> }
> public interface AbstractBitSet 
> {
>   public boolean get(int index);
> }
> {code}
> It would be useful if the method =Filter.bits()= returned an abstract 
> interface, instead of =java.util.BitSet=.
> Use case: there is a very large index, and, depending on the user's 
> privileges, only a small portion of the index is actually visible.
> Sparsely populated =java.util.BitSet=s are not efficient and waste lots of 
> memory. It would be desirable to have an alternative BitSet implementation 
> with smaller memory footprint.
> Though it _is_ possibly to derive classes from =java.util.BitSet=, it was 
> obviously not designed for that purpose.
> That's why I propose to use an interface instead. The default implementation 
> could still delegate to =java.util.BitSet=.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to