|
|
-
upgrading Solr - org.apache.lucene.search. Filter and acceptDocs
Jamie Johnson 2012-02-25, 20:16
I'm trying to upgrade an application I have from an old snapshot of solr to the latest stable trunk and see that the constructor for Filter has changed, specifically there is another parameter named acceptDocs, the API says the following
acceptDocs - Bits that represent the allowable docs to match (typically deleted docs but possibly filtering other documents)
but I'm not sure what specifically this means to my filter. How should this be used when trying to upgrade a filter?
-
Re: upgrading Solr - org.apache.lucene.search. Filter and acceptDocs
Yonik Seeley 2012-02-25, 20:23
On Sat, Feb 25, 2012 at 3:16 PM, Jamie Johnson <[EMAIL PROTECTED]> wrote: > I'm trying to upgrade an application I have from an old snapshot of > solr to the latest stable trunk and see that the constructor for > Filter has changed, specifically there is another parameter named > acceptDocs, the API says the following > > acceptDocs - Bits that represent the allowable docs to match > (typically deleted docs but possibly filtering other documents) > > but I'm not sure what specifically this means to my filter. How > should this be used when trying to upgrade a filter?
If a document doesn't match acceptDocs, it should be returned by the filter. Lucene is basically asking "what documents match your filter AND match acceptDocs"
-Yonik lucenerevolution.com - Lucene/Solr Open Source Search Conference. Boston May 7-10
-
Re: upgrading Solr - org.apache.lucene.search. Filter and acceptDocs
Jamie Johnson 2012-02-25, 20:37
I am assuming you meant should not be returned right? I basically return a filtered doc id set and do the following return new FilteredDocIdSet(startingFilter.getDocIdSet(readerCtx, acceptDocs)) { @Override public boolean match(int doc) {
//do custom stuff } }; does the filtereddocidset give me only the ones that match, or is there something additional I need to do in addition to my custom match logic here? I.e. just do if(!acceptDocs.get(doc)) return false; at the top?
On Sat, Feb 25, 2012 at 3:23 PM, Yonik Seeley <[EMAIL PROTECTED]> wrote: > On Sat, Feb 25, 2012 at 3:16 PM, Jamie Johnson <[EMAIL PROTECTED]> wrote: >> I'm trying to upgrade an application I have from an old snapshot of >> solr to the latest stable trunk and see that the constructor for >> Filter has changed, specifically there is another parameter named >> acceptDocs, the API says the following >> >> acceptDocs - Bits that represent the allowable docs to match >> (typically deleted docs but possibly filtering other documents) >> >> but I'm not sure what specifically this means to my filter. How >> should this be used when trying to upgrade a filter? > > If a document doesn't match acceptDocs, it should be returned by the filter. > Lucene is basically asking "what documents match your filter AND match > acceptDocs" > > -Yonik > lucenerevolution.com - Lucene/Solr Open Source Search Conference. > Boston May 7-10
-
Re: upgrading Solr - org.apache.lucene.search. Filter and acceptDocs
Yonik Seeley 2012-02-25, 20:41
On Sat, Feb 25, 2012 at 3:37 PM, Jamie Johnson <[EMAIL PROTECTED]> wrote: > I.e. just do if(!acceptDocs.get(doc)) return false; at > the top?
Yep, that should do it.
-Yonik lucenerevolution.com - Lucene/Solr Open Source Search Conference. Boston May 7-10
|
|