Skip to content

Commit

Permalink
fix for IDF uniformity issue Bobo-29
Browse files Browse the repository at this point in the history
  • Loading branch information
ymatsuda committed Jun 16, 2010
1 parent da7a345 commit b6e3dab
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 2 deletions.
25 changes: 25 additions & 0 deletions bobo-browse/src/com/browseengine/bobo/api/BoboSubBrowser.java
Expand Up @@ -21,6 +21,7 @@
import org.apache.lucene.search.MatchAllDocsQuery;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.SortField;
import org.apache.lucene.search.Weight;

import com.browseengine.bobo.facets.CombinedFacetAccessible;
import com.browseengine.bobo.facets.FacetCountCollector;
Expand Down Expand Up @@ -168,6 +169,30 @@ public void browse(BrowseRequest req,
Map<String, FacetAccessible> facetMap,
int start) throws BrowseException
{
Weight w = null;
try
{
Query q = req.getQuery();
if (q == null)
{
q = new MatchAllDocsQuery();
}
w = createWeight(q);
}
catch (IOException ioe)
{
throw new BrowseException(ioe.getMessage(), ioe);
}
browse(req, w, collector, facetMap, start);
}

public void browse(BrowseRequest req,
Weight weight,
Collector collector,
Map<String, FacetAccessible> facetMap,
int start) throws BrowseException
{

if (_reader == null)
return;

Expand Down
8 changes: 8 additions & 0 deletions bobo-browse/src/com/browseengine/bobo/api/Browsable.java
Expand Up @@ -10,6 +10,7 @@
import org.apache.lucene.search.Searchable;
import org.apache.lucene.search.Similarity;
import org.apache.lucene.search.SortField;
import org.apache.lucene.search.Weight;

import com.browseengine.bobo.facets.FacetHandler;
import com.browseengine.bobo.sort.SortCollector;
Expand All @@ -26,6 +27,13 @@ void browse(BrowseRequest req,
Map<String,FacetAccessible> facets,
int start) throws BrowseException;

void browse(BrowseRequest req,
Weight weight,
Collector hitCollector,
Map<String,FacetAccessible> facets,
int start) throws BrowseException;


BrowseResult browse(BrowseRequest req) throws BrowseException;

Set<String> getFacetNames();
Expand Down
27 changes: 25 additions & 2 deletions bobo-browse/src/com/browseengine/bobo/api/MultiBoboBrowser.java
Expand Up @@ -18,6 +18,7 @@
import org.apache.lucene.search.Query;
import org.apache.lucene.search.Similarity;
import org.apache.lucene.search.SortField;
import org.apache.lucene.search.Weight;

import com.browseengine.bobo.facets.FacetHandler;
import com.browseengine.bobo.sort.SortCollector;
Expand Down Expand Up @@ -57,7 +58,29 @@ public void browse(BrowseRequest req,final Collector hc, Map<String, FacetAccess
browse(req, hc, facetMap, 0);
}

public void browse(BrowseRequest req,final Collector hc, Map<String, FacetAccessible> facetMap, int start) throws BrowseException
public void browse(BrowseRequest req,
Collector collector,
Map<String, FacetAccessible> facetMap,
int start) throws BrowseException
{
Weight w = null;
try
{
Query q = req.getQuery();
if (q == null)
{
q = new MatchAllDocsQuery();
}
w = createWeight(q);
}
catch (IOException ioe)
{
throw new BrowseException(ioe.getMessage(), ioe);
}
browse(req, w, collector, facetMap, start);
}

public void browse(BrowseRequest req, Weight weight, final Collector hc, Map<String, FacetAccessible> facetMap, int start) throws BrowseException
{
Browsable[] browsers = getSubBrowsers();
int[] starts = getStarts();
Expand All @@ -70,7 +93,7 @@ public void browse(BrowseRequest req,final Collector hc, Map<String, FacetAccess
{
try
{
browsers[i].browse(req, hc, facetColMap, (start + starts[i]));
browsers[i].browse(req, weight, hc, facetColMap, (start + starts[i]));
}
finally
{
Expand Down

0 comments on commit b6e3dab

Please sign in to comment.