Package com.browseengine.bobo.api

Examples of com.browseengine.bobo.api.BoboSegmentReader


    @Override
    public Scorer scorer(AtomicReaderContext context, boolean scoreDocsInOrder, boolean topScorer,
        Bits acceptDocs) throws IOException {
      AtomicReader reader = context.reader();
      if (reader instanceof BoboSegmentReader) {
        BoboSegmentReader boboReader = (BoboSegmentReader) reader;
        FacetHandler<?> fhandler = boboReader.getFacetHandler(FacetTermQuery.this._name);
        if (fhandler != null) {
          DocIdSetIterator dociter = null;
          RandomAccessFilter filter = fhandler.buildFilter(FacetTermQuery.this._sel);
          if (filter != null) {
            RandomAccessDocIdSet docset = filter.getRandomAccessDocIdSet(boboReader);
View Full Code Here


  @Override
  public Explanation explain(AtomicReader reader, int doc, Explanation innerExplaination)
      throws IOException {
    if (reader instanceof BoboSegmentReader) {
      BoboSegmentReader boboReader = (BoboSegmentReader) reader;
      Object dataObj = boboReader.getFacetData(_timeFacetName);
      if (dataObj instanceof FacetDataCache<?>) {
        @SuppressWarnings("unchecked")
        FacetDataCache<Long> facetDataCache = (FacetDataCache<Long>) (boboReader
            .getFacetData(_timeFacetName));
        final BigSegmentedArray orderArray = facetDataCache.orderArray;
        final TermLongList termList = (TermLongList) facetDataCache.valArray;
        Explanation finalExpl = new Explanation();
        finalExpl.addDetail(innerExplaination);
View Full Code Here

  @Override
  public Scorer createScorer(final Scorer innerScorer, AtomicReader reader,
      boolean scoreDocsInOrder, boolean topScorer) throws IOException {
    if (reader instanceof BoboSegmentReader) {
      BoboSegmentReader boboReader = (BoboSegmentReader) reader;
      Object dataObj = boboReader.getFacetData(_timeFacetName);
      if (dataObj instanceof FacetDataCache<?>) {
        @SuppressWarnings("unchecked")
        FacetDataCache<Long> facetDataCache = (FacetDataCache<Long>) (boboReader
            .getFacetData(_timeFacetName));
        final BigSegmentedArray orderArray = facetDataCache.orderArray;
        final TermLongList termList = (TermLongList) facetDataCache.valArray;
        return new Scorer(innerScorer.getWeight()) {
View Full Code Here

  @Override
  public Explanation explain(AtomicReader indexReader, int docid, Explanation innerExplaination)
      throws IOException {
    if (!(indexReader instanceof BoboSegmentReader)) throw new IllegalArgumentException(
        "IndexReader is not BoboSegmentReader");
    BoboSegmentReader reader = (BoboSegmentReader) indexReader;

    Explanation exp = new Explanation();
    exp.setDescription("FacetBasedBoost");

    float boost = 1.0f;
    for (Map.Entry<String, Map<String, Float>> boostEntry : _boostMaps.entrySet()) {
      String facetName = boostEntry.getKey();
      FacetHandler<?> handler = reader.getFacetHandler(facetName);
      if (!(handler instanceof FacetScoreable)) throw new IllegalArgumentException(facetName
          + " does not implement FacetScoreable");

      FacetScoreable facetScoreable = (FacetScoreable) handler;
      BoboDocScorer scorer = facetScoreable.getDocScorer(reader, _scoringFunctionFactory,
View Full Code Here

      CombinedFacetAccessible[] groupAccessibles) throws IOException {
    BrowseHit[] hits = new BrowseHit[scoreDocs.length];
    Collection<FacetHandler<?>> facetHandlers = facetHandlerMap.values();
    for (int i = scoreDocs.length - 1; i >= 0; i--) {
      MyScoreDoc fdoc = scoreDocs[i];
      BoboSegmentReader reader = fdoc.reader;
      BrowseHit hit = new BrowseHit();
      if (fetchStoredFields) {
        hit.setStoredFields(reader.document(fdoc.doc));
      }
      if (termVectorsToFetch != null && termVectorsToFetch.size() > 0) {
        Map<String, TermFrequencyVector> tvMap = new HashMap<String, TermFrequencyVector>();
        hit.setTermFreqMap(tvMap);
        Fields fds = reader.getTermVectors(fdoc.doc);
        for (String field : termVectorsToFetch) {
          Terms terms = fds.terms(field);
          if (terms == null) {
            continue;
          }
View Full Code Here

TOP

Related Classes of com.browseengine.bobo.api.BoboSegmentReader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.