Package com.senseidb.search.req

Examples of com.senseidb.search.req.SenseiResult


      ZoieIndexReader<BoboIndexReader> zoieMultiReader = new ZoieMultiReader<BoboIndexReader>(IndexReader.open(directory),
          new SenseiIndexReaderDecorator(facets, runtimeFacets));
      MockIndexReaderFactory mockIndexReaderFactory = new MockIndexReaderFactory<ZoieIndexReader<BoboIndexReader>>(
          Arrays.asList(zoieMultiReader));
      mockSenseiCore.setIndexReaderFactory(mockIndexReaderFactory);
      SenseiResult result = coreSenseiServiceImpl.execute(senseiRequest);
      mockSenseiCore.setIndexReaderFactory(null);
      return result;
    } catch (Exception e) {
      throw new RuntimeException(e);
    } finally {
View Full Code Here


    {
      ByteString value = req.getVal();
      byte[] raw = value.toByteArray();
      ByteArrayInputStream bais = new ByteArrayInputStream(raw);
      ObjectInputStream ois = new ObjectInputStream(bais);
      SenseiResult ret = (SenseiResult) ois.readObject();
      return ret;
    } catch (Exception e)
    {
      logger.error("serialize result", e);
    }
View Full Code Here

  public List<SenseiResult> doQuery(SenseiRequest senseiRequest) {
    List<JSONObject> documents = proxyDataSource.getData(senseiRequest);
    if (requestFactory != null) {
      senseiRequest = requestFactory.build(senseiRequest);
    }
    SenseiResult senseiResult = inMemorySenseiService.doQuery(senseiRequest, documents);
    return Arrays.asList(senseiResult);
  }
View Full Code Here

          return doCall(senseiRequest);
        }
      }));
    } catch (Exception e) {
      ErrorMeter.mark();
      SenseiResult emptyResult = getEmptyResultInstance();
      logger.error("Error running scatter/gather", e);
      emptyResult.addError(new SenseiError("Error gathering the results" + e.getMessage(), ErrorType.BrokerGatherError));
      return Arrays.asList(emptyResult);
    }
    return resultList;
  }
View Full Code Here

    try {
      boolean allTheResults = countDownLatch.await(timeout, TimeUnit.MILLISECONDS);
      if (!allTheResults) {       
        logger.warn("Not all the results are received");
      }
      SenseiResult res = ResultMerger.merge(request, resultList, false);
      // get src data (fetchStored) even if request doesn't have it could be enabled at
      // individual broker level
      SenseiBroker.recoverSrcData(res, res.getSenseiHits(), true);
      return res;
    } catch (Exception e) {
      throw new RuntimeException(e);
   
  }
View Full Code Here

    try {
      long time = System.currentTimeMillis();
      int numHits = 0, totalDocs = 0;
      try {
        SenseiRequest senseiRequest = RequestConverter2.fromJSON(request, facetInfo);
        SenseiResult senseiResult = browse(senseiRequest);
        JSONObject jsonResult = DefaultSenseiJSONServlet.buildJSONResult(senseiRequest, senseiResult);
        if (jsonResult != null) {
          numHits = jsonResult.optInt(PARAM_RESULT_NUMHITS);
          totalDocs = jsonResult.optInt(PARAM_RESULT_TOTALDOCS);
        }
View Full Code Here

TOP

Related Classes of com.senseidb.search.req.SenseiResult

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.