Package com.senseidb.search.facet

Examples of com.senseidb.search.facet.UIDFacetHandler


            }
        }

        facets.addAll((Collection<? extends FacetHandler<?>>) pluggableSearchEngineManager.createFacetHandlers());
        // uid facet handler to be added by default
        UIDFacetHandler uidHandler = new UIDFacetHandler(UID_FACET_NAME);
        facets.add(uidHandler);
        sysInfo.setFacetInfos(facetInfos);

        return sysInfo;
    }
View Full Code Here


      public SenseiDocIdSet getSenseiDocIdSet(IndexReader reader) throws IOException {
        if (reader instanceof BoboIndexReader) {
          BoboIndexReader boboReader = (BoboIndexReader)reader;
          FacetHandler uidHandler = boboReader.getFacetHandler(SenseiFacetHandlerBuilder.UID_FACET_NAME);
          if (uidHandler!=null && uidHandler instanceof UIDFacetHandler){
            UIDFacetHandler uidFacet = (UIDFacetHandler)uidHandler;
            try{
              String[] vals = RequestConverter2.getStrings(json.optJSONArray(VALUES_PARAM));
              String[] nots = RequestConverter2.getStrings(json.optJSONArray(EXCLUDES_PARAM));
              BrowseSelection uidSel = new BrowseSelection(SenseiFacetHandlerBuilder.UID_FACET_NAME);
              if (vals != null)
                uidSel.setValues(vals);
              if (nots != null)
                uidSel.setNotValues(nots);

              RandomAccessFilter raf = uidFacet.buildFilter(uidSel);
              return SenseiDocIdSet.build(raf, boboReader, "<uid> IN <" + StringUtils.join(vals, ", ") + "> NOT IN <" + StringUtils.join(nots, ", ") + ">");
            }
            catch(Exception e){
              throw new IOException(e);
            }
View Full Code Here

TOP

Related Classes of com.senseidb.search.facet.UIDFacetHandler

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.