Package com.browseengine.bobo.facets

Examples of com.browseengine.bobo.facets.FacetHandler$FacetDataNone


      dumper=new IndexDumper(idxDir);
      Set<String> fields=idxReader.getFacetNames();
     
      for (int k=0;k<idxReader.maxDoc();++k){
        for (String field : fields){
          FacetHandler facetHandler = idxReader.getFacetHandler(field);
          if (facetHandler!=null){
            String[] f=facetHandler.getFieldValues(idxReader,k);
            StringBuilder buffer=new StringBuilder();
            buffer.append(field).append(':');
            for (int l=0;l<f.length;++l){
              if (l>0){
                buffer.append(',');
View Full Code Here


    {
      Set<Entry<String,List<FacetAccessible>>> entries = mergedMap.entrySet();
      for (Entry<String,List<FacetAccessible>> entry : entries)
      {
        String name = entry.getKey();
        FacetHandler handler = getFacetHandler(name);
        try
        {
          List<FacetAccessible> subList = entry.getValue();
          if (subList!=null)
          {
            FacetAccessible merged = handler.merge(req.getFacetSpec(name), subList);
              facetMap.put(name, merged);
          }
        }
        catch(Exception e)
        {
View Full Code Here

      }
      Set<Entry<String,List<FacetAccessible>>> entries = mergedMap.entrySet();
      for (Entry<String,List<FacetAccessible>> entry : entries)
      {
        String name = entry.getKey();
        FacetHandler handler = getFacetHandler(name);
        try
        {
          List<FacetAccessible> subList = entry.getValue();
          if (subList!=null)
          {
            FacetAccessible merged = handler.merge(req.getFacetSpec(name), subList);
              facetMap.put(name, merged);
          }
        }
        catch(Exception e)
        {
View Full Code Here

   
    Iterator<FacetHandler> iter = tobeLoaded.iterator();
   
    while(iter.hasNext())
    {
      FacetHandler handler = iter.next();
      if (!loaded.containsKey(handler.getName()))
      {
        Set<String> depends = handler.getDependsOn();
        if (depends.size() > 0)
        {
        }
        handler.load(reader);
      }
    }
  }
View Full Code Here

    {
      Set<Entry<String,List<FacetAccessible>>> entries = mergedMap.entrySet();
      for (Entry<String,List<FacetAccessible>> entry : entries)
      {
        String name = entry.getKey();
        FacetHandler handler = getFacetHandler(name);
        try
        {
          List<FacetAccessible> subList = entry.getValue();
          if (subList!=null)
          {
            FacetAccessible merged = handler.merge(req.getFacetSpec(name), subList);
              facetMap.put(name, merged);
          }
        }
        catch(Exception e)
        {
View Full Code Here

          BoboIndexReader boboReader = (BoboIndexReader)reader;
          Iterator<String> iter = json.keys();
          List<SenseiFilter> senseiFilters = new ArrayList<SenseiFilter>();
          while(iter.hasNext()){
            String key = iter.next();
            FacetHandler facetHandler = boboReader.getFacetHandler(key);
            if (facetHandler!=null){
              try{
                JSONObject jsonObj = json.getJSONObject(key);
                BrowseSelection sel = buildFacetSelection(key, jsonObj);
                senseiFilters.add(SenseiFilter.build(facetHandler.buildFilter(sel), "FACET " + key));
              }
              catch(Exception e){
                throw new IOException(e.getMessage());
              }
            }
View Full Code Here

    _nDays = nDays;
    _dataUnit = dataUnit;
  }

  private DocIdSet buildFilterSet(BoboIndexReader boboReader) throws IOException{
    FacetHandler facetHandler = boboReader.getFacetHandler(_column);

    if (facetHandler!=null){
      DecimalFormat formatter = new DecimalFormat(DefaultSenseiInterpreter.DEFAULT_FORMAT_STRING_MAP.get(MetaType.Long));
      BrowseSelection sel = new BrowseSelection(_column);
      long duration = _dataUnit.convert(_nDays, TimeUnit.DAYS);
      long now = _dataUnit.convert(System.currentTimeMillis(), TimeUnit.MILLISECONDS);
      long from = now - duration;
      sel.addValue("["+formatter.format(from)+" TO *]");
      return facetHandler.buildFilter(sel).getDocIdSet(boboReader);
    }
    throw new IllegalStateException("no facet handler defined with column: "+_column);
  }
View Full Code Here

        if (!noOptimize)
        {
          if (reader instanceof BoboIndexReader)
          {
            final BoboIndexReader boboReader = (BoboIndexReader)reader;
            FacetHandler facetHandler = boboReader.getFacetHandler(field);
            if (facetHandler != null)
            {
              StringBuilder sb = new StringBuilder();
              if (include_lower && from != null && from.length() != 0)
                sb.append("[");
View Full Code Here

      @Override
      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));
View Full Code Here

    Iterator<String> iter_afacet = _dt.hm_afacet_index.keySet().iterator();
    while(iter_afacet.hasNext()){
      String afacetName = iter_afacet.next();
     
      // validation;
      FacetHandler arHandler = boboReader.getFacetHandler(afacetName);
      Object dataObj = boboReader.getFacetData(afacetName);
      if( ! (dataObj instanceof int[]))
        throw new IllegalArgumentException("Facet " + afacetName + " does not have a valid FacetData for activity engine.");
     
      if(! (arHandler instanceof ActivityRangeFacetHandler))
View Full Code Here

TOP

Related Classes of com.browseengine.bobo.facets.FacetHandler$FacetDataNone

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.