Package com.browseengine.bobo.api

Examples of com.browseengine.bobo.api.BrowseSelection


          while (true)
          {
            try
            {
              BrowseRequest req = new BrowseRequest();
              BrowseSelection sel = new BrowseSelection("color");
              sel.addValue("red");
              req.addSelection(sel);

              FacetSpec fspec = new FacetSpec();
              fspec.setExpandSelection(true);
              fspec.setMaxCount(10);
View Full Code Here


        if(parts1.length==2)
        {
          String[] parts2 = parts1[1].split(",");
          if (parts2.length>0)
          {
            BrowseSelection sel = new BrowseSelection(parts1[0]);
            sel.setValues(parts2);
            BrowseRequest req = new BrowseRequest();
            req.addSelection(sel);
            for (String facet : facets)
            {
              FacetSpec fspec = new FacetSpec();
View Full Code Here

         
          //BrowseSelection sel = new BrowseSelection("ccid");
          //sel.addValue("1009");
          //req.addSelection(sel);
         
          BrowseSelection sel2 = new BrowseSelection("industry");
          sel2.addValue("4");
          req.addSelection(sel2);
         
          FacetSpec fspec = new FacetSpec();
          fspec.setExpandSelection(true);
          fspec.setMaxCount(10);
View Full Code Here

    BoboIndexReader boboReader = BoboIndexReader.getInstance(reader, facetHandlers);
   
    BoboBrowser browser = new BoboBrowser(boboReader);
    BrowseRequest req = new BrowseRequest();
   
    BrowseSelection sel = new BrowseSelection(PathHandlerName);
    sel.addValue("/a");
    HashMap<String,String> propMap = new HashMap<String,String>();
    propMap.put(PathFacetHandler.SEL_PROP_NAME_DEPTH,"0");
    propMap.put(PathFacetHandler.SEL_PROP_NAME_STRICT,"false");
    sel.setSelectionProperties(propMap);
   
    req.addSelection(sel);
   
    FacetSpec fs = new FacetSpec();
    fs.setMinHitCount(1);
View Full Code Here

    BrowseRequest br=new BrowseRequest();
    //br.setQuery(query);
    br.setOffset(0);
    br.setCount(0);

        BrowseSelection geoSel=new BrowseSelection("geo_region");
        geoSel.addValue("5227");
        BrowseSelection industrySel=new BrowseSelection("industry_norm");
        industrySel.addValue("1");
   
        //br.addSelection(geoSel);
        br.addSelection(industrySel);
   
    FacetSpec regionSpec=new FacetSpec();
View Full Code Here

    {
      q.add( new TermQuery(new Term("b",s)), Occur.MUST);
    }
//      q.add(new MatchAllDocsQuery(), Occur.MUST);
      req.setQuery(q);//new TermQuery(new Term("b",qstr)));
      BrowseSelection sel = new BrowseSelection("ccid");
      sel.addValue("0000001384");
//      req.addSelection(sel );
      BrowseSelection seli = new BrowseSelection("industry");
      seli.addValue("0000000052");
//      req.addSelection(seli );
      long tf0=0;
      long tf1=0;
      BrowseResult bres = browser.browse(req);
      for(Entry<String, FacetAccessible> entry: bres.getFacetMap().entrySet())
View Full Code Here

  public void testStoredFacetField() throws Exception{
    BrowseRequest br=new BrowseRequest();
    br.setCount(10);
    br.setOffset(0);

        BrowseSelection colorSel=new BrowseSelection("testStored");
        colorSel.addValue("stored");
        br.addSelection(colorSel);
        br.setFetchStoredFields(true);
       
        BrowseResult result = null;
        BoboBrowser boboBrowser=null;
View Full Code Here

  public void testStoredField() throws Exception{
    BrowseRequest br=new BrowseRequest();
    br.setCount(10);
    br.setOffset(0);

        BrowseSelection colorSel=new BrowseSelection("color");
        colorSel.addValue("red");
        br.addSelection(colorSel);

        BrowseSelection shapeSel=new BrowseSelection("shape");
        shapeSel.addValue("square");
        br.addSelection(shapeSel);
       
        BrowseSelection sizeSel=new BrowseSelection("size");
        sizeSel.addValue("[4 TO 4]");
        br.addSelection(sizeSel);

        BrowseResult result = null;
        BoboBrowser boboBrowser=null;
      try {
View Full Code Here

  {
    BrowseRequest br=new BrowseRequest();
    br.setCount(10);
    br.setOffset(0);

        BrowseSelection sel=new BrowseSelection("color");
        sel.addValue("red");
        br.addSelection(sel);

    FacetSpec output=new FacetSpec();
    output.setExpandSelection(true);
    br.setFacetSpec("color", output);
    br.setFacetSpec("shape", output);
   
    HashMap<String,List<BrowseFacet>> answer=new HashMap<String,List<BrowseFacet>>();
        answer.put("color", Arrays.asList(new BrowseFacet[]{new BrowseFacet("blue",2),new BrowseFacet("green",2),new BrowseFacet("red",3)}));
        answer.put("shape", Arrays.asList(new BrowseFacet[]{new BrowseFacet("rectangle",1),new BrowseFacet("square",2)}));
       
        doTest(br,3,answer,new String[]{"1","2","7"});

        sel=new BrowseSelection("shape");
        sel.addValue("square");
        br.addSelection(sel);
   
    answer=new HashMap<String,List<BrowseFacet>>();
    answer.put("color", Arrays.asList(new BrowseFacet[]{new BrowseFacet("blue",1),new BrowseFacet("red",2)}));
    answer.put("shape", Arrays.asList(new BrowseFacet[]{new BrowseFacet("rectangle",1),new BrowseFacet("square",2)}));
View Full Code Here

  public void testPath() throws Exception{
    BrowseRequest br=new BrowseRequest();
    br.setCount(10);
    br.setOffset(0);

        BrowseSelection sel=new BrowseSelection("path");
        sel.addValue("a");
        Properties prop = sel.getSelectionProperties();
        PathFacetHandler.setDepth(prop, 1);
        br.addSelection(sel);
   
    FacetSpec pathSpec=new FacetSpec();
    pathSpec.setOrderBy(FacetSortSpec.OrderValueAsc);
View Full Code Here

TOP

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

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.