Package com.browseengine.bobo.query.scoring

Examples of com.browseengine.bobo.query.scoring.FacetTermQuery$FacetTermWeight


    BrowseSelection sel2 = new BrowseSelection("distance");
    sel2.addValue("60,120:1");
    HashMap<String, Float> map = new HashMap<String, Float>();
    map.put("0,120:1", 3.0f);
    FacetTermQuery geoQ = new FacetTermQuery(sel2,map);
   
    BoboBrowser b = newBrowser();
    Explanation expl = b.explain(geoQ, 0);
   
    br2.setQuery(geoQ);
    doTest(br2,2,null,new String[]{"1","5"});
    expl = b.explain(geoQ, 1);
     
      // facet query for color "red" and getting facet counts for the distance facet.
    BrowseRequest br3 = new BrowseRequest();
    br3.setCount(10);
    br3.setOffset(0)

    BrowseSelection sel3 = new BrowseSelection("color");
    sel3.addValue("red");
    HashMap<String, Float> map3 = new HashMap<String, Float>();
    map3.put("red", 3.0f);
    FacetTermQuery colorQ = new FacetTermQuery(sel3,map3);

    BoboBrowser b2 = newBrowser();
    Explanation expl2 = b.explain(colorQ, 0);
   
    br3.setFacetSpec("distance", geoSpec);
View Full Code Here


    BrowseSelection sel2 = new BrowseSelection("correctDistance");
    sel2.addValue("60,120:1");
    HashMap<String, Float> map = new HashMap<String, Float>();
    map.put("60,120:1", 3.0f);
    FacetTermQuery geoQ = new FacetTermQuery(sel2,map);
   
    BoboBrowser b = newBrowser();
    Explanation expl = b.explain(geoQ, 0);
   
    br2.setQuery(geoQ);
    doTest(br2,2,null,new String[]{"1","5"});

    expl = b.explain(geoQ, 1);
     
      // facet query for color "red" and getting facet counts for the distance facet.
    BrowseRequest br3 = new BrowseRequest();
    br3.setCount(10);
    br3.setOffset(0)

    BrowseSelection sel3 = new BrowseSelection("color");
    sel3.addValue("red");
    HashMap<String, Float> map3 = new HashMap<String, Float>();
    map3.put("red", 3.0f);
    FacetTermQuery colorQ = new FacetTermQuery(sel3,map3);

    BoboBrowser b2 = newBrowser();
    Explanation expl2 = b.explain(colorQ, 0);

    br3.setFacetSpec("correctDistance", geoSpec);
View Full Code Here

    sel.addValue("red");
    sel.addValue("blue");
    HashMap<String, Float> map = new HashMap<String, Float>();
    map.put("red", 5.0f);
    map.put("blue", 4.0f);
    FacetTermQuery colorQ = new FacetTermQuery(sel,map);
   
    BrowseSelection sel2 = new BrowseSelection("shape");
    sel2.addValue("circle");
    sel2.addValue("square");
    HashMap<String, Float> map2 = new HashMap<String, Float>();
    map2.put("circle", 3.0f);
    map2.put("square", 2.0f);
    FacetTermQuery shapeQ = new FacetTermQuery(sel2,map2);
    shapeQ.setBoost(3.0f);
   
    BooleanQuery bq = new BooleanQuery();
    bq.add(shapeQ,Occur.SHOULD);
    bq.add(colorQ,Occur.SHOULD);
   
View Full Code Here

    sel.addValue("red");
    sel.addValue("blue");
    HashMap<String, Float> map = new HashMap<String, Float>();
    map.put("red", 3.0f);
    map.put("blue", 2.0f);
    FacetTermQuery colorQ = new FacetTermQuery(sel,map);
   
    BrowseSelection sel2 = new BrowseSelection("tag");
    sel2.addValue("rabbit");
    sel2.addValue("dog");
    HashMap<String, Float> map2 = new HashMap<String, Float>();
    map2.put("rabbit", 100.0f);
    map2.put("dog", 50.0f);
    FacetTermQuery tagQ = new FacetTermQuery(sel2,map2);
   
   
    BrowseRequest br = new BrowseRequest();
    br.setQuery(colorQ);
    br.setOffset(0);
View Full Code Here

      sel.addValue("red");
      sel.addValue("blue");
      HashMap<String, Float> map = new HashMap<String, Float>();
      map.put("red", 3.0f);
      map.put("blue", 2.0f);
      FacetTermQuery colorQ = new FacetTermQuery(sel,map);
     
      BrowseSelection sel2 = new BrowseSelection("tag");
      sel2.addValue("rabbit");
      sel2.addValue("dog");
      HashMap<String, Float> map2 = new HashMap<String, Float>();
      map2.put("rabbit", 100.0f);
      map2.put("dog", 50.0f);
      FacetTermQuery tagQ = new FacetTermQuery(sel2,map2);
     
     
      BrowseRequest br = new BrowseRequest();

      br.setOffset(0);
View Full Code Here

    sel.addValue("[* TO 000010]");
   
    HashMap<String, Float> map = new HashMap<String, Float>();
    map.put("000002", 100.0f);
    map.put("000010", 50.0f);
    FacetTermQuery numberQ = new FacetTermQuery(sel,map);
   
    BrowseRequest br = new BrowseRequest();
    br.setQuery(numberQ);
    br.setOffset(0);
    br.setCount(10);
View Full Code Here

    BrowseSelection sel2 = new BrowseSelection("distance");
    sel2.addValue("60,120:1");
    HashMap<String, Float> map = new HashMap<String, Float>();
    map.put("0,120:1", 3.0f);
    FacetTermQuery geoQ = new FacetTermQuery(sel2, map);

    br2.setQuery(geoQ);
    doTest(br2, 2, null, new String[] { "1", "5" });

    // facet query for color "red" and getting facet counts for the distance facet.
    BrowseRequest br3 = new BrowseRequest();
    br3.setCount(10);
    br3.setOffset(0);

    BrowseSelection sel3 = new BrowseSelection("color");
    sel3.addValue("red");
    HashMap<String, Float> map3 = new HashMap<String, Float>();
    map3.put("red", 3.0f);
    FacetTermQuery colorQ = new FacetTermQuery(sel3, map3);

    br3.setFacetSpec("distance", geoSpec);
    geoSpec.setMinHitCount(0);
    br3.setQuery(colorQ); // query is color=red
    br3.addSelection(sel); // count facets <30,70,5> and <60,120,1>
View Full Code Here

    BrowseSelection sel2 = new BrowseSelection("correctDistance");
    sel2.addValue("60,120:1");
    HashMap<String, Float> map = new HashMap<String, Float>();
    map.put("60,120:1", 3.0f);
    FacetTermQuery geoQ = new FacetTermQuery(sel2, map);

    br2.setQuery(geoQ);
    doTest(br2, 2, null, new String[] { "1", "5" });

    // facet query for color "red" and getting facet counts for the distance facet.
    BrowseRequest br3 = new BrowseRequest();
    br3.setCount(10);
    br3.setOffset(0);

    BrowseSelection sel3 = new BrowseSelection("color");
    sel3.addValue("red");
    HashMap<String, Float> map3 = new HashMap<String, Float>();
    map3.put("red", 3.0f);
    FacetTermQuery colorQ = new FacetTermQuery(sel3, map3);

    br3.setFacetSpec("correctDistance", geoSpec);
    geoSpec.setMinHitCount(1);
    br3.setQuery(colorQ); // query is color=red
    br3.addSelection(sel); // count facets <30,70,5> and <60,120,1>
View Full Code Here

    sel.addValue("red");
    sel.addValue("blue");
    HashMap<String, Float> map = new HashMap<String, Float>();
    map.put("red", 5.0f);
    map.put("blue", 4.0f);
    FacetTermQuery colorQ = new FacetTermQuery(sel, map);

    BrowseSelection sel2 = new BrowseSelection("shape");
    sel2.addValue("circle");
    sel2.addValue("square");
    HashMap<String, Float> map2 = new HashMap<String, Float>();
    map2.put("circle", 3.0f);
    map2.put("square", 2.0f);
    FacetTermQuery shapeQ = new FacetTermQuery(sel2, map2);
    shapeQ.setBoost(3.0f);

    BooleanQuery bq = new BooleanQuery();
    bq.add(shapeQ, Occur.SHOULD);
    bq.add(colorQ, Occur.SHOULD);
View Full Code Here

    sel.addValue("red");
    sel.addValue("blue");
    HashMap<String, Float> map = new HashMap<String, Float>();
    map.put("red", 3.0f);
    map.put("blue", 2.0f);
    FacetTermQuery colorQ = new FacetTermQuery(sel, map);

    BrowseSelection sel2 = new BrowseSelection("tag");
    sel2.addValue("rabbit");
    sel2.addValue("dog");
    HashMap<String, Float> map2 = new HashMap<String, Float>();
    map2.put("rabbit", 100.0f);
    map2.put("dog", 50.0f);
    FacetTermQuery tagQ = new FacetTermQuery(sel2, map2);

    BrowseRequest br = new BrowseRequest();
    br.setQuery(colorQ);
    br.setOffset(0);
    br.setCount(10);
View Full Code Here

TOP

Related Classes of com.browseengine.bobo.query.scoring.FacetTermQuery$FacetTermWeight

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.