Package com.browseengine.bobo.facets

Examples of com.browseengine.bobo.facets.FacetHandlerInitializerParam


      {
        logger.warn("attempting to reset facetHandler: " + sfacetHandler);
        continue;
      }
      RuntimeFacetHandlerFactory<FacetHandlerInitializerParam,?> factory = (RuntimeFacetHandlerFactory<FacetHandlerInitializerParam, ?>) _runtimeFacetHandlerFactoryMap.get(facetName);
      FacetHandlerInitializerParam data = req.getFacethandlerData(facetName);
      if(data != null)
      {
        RuntimeFacetHandler<?> facetHandler =  factory.get(data);
        _runtimeFacetHandlers.add(facetHandler); // add to a list so we close them after search
        try
View Full Code Here


      RuntimeFacetHandlerFactory<FacetHandlerInitializerParam, ?> factory = (RuntimeFacetHandlerFactory<FacetHandlerInitializerParam, ?>) _runtimeFacetHandlerFactoryMap
          .get(facetName);

      try {

        FacetHandlerInitializerParam data = req.getFacethandlerData(facetName);
        if (data == null) data = FacetHandlerInitializerParam.EMPTY_PARAM;
        if (data != FacetHandlerInitializerParam.EMPTY_PARAM || !factory.isLoadLazily()) {
          RuntimeFacetHandler<?> facetHandler = factory.get(data);
          if (facetHandler != null) {
            _runtimeFacetHandlers.add(facetHandler); // add to a list so we close them after search
View Full Code Here

      RuntimeFacetHandlerFactory<FacetHandlerInitializerParam,?> factory = (RuntimeFacetHandlerFactory<FacetHandlerInitializerParam, ?>) _runtimeFacetHandlerFactoryMap.get(facetName);
     
        try
        {

          FacetHandlerInitializerParam data = req.getFacethandlerData(facetName);
          if (data == null)
            data = FacetHandlerInitializerParam.EMPTY_PARAM;
          if (data != FacetHandlerInitializerParam.EMPTY_PARAM || !factory.isLoadLazily())
          {
            RuntimeFacetHandler<?> facetHandler =  factory.get(data);
View Full Code Here

      RuntimeFacetHandlerFactory<FacetHandlerInitializerParam,?> factory = (RuntimeFacetHandlerFactory<FacetHandlerInitializerParam, ?>) _runtimeFacetHandlerFactoryMap.get(facetName);
     
        try
        {

          FacetHandlerInitializerParam data = req.getFacethandlerData(facetName);
          if (data == null)
            data = FacetHandlerInitializerParam.EMPTY_PARAM;
          RuntimeFacetHandler<?> facetHandler =  factory.get(data);
          _runtimeFacetHandlers.add(facetHandler); // add to a list so we close them after search
          this.setFacetHandler(facetHandler);
View Full Code Here

    assertTrue("facet category order", req.getFacetSpec("category").getOrderBy()== FacetSortSpec.OrderHitsDesc);
   
    //test facet initial parameters;
    Map<String, FacetHandlerInitializerParam> mapParams = req.getFacetHandlerInitParamMap();
    assertTrue("facet number is not correct", mapParams.size() ==1);
    FacetHandlerInitializerParam param = mapParams.get("network");
   
    boolean[] coldstart = param.getBooleanParam("coldStart");
    evaluateBool(coldstart, new boolean[]{true});
   
    List<String> names = param.getStringParam("names");
    ArrayList<String> ar = new ArrayList<String>();
    ar.add("a");
    ar.add("b");
    ar.add("c");
    evaluateListString(names, ar);
   
    double[] timeout = param.getDoubleParam("timeOut");
    evaluateDouble(timeout, new double[]{2.4});
   
    int[] srcId = param.getIntParam("srcId");
    evaluateInt(srcId, new int[]{26609850});
   
    long[] longId = param.getLongParam("longId");
    evaluateLong(longId, new long[]{1234567890L, 9876543210L});
   
    byte[] base64 = param.getByteArrayParam("binary");
    evaluateBytes(base64, (new String("Hello world")).getBytes());
   
    //test sortby;
    assertTrue("first sort by is not correct", req.getSort()[0].getField().equals("color"));
    assertTrue("first sort by order is not correct", req.getSort()[0].getReverse() == true);
View Full Code Here

  {
    final String format = "%s.%s.%s.%s";

    for (Entry<String,FacetHandlerInitializerParam> entry : initParams.entrySet()) {
      String facetName = entry.getKey();
      FacetHandlerInitializerParam param = entry.getValue();

      for (String paramName : param.getBooleanParamNames()) {
        qparams.add(new BasicNameValuePair(
            String.format(format, SenseiSearchServletParams.PARAM_DYNAMIC_INIT, facetName, paramName, SenseiSearchServletParams.PARAM_DYNAMIC_TYPE ),
            SenseiSearchServletParams.PARAM_DYNAMIC_TYPE_BOOL));
        qparams.add(new BasicNameValuePair(
            String.format(format, SenseiSearchServletParams.PARAM_DYNAMIC_INIT, facetName, paramName, SenseiSearchServletParams.PARAM_DYNAMIC_VAL),
            join(param.getBooleanParam(paramName), ",")));
      }

      for (String paramName : param.getByteArrayParamNames()) {
        qparams.add(new BasicNameValuePair(
            String.format(format, SenseiSearchServletParams.PARAM_DYNAMIC_INIT, facetName, paramName, SenseiSearchServletParams.PARAM_DYNAMIC_TYPE),
            SenseiSearchServletParams.PARAM_DYNAMIC_TYPE_BYTEARRAY));
        qparams.add(new BasicNameValuePair(
            String.format(format, SenseiSearchServletParams.PARAM_DYNAMIC_INIT, facetName, paramName, SenseiSearchServletParams.PARAM_DYNAMIC_VAL),
            new String(param.getByteArrayParam(paramName), "UTF-8")));
      }

      for (String paramName : param.getDoubleParamNames()) {
        qparams.add(new BasicNameValuePair(
            String.format(format, SenseiSearchServletParams.PARAM_DYNAMIC_INIT, facetName, paramName, SenseiSearchServletParams.PARAM_DYNAMIC_TYPE),
            SenseiSearchServletParams.PARAM_DYNAMIC_TYPE_DOUBLE));
        qparams.add(new BasicNameValuePair(
            String.format(format, SenseiSearchServletParams.PARAM_DYNAMIC_INIT, facetName, paramName, SenseiSearchServletParams.PARAM_DYNAMIC_VAL),
            join(param.getDoubleParam(paramName), ",")));
      }

      for (String paramName : param.getIntParamNames()) {
        qparams.add(new BasicNameValuePair(
            String.format(format, SenseiSearchServletParams.PARAM_DYNAMIC_INIT, facetName, paramName, SenseiSearchServletParams.PARAM_DYNAMIC_TYPE),
            SenseiSearchServletParams.PARAM_DYNAMIC_TYPE_INT));
        qparams.add(new BasicNameValuePair(
            String.format(format, SenseiSearchServletParams.PARAM_DYNAMIC_INIT, facetName, paramName, SenseiSearchServletParams.PARAM_DYNAMIC_VAL),
            join(param.getIntParam(paramName), ",")));
      }

      for (String paramName : param.getLongParamNames()) {
        qparams.add(new BasicNameValuePair(
            String.format(format, SenseiSearchServletParams.PARAM_DYNAMIC_INIT, facetName, paramName, SenseiSearchServletParams.PARAM_DYNAMIC_TYPE),
            SenseiSearchServletParams.PARAM_DYNAMIC_TYPE_LONG));
        qparams.add(new BasicNameValuePair(
            String.format(format, SenseiSearchServletParams.PARAM_DYNAMIC_INIT, facetName, paramName, SenseiSearchServletParams.PARAM_DYNAMIC_VAL),
            join(param.getLongParam(paramName), ",")));
      }

      for (String paramName : param.getStringParamNames()) {
        qparams.add(new BasicNameValuePair(
            String.format(format, SenseiSearchServletParams.PARAM_DYNAMIC_INIT, facetName, paramName, SenseiSearchServletParams.PARAM_DYNAMIC_TYPE),
            SenseiSearchServletParams.PARAM_DYNAMIC_TYPE_STRING));
        qparams.add(new BasicNameValuePair(
            String.format(format, SenseiSearchServletParams.PARAM_DYNAMIC_INIT, facetName, paramName, SenseiSearchServletParams.PARAM_DYNAMIC_VAL),
            join(param.getStringParam(paramName), ",")));
      }
    }
  }
View Full Code Here

      RuntimeFacetHandlerFactory<FacetHandlerInitializerParam, ?> factory = (RuntimeFacetHandlerFactory<FacetHandlerInitializerParam, ?>) _runtimeFacetHandlerFactoryMap
          .get(facetName);

      try {

        FacetHandlerInitializerParam data = req.getFacethandlerData(facetName);
        if (data == null) data = FacetHandlerInitializerParam.EMPTY_PARAM;
        if (data != FacetHandlerInitializerParam.EMPTY_PARAM || !factory.isLoadLazily()) {
          RuntimeFacetHandler<?> facetHandler = factory.get(data);
          if (facetHandler != null) {
            _runtimeFacetHandlers.add(facetHandler); // add to a list so we close them after search
View Full Code Here

TOP

Related Classes of com.browseengine.bobo.facets.FacetHandlerInitializerParam

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.