Examples of Tube


Examples of com.tubeonfire.entity.Tube

        query = Query.newBuilder().setOptions(options)
            .build(queryString.toString());
        docResult = INDEX.search(query);
        if (docResult.getNumberFound() > 0) {
          Tube obj = new Tube();
          for (ScoredDocument scoredDocument : docResult) {
            obj = TubeSearchEngine
                .documentToObjectByReflection(scoredDocument);
            listResult.add(obj);
          }
View Full Code Here

Examples of com.tubeonfire.entity.Tube

        query = Query.newBuilder().setOptions(options)
            .build(queryString.toString());
        docResult = INDEX.search(query);
        if (docResult.getNumberFound() > 0) {
          Tube obj = new Tube();
          for (ScoredDocument scoredDocument : docResult) {
            obj = TubeSearchEngine
                .documentToObjectByReflection(scoredDocument);
            listResult.add(obj);
          }
View Full Code Here

Examples of com.tubeonfire.entity.Tube

          query = Query.newBuilder().setOptions(options)
              .build(queryString.toString());
          docResult = INDEX.search(query);

          if (docResult.getNumberFound() > 0) {
            Tube tub = new Tube();
            for (ScoredDocument scoredDocument : docResult) {
              tub = TubeSearchEngine
                  .documentToObjectByReflection(scoredDocument);
              keyPool.add(tub.getId());
            }
          }
          cache.put(playlistKeyPoolPrefix, keyPool);
        }
        // get list id random from pool
        List<String> relateKey = new ArrayList<String>();
        if (keyPool.size() > 20) {
          System.out.println(">20");
          Random randomGenerator = new Random();
          int index = randomGenerator
              .nextInt((int) (keyPool.size() / 2));
          relateKey = keyPool.subList(index, (index + 10));
        } else if (keyPool.size() < 5) {
          System.out.println("<5");
          options = QueryOptions.newBuilder().setLimit(10).build();
          query = Query.newBuilder().setOptions(options).build("");
          docResult = INDEX.search(query);

          if (docResult.getNumberFound() > 0) {
            Tube tub = new Tube();
            for (ScoredDocument scoredDocument : docResult) {
              tub = TubeSearchEngine
                  .documentToObjectByReflection(scoredDocument);
              relateKey.add(tub.getId());
            }
          }
        } else {
          System.out.println(">5<20");
          relateKey = keyPool;
        }

        for (String string : relateKey) {
          Tube tub = getById(string);
          if (tub != null) {
            listResult.add(tub);
          }
        }
        if (listResult.size() > 0) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.