Package com.google.appengine.api.search

Examples of com.google.appengine.api.search.QueryOptions


      if (cache != null && cache.containsKey(prefix)) {
        listResult = (ArrayList<Tube>) cache.get(prefix);
      } else {
        StringBuilder queryString = new StringBuilder();
        queryString.append("channelId:" + channelId);
        QueryOptions options;
        Query query;
        Results<ScoredDocument> docResult;
        SortOptions sortOptions = SortOptions
            .newBuilder()
            .addSortExpression(
View Full Code Here


      String playlistKeyPoolPrefix = cachePrefix + "playlistIdPool_"
          + obj.getPlaylistId();
      if (cache != null && cache.containsKey(prefix)) {
        listResult = (ArrayList<Tube>) cache.get(prefix);
      } else {
        QueryOptions options;
        Query query;
        Results<ScoredDocument> docResult;
        // get pool id by playlist
        List<String> keyPool = new ArrayList<String>();
        if (cache != null && cache.containsKey(playlistKeyPoolPrefix)) {
View Full Code Here

      String prefix = cacheSide + cachePrefix + "mostview_" + limit;
      mapCacheKey.put(prefix, prefix);
      if (cache != null && cache.containsKey(prefix)) {
        listResult = (ArrayList<Tube>) cache.get(prefix);
      } else {
        QueryOptions options;
        Query query;
        Results<ScoredDocument> docResult;
        SortOptions sortOptions = SortOptions
            .newBuilder()
            .addSortExpression(
View Full Code Here

      } else {
        StringBuilder queryString = new StringBuilder();
        queryString.append("title:" + keyword + " OR description:"
            + keyword);
        listResult = new ArrayList<Tube>();
        QueryOptions options;
        Query query;
        Results<ScoredDocument> docResult;
        if (cache != null && cache.containsKey(totalResultPrefix)
            && cache.containsKey(limitPrefix)) {
          totalResult = (Integer) cache.get(totalResultPrefix);
View Full Code Here

      String prefix = cachePrefix + "id_" + id;
      Tube obj = new Tube();
      if (cache != null && cache.containsKey(prefix)) {
        obj = (Tube) cache.get(prefix);
      } else {
        QueryOptions options = QueryOptions.newBuilder().setLimit(1)
            .build();
        Query query = Query.newBuilder().setOptions(options)
            .build("id:\"" + id + "\"");
        Results<ScoredDocument> docResult = INDEX.search(query);
        if (docResult.getNumberFound() > 0) {
View Full Code Here

        } else {
          queryString.append(" AND channelId:" + channelId);
        }
      }
      listResult = new ArrayList<Tube>();
      QueryOptions options = QueryOptions.newBuilder()
          .setNumberFoundAccuracy(1000).build();
      Query query = Query.newBuilder().setOptions(options)
          .build(queryString.toString());
      Results<ScoredDocument> docResult = INDEX.search(query);
      totalResult = (int) docResult.getNumberFound();
View Full Code Here

                .setDefaultValueNumeric(9999)
                .build();
            SortOptions sortOptions = SortOptions.newBuilder()
                .addSortExpression(sortExpression)
                .build();
            QueryOptions options = QueryOptions.newBuilder()
                .setFieldsToReturn("numfield", "datefield")
                .setSortOptions(sortOptions)
                .build();
            Query.Builder queryBuilder = Query.newBuilder().setOptions(options);
            Results<ScoredDocument> results = index.search(queryBuilder.build(""));
View Full Code Here

TOP

Related Classes of com.google.appengine.api.search.QueryOptions

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.