Package com.google.appengine.api.search

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


  }

  public void searchById(String id) {
    try {
      listResult = new ArrayList<Tube>();
      Query query = Query.newBuilder().build("id:\"" + id + "\"");
      Results<ScoredDocument> docResult = INDEX.search(query);
      if (docResult.getNumberFound() > 0) {
        for (ScoredDocument scoredDocument : docResult) {
          currentItem = TubeSearchEngine
              .documentToObjectByReflection(scoredDocument);
View Full Code Here


        }
      }
      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();

      SortOptions sortOptions = SortOptions
View Full Code Here

    SortExpression.Builder sortExpression = SortExpression.newBuilder()
        .setExpression(MODIFIED_MINUTES_FIELD)
        .setDefaultValueNumeric(0)
        .setDirection(SortExpression.SortDirection.DESCENDING);
    Query query;
    try {
      query = Query.newBuilder()
          .setOptions(QueryOptions.newBuilder()
              .setFieldsToSnippet(CONTENT_FIELD)
              .setOffset(offset)
View Full Code Here

        return builder;
    }
   
    public static Results<ScoredDocument> search(SearchService service, @DelegatesTo(value=QueryBuilder.class, strategy=Closure.DELEGATE_FIRST) Closure<?> c){
        QueryBuilder builder = prepare(service,c);
        Query query = builder.build();
        return index(service, builder.getIndexName()).search(query);
    }
View Full Code Here

        return index(service, builder.getIndexName()).search(query);
    }
   
    public static Results<ScoredDocument> search(SearchService service, int retries, @DelegatesTo(value=QueryBuilder.class, strategy=Closure.DELEGATE_FIRST) Closure<?> c) throws InterruptedException, ExecutionException{
        QueryBuilder builder = prepare(service,c);
        Query query = builder.build();
        return searchAsync(index(service, builder.getIndexName()), query, retries).get();
    }
View Full Code Here

        return searchAsync(index(service, builder.getIndexName()), query, retries).get();
    }
   
    public static Future<Results<ScoredDocument>> searchAsync(SearchService service, @DelegatesTo(value=QueryBuilder.class, strategy=Closure.DELEGATE_FIRST) Closure<?> c){
        QueryBuilder builder = prepare(service,c);
        Query query = builder.build();
        return index(service, builder.getIndexName()).searchAsync(query);
    }
View Full Code Here

        return index(service, builder.getIndexName()).searchAsync(query);
    }
   
    public static Future<Results<ScoredDocument>> searchAsync(SearchService service, int retries, @DelegatesTo(value=QueryBuilder.class, strategy=Closure.DELEGATE_FIRST) Closure<?> c){
        QueryBuilder builder = prepare(service,c);
        Query query = builder.build();
        return searchAsync(index(service, builder.getIndexName()), query, retries);
    }
View Full Code Here


    @Override
    public Results<ScoredDocument> search(String query)
    {
        Query q = Query.newBuilder().setOptions(queryOptionsBuilder()).build(query);
        return getIndex().search(q);
    }
View Full Code Here

    String outcome = null;
    try {
      // Rather than just using a query we build a search request.
      // This allows us to specify other attributes, such as the
      // number of documents to be returned by search.
      Query query = Query.newBuilder()
          .setOptions(QueryOptions.newBuilder()
              .setLimit(limit).
              // for deployed apps, uncomment the line below to demo snippeting.
              // This will not work on the dev_appserver.
              // setFieldsToSnippet("content").
View Full Code Here

TOP

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

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.