Package org.apache.blur.thrift.generated

Examples of org.apache.blur.thrift.generated.BlurQuery$BlurQueryTupleSchemeFactory


    assertEquals("Unexpected number of record-4 results", 1, matchRecord4);
  }

  @Test
  public void testQueryWithFacets() throws Exception {
    BlurQuery blurQuery = new BlurQuery();
    blurQuery.query = new Query();
    blurQuery.query.query = "test-family.testcol1:value1";
    blurQuery.query.rowQuery = true;
    blurQuery.query.scoreType = ScoreType.SUPER;
    blurQuery.fetch = 10;
View Full Code Here


    String queryStr = "";
    for (int i = 2; i < args.length; i++) {
      queryStr += args[i] + " ";
    }

    BlurQuery blurQuery = new BlurQuery();
    Query query = new Query();
    query.setQuery(queryStr);
    blurQuery.setQuery(query);
    blurQuery.setSelector(new Selector(Main.selector));
    blurQuery.setCacheResult(false);
    blurQuery.setUseCacheIfPresent(false);

    if (Main.highlight) {
      blurQuery.getSelector().setHighlightOptions(new HighlightOptions());
    }

    if (Main.debug) {
      out.println(blurQuery);
    }
View Full Code Here

  @Test
  public void simpleQueryString() {
    SolrParams p = new SolrQuery("foo");

    BlurQuery query = BlurQueryHelper.from(p);

    assertEquals("Should get our query string back.", "foo", query.getQuery().getQuery());
  }
View Full Code Here

  public void fieldValuesMustFollowBlursFamilyColumnFormat() {
    SolrQuery p = new SolrQuery();

    p.setFields("foo");

    BlurQuery query = BlurQueryHelper.from(p);
  }
View Full Code Here

  public void fieldsShouldTranslateToSelector() {
    SolrQuery p = new SolrQuery();

    p.setFields("fam1.col1", "fam1.col2", "fam2.col1");

    BlurQuery query = BlurQueryHelper.from(p);

    Map<String, Set<String>> columns = query.getSelector().getColumnsToFetch();

    assertTrue("Should have fam1 defined.", columns.containsKey("fam1"));
    assertTrue("Should have fam2 defined.", columns.containsKey("fam2"));

    Set<String> fam1 = columns.get("fam1");
View Full Code Here

  }

  private void performSearch() throws BlurException {
    try {
      long cursor = _remoteFetchCount * _batch;
      BlurQuery blurQuery = new BlurQuery(_originalQuery.query, _originalQuery.facets, null,
          _originalQuery.useCacheIfPresent, cursor, _remoteFetchCount, _originalQuery.minimumNumberOfResults,
          _originalQuery.maxQueryTime, _originalQuery.uuid, _originalQuery.userContext, _originalQuery.cacheResult,
          _originalQuery.startTime, _originalQuery.getSortFields(), _originalQuery.getRowId());
      _results = makeLazy(_client.query(_table, blurQuery));
      addFacets();
View Full Code Here

    String tablename = args[1];
    CommandLine commandLine = QueryCommandHelper.parse(args, out);
    if (commandLine == null) {
      return;
    }
    BlurQuery blurQuery = QueryCommandHelper.getBlurQuery(commandLine);
    if (Main.debug) {
      out.println(blurQuery);
    }
    _width = 100;
    if (commandLine.hasOption(QueryCommandHelper.WIDTH)) {
View Full Code Here

  public QueryResponse query(SolrParams params) throws SolrServerException {
    QueryResponse response = new QueryResponse();
    long start = System.currentTimeMillis();

    try {
      BlurQuery blurQuery = BlurQueryHelper.from(params);
      BlurResults results = client().query(tableName, blurQuery);
      NamedList<Object> resp = new NamedList<Object>();

      resp.add("response", BlurResultHelper.from(results));
View Full Code Here

import com.google.common.collect.Maps;

public class BlurQueryHelper {

  public static BlurQuery from(SolrParams p) {
    BlurQuery blurQuery = new BlurQuery();

    Query query = new Query();
    query.setRowQuery(false);

    maybeAddSelector(blurQuery, p);

    query.setQuery(p.get(CommonParams.Q));

    blurQuery.setQuery(query);
    return blurQuery;
  }
View Full Code Here

    doc.addChildDocument(child);
    return doc;
  }

  private void assertTotalResults(String table, String q, long expected) throws BlurException, TException {
    BlurQuery bquery = new BlurQuery();
    Query query = new Query();
    query.setQuery(q);
    bquery.setQuery(query);
    BlurResults results = client().query(table, bquery);

    assertEquals("Should find our row.", expected, results.getTotalResults());
  }
View Full Code Here

TOP

Related Classes of org.apache.blur.thrift.generated.BlurQuery$BlurQueryTupleSchemeFactory

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.