Examples of addFilterQuery()


Examples of org.apache.solr.client.solrj.SolrQuery.addFilterQuery()

    public ClassificationReport getPerformanceEstimates(String conceptId) throws ClassifierException {

        SolrServer solrServer = getActiveSolrServer();
        SolrQuery query = new SolrQuery("*:*");
        query.addFilterQuery(entryTypeField + ":" + METADATA_ENTRY);
        query.addFilterQuery(conceptUriField + ":" + ClientUtils.escapeQueryChars(conceptId));
        try {
            SolrDocumentList results = solrServer.query(query).getResults();
            if (results.isEmpty()) {
                throw new ClassifierException(String.format("'%s' is not a registered topic", conceptId));
            }
View Full Code Here

Examples of org.apache.solr.client.solrj.SolrQuery.addFilterQuery()

            processedQuery += "NameLower:" + term.substring(10).toLowerCase(); //$NON-NLS-1$
          } else if (term.startsWith("Location:")) { //$NON-NLS-1${
            //Use Location as a filter query to improve query performence
            //See https://bugs.eclipse.org/bugs/show_bug.cgi?id=415874
            //processedQuery += "Location:" + term.substring(9 + req.getContextPath().length()); //$NON-NLS-1$
            query.addFilterQuery("Location:" + term.substring(9 + req.getContextPath().length()));
            continue;
          } else if (term.startsWith("Name:")) { //$NON-NLS-1$
            try {
              term = URLDecoder.decode(term, "UTF-8"); //$NON-NLS-1$
            } catch (UnsupportedEncodingException e) {
View Full Code Here

Examples of org.apache.solr.client.solrj.SolrQuery.addFilterQuery()

    if (queryString.endsWith(AND))
      queryString = queryString.substring(0, queryString.length() - AND.length());
    query.setQuery(queryString);

    //filter to search only documents belonging to current user
    query.addFilterQuery(ProtocolConstants.KEY_USER_NAME + ':' + ClientUtils.escapeQueryChars(req.getRemoteUser()));

    //other common fields
    setField(req, query, CommonParams.ROWS);
    setField(req, query, CommonParams.START);
    setField(req, query, CommonParams.SORT);
View Full Code Here

Examples of org.springframework.data.solr.core.query.Query.addFilterQuery()

  }

  @Override
  public Page<Product> findByAvailableTrue() {
    Query query = new SimpleQuery(new Criteria(new SimpleField(Criteria.WILDCARD)).expression(Criteria.WILDCARD));
    query.addFilterQuery(new SimpleQuery(new Criteria(SolrSearchableFields.AVAILABLE).is(true)));

    return getSolrOperations().queryForPage(query, Product.class);
  }
}
View Full Code Here

Examples of org.springframework.data.solr.core.query.SimpleQuery.addFilterQuery()

  }

  @Override
  public Page<Product> findByAvailableTrue() {
    Query query = new SimpleQuery(new Criteria(new SimpleField(Criteria.WILDCARD)).expression(Criteria.WILDCARD));
    query.addFilterQuery(new SimpleQuery(new Criteria(SolrSearchableFields.AVAILABLE).is(true)));

    return getSolrOperations().queryForPage(query, Product.class);
  }
}
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.