net.consensys.tools.ipfs.ipfsstore.dto.query.Query类的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(810)

本文整理了Java中net.consensys.tools.ipfs.ipfsstore.dto.query.Query类的一些代码示例,展示了Query类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query类的具体详情如下:
包路径:net.consensys.tools.ipfs.ipfsstore.dto.query.Query
类名称:Query

Query介绍

[英]"Query" accumulates filters and acts as a query builder for each allowed operation
[中]“查询”累积过滤器,并充当每个允许操作的查询生成器

代码示例

代码示例来源:origin: ConsenSys/IPFS-Store

  1. public static Query newQuery() {
  2. return new Query();
  3. }

代码示例来源:origin: ConsenSys/IPFS-Store

  1. @JsonIgnore
  2. public boolean isEmpty() {
  3. return this.getFilterClauses().isEmpty();
  4. }
  5. }

代码示例来源:origin: ConsenSys/IPFS-Store

  1. @Override
  2. public Page<E> findByfullTextSearch(String fullTextCriteria, Pageable pagination) {
  3. log.debug("Find all [criteria: {}, pagination: {}]", fullTextCriteria, pagination);
  4. if(fullTextFields.isEmpty()) {
  5. log.warn("Can't perform a full text search. no fields configured [fullTextFields]");
  6. return null;
  7. }
  8. Query query = Query.newQuery();
  9. query.fullText(fullTextFields.toArray(new String[fullTextFields.size()]), fullTextCriteria);
  10. Page<E> result = this.search(query, pagination);
  11. log.debug("Find all [criteria: {}, pagination: {}] : {}", fullTextCriteria, pagination, result);
  12. return result;
  13. }

代码示例来源:origin: ConsenSys/IPFS-Store

  1. /**
  2. * Return the content metadata (index, ID, content_type, hash and attributes)
  3. *
  4. * @param indexName Index name
  5. * @param id Document Unique identifier
  6. * @return Metadata (index, ID, content_type, hash and attributes)
  7. * @throws IPFSStoreException
  8. */
  9. public Metadata getMetadataById(String indexName, String id) throws IPFSStoreException {
  10. Query query = Query.newQuery().equals(ID_ATTRIBUTE, id);
  11. Page<Metadata> searchResult = this.wrapper.search(indexName, query, PageRequest.of(0, 1));
  12. if (searchResult.getTotalElements() == 0) {
  13. throw new NotFoundException("Content [indexName: " + indexName + ", id: "+ id + "] not found in the index");
  14. }
  15. return searchResult.getContent().get(0);
  16. }

代码示例来源:origin: ConsenSys/IPFS-Store

  1. @Override
  2. public Metadata getFileMetadataByHash(Optional<String> index, String hash)
  3. throws NotFoundException {
  4. Query query = new Query().equals(IndexDao.HASH_INDEX_KEY, hash.toLowerCase()); // TODO ES
  5. // case
  6. // sensitive
  7. // analyser
  8. Page<Metadata> search = this.searchFiles(index, query, PageRequest.of(0, 1));
  9. if (search.getTotalElements() == 0) {
  10. throw new NotFoundException(
  11. "File [hash=" + hash + "] not found in the index [" + index + "]");
  12. }
  13. return search.getContent().get(0);
  14. }

代码示例来源:origin: ConsenSys/IPFS-Store

  1. if (query == null || query.isEmpty()) {
  2. return QueryBuilders.matchAllQuery();
  3. query.getFilterClauses().forEach(f -> {

代码示例来源:origin: ConsenSys/IPFS-Store

  1. query = Query.newQuery();

代码示例来源:origin: ConsenSys/IPFS-Store

  1. /**
  2. * Return the content metadata (index, ID, content_type, hash and attributes)
  3. *
  4. * @param indexName Index name
  5. * @param hash document hash
  6. * @return Metadata (index, ID, content_type, hash and attributes)
  7. * @throws IPFSStoreException
  8. */
  9. public Metadata getMetadataByHash(String indexName, String hash) throws IPFSStoreException {
  10. Query query = Query.newQuery().equals(HASH_ATTRIBUTE, hash);
  11. Page<Metadata> searchResult = this.wrapper.search(indexName, query, PageRequest.of(0, 1));
  12. if (searchResult.getTotalElements() == 0) {
  13. throw new NotFoundException("Content [indexName: " + indexName + ", hash: "+ hash + "] not found in the index");
  14. }
  15. return searchResult.getContent().get(0);
  16. }

代码示例来源:origin: ConsenSys/IPFS-Store

  1. public static Query newQuery(List<Filter> filterClauses) {
  2. return new Query(filterClauses);
  3. }

相关文章