/** * Core query implementation all query and search routines will use this routine to query the * remote system * * @param query * @return list of solr documents (metadata) accordng to local YaCy internal schema */ @Override public List<URIMetadataNode> query(QueryParams query) { List<URIMetadataNode> docs = new ArrayList<URIMetadataNode>(); Collection<String> remotecorename = new ArrayList<String>(); remotecorename.add(corename); ModifiableSolrParams msp = new SolrQuery(query.getQueryGoal().getQueryString(false)); msp.add(CommonParams.QT, "/"); // important to override default append of /select msp.add(CommonParams.ROWS, Integer.toString(query.itemsPerPage)); try { RemoteInstance instance = new RemoteInstance(baseurl, remotecorename, corename, 20000); try { SolrConnector solrConnector = new RemoteSolrConnector(instance, false, null); try { this.lastaccesstime = System.currentTimeMillis(); SolrDocumentList docList = solrConnector.getDocumentListByParams(msp); // convert to YaCy schema documentlist for (SolrDocument doc : docList) { try { URIMetadataNode anew = toYaCySchema(doc); docs.add(anew); } catch (MalformedURLException ex) { } } } catch (IOException | SolrException e) { } finally { solrConnector.close(); } } catch (Throwable ee) { } finally { instance.close(); } } catch (IOException eee) { } return docs; }