Package org.apache.solr.client.solrj

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


        query.setParam("omitHeader", true);
        try {
            // Column names
            if (q.getPropertyNames() != null) {
                for (String prop : q.getPropertyNames()) {
                    query.addField(prop);
                }
            }
            query.setQuery("*:*");

            // Encode limit/offset, if necessary
View Full Code Here


    protected SolrDocument getSolrDocument(String uri) throws SolrServerException, IOException {
        if(server == null){
            return null;
        }
        SolrQuery solrQuery = new SolrQuery();
        solrQuery.addField("*"); // select all fields
        solrQuery.setRows(1); // we query for the id, there is only one result
        String queryString = String.format("%s:%s", this.getDocumentIdField(),
            SolrUtil.escapeSolrSpecialChars(uri));
        solrQuery.setQuery(queryString);
        QueryResponse queryResponse = server.query(solrQuery);
View Full Code Here

            return narrowerConcepts;
        }
        SolrServer solrServer = getActiveSolrServer();
        SolrQuery query = new SolrQuery(entryTypeField + ":" + METADATA_ENTRY);
        query.addFilterQuery(broaderField + ":" + ClientUtils.escapeQueryChars(broadTopicId));
        query.addField(conceptUriField);
        query.addSortField(conceptUriField, SolrQuery.ORDER.asc);
        try {
            for (SolrDocument result : solrServer.query(query).getResults()) {
                narrowerConcepts.add(result.getFirstValue(conceptUriField).toString());
            }
View Full Code Here

        if (broaderField == null) {
            return broaderConcepts;
        }
        SolrServer solrServer = getActiveSolrServer();
        SolrQuery query = new SolrQuery(conceptUriField + ":" + ClientUtils.escapeQueryChars(id));
        query.addField(broaderField);
        try {
            for (SolrDocument result : solrServer.query(query).getResults()) {
                // there should be only one results
                Collection<Object> broaderFieldValues = result.getFieldValues(broaderField);
                if (broaderFieldValues == null) {
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.