Package org.apache.stanbol.commons.solr.utils

Examples of org.apache.stanbol.commons.solr.utils.StreamQueryRequest


        }
        QueryResponse response;
        try {
            response = AccessController.doPrivileged(new PrivilegedExceptionAction<QueryResponse>() {
                public QueryResponse run() throws IOException, SolrServerException {
                    StreamQueryRequest request = new StreamQueryRequest(query);
                     return request.process(server);
                }
            });
        } catch (PrivilegedActionException pae) {
            Exception e = pae.getException();
            if(e instanceof SolrServerException){
View Full Code Here


        query.set("fieldnames", "topic,popularity,broader,text");
        query.set(CommonParams.STREAM_CONTENTTYPE, "text/plan;charset=utf-8");
        query.set(CommonParams.STREAM_BODY, IOUtils.toString(is, "utf-8"));

        // Upload an index
        QueryResponse response = new StreamQueryRequest(query).process(classifierSolrServer);
        assertNotNull(response);
        log.info(String.format("Indexed test topics in %dms", response.getElapsedTime()));
    }
View Full Code Here

        // the top suggestion
        query.setRows(MAX_SUGGESTIONS * 3);
        query.setFields(conceptUriField);
        query.setIncludeScore(true);
        try {
            StreamQueryRequest request = new StreamQueryRequest(query);
            QueryResponse response = request.process(solrServer);
            SolrDocumentList results = response.getResults();
            for (SolrDocument result : results.toArray(new SolrDocument[0])) {
                String conceptUri = (String) result.getFirstValue(conceptUriField);
                if (conceptUri == null) {
                    throw new ClassifierException(String.format(
View Full Code Here

        final SolrServer server = getServer();
        QueryResponse response;
        try {
            response = AccessController.doPrivileged(new PrivilegedExceptionAction<QueryResponse>() {
                public QueryResponse run() throws IOException, SolrServerException {
                    StreamQueryRequest request = new StreamQueryRequest(query);
                     return request.process(server);
                }
            });
        } catch (PrivilegedActionException pae) {
            Exception e = pae.getException();
            if(e instanceof SolrServerException){
View Full Code Here

        SolrQuery query = getSolrQueryFactory().parseFieldQuery(fieldQuery, select);
        long queryGeneration = System.currentTimeMillis();

        QueryResponse response;
        try {
            StreamQueryRequest request = new StreamQueryRequest(query);
            response = request.process(getServer());
        } catch (SolrServerException e) {
            if ("unknown handler: /mlt".equals(e.getCause().getMessage())) {
                throw new YardException("Solr is missing '<requestHandler name=\"/mlt\""
                                        + " class=\"solr.MoreLikeThisHandler\" startup=\"lazy\" />'"
                                        + " in 'solrconfig.xml'", e);
View Full Code Here

        query.set("fieldnames", "topic,popularity,broader,text");
        query.set(CommonParams.STREAM_CONTENTTYPE, "text/plan;charset=utf-8");
        query.set(CommonParams.STREAM_BODY, IOUtils.toString(is, "utf-8"));

        // Upload an index
        QueryResponse response = new StreamQueryRequest(query).process(classifierSolrServer);
        assertNotNull(response);
        log.info(String.format("Indexed test topics in %dms", response.getElapsedTime()));
    }
View Full Code Here

        // the top suggestion
        query.setRows(MAX_SUGGESTIONS * 3);
        query.setFields(conceptUriField);
        query.setIncludeScore(true);
        try {
            StreamQueryRequest request = new StreamQueryRequest(query);
            QueryResponse response = request.process(solrServer);
            SolrDocumentList results = response.getResults();
            for (SolrDocument result : results.toArray(new SolrDocument[0])) {
                String conceptUri = (String) result.getFirstValue(conceptUriField);
                if (conceptUri == null) {
                    throw new ClassifierException(String.format(
View Full Code Here

        query.set("fieldnames", "topic,popularity,broader,text");
        query.set(CommonParams.STREAM_CONTENTTYPE, "text/plan;charset=utf-8");
        query.set(CommonParams.STREAM_BODY, IOUtils.toString(is, "utf-8"));

        // Upload an index
        QueryResponse response = new StreamQueryRequest(query).process(classifierSolrServer);
        assertNotNull(response);
        log.info(String.format("Indexed test topics in %dms", response.getElapsedTime()));
    }
View Full Code Here

        // the top suggestion
        query.setRows(MAX_SUGGESTIONS * 3);
        query.setFields(conceptUriField);
        query.setIncludeScore(true);
        try {
            StreamQueryRequest request = new StreamQueryRequest(query);
            QueryResponse response = request.process(solrServer);
            SolrDocumentList results = response.getResults();
            for (SolrDocument result : results.toArray(new SolrDocument[0])) {
                String conceptUri = (String) result.getFirstValue(conceptUriField);
                if (conceptUri == null) {
                    throw new ClassifierException(String.format(
View Full Code Here

TOP

Related Classes of org.apache.stanbol.commons.solr.utils.StreamQueryRequest

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.