5 Replies Latest reply on Jan 16, 2017 10:10 AM by rareddy

    Teiid embedded calling Solr with POST request

    hend.amin

      Hello,

      I am using Teiid Embedded with solr. I have a large request that causes exception but works when i reduce its size.

      org.apache.solr.client.solrj.impl.HttpSolrServer$RemoteSolrException: Expected content type application/octet-stream but got .

        at org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:455) ~[solr-solrj-4.6.0.jar:4.6.0 1543363 - simon - 2013-11-19 11:16:35]

        at org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:197) ~[solr-solrj-4.6.0.jar:4.6.0 1543363 - simon - 2013-11-19 11:16:35]

        at org.apache.solr.client.solrj.request.QueryRequest.process(QueryRequest.java:90) ~[solr-solrj-4.6.0.jar:4.6.0 1543363 - simon -

       

      I think this is because because Teiid calls solr server with GET method.

      Is it possible to call Solr with POST method through Teiid embedded

       

      Thanks

      Hend

        • 1. Re: Teiid embedded calling Solr with POST request
          rareddy

          Hend,

           

          Teiid uses "SolrJ" library 4.6 version to issue queries into Solr, Teiid does not explicitly choose GET vs POST, SolrJ library does. Granted this was developed a while ago and SolrJ library *might* have been improved since then to allow preference to POST. If you want to investigate and find out if that fixes your issue, then we can discuss about updating Teiid side of the libraries for Solr to use later versions.

           

          Ramesh..

          • 2. Re: Teiid embedded calling Solr with POST request
            hend.amin

            The problem is that

            org.teiid.resource.adapter.solr.SolrConnectionImpl

            has this method it does not specify the method GET/POST

            @Override

              public QueryResponse query(SolrQuery params) throws TranslatorException {

              try {

              return server.query(params);  --> this means query server using GET and server has another method  QueryResponse query(SolrParams params, METHOD method) that enable the user to determine the method to use GET/POST

              } catch (SolrServerException e) {

              throw new TranslatorException(e);

              }

              }

             

            there should be a configuration for SolrConnector to use GET/POST or it should be smart to check the query size and determines which method to use.

            • 3. Re: Teiid embedded calling Solr with POST request
              rareddy

              IMO, there is no harm in doing POST always, but I do not know if the Solr supports that style of querying without doing some digging. My ask was to take look at the SolrJ library for that options.

              • 4. Re: Teiid embedded calling Solr with POST request
                hend.amin

                The problem is that for large requests with Solr Teiid will not return a result but will return an exception. Is there any change that this could be fixed ??

                • 5. Re: Teiid embedded calling Solr with POST request
                  rareddy

                  Go ahead and log a enhancement JIRA, we will investigate the possibility.