You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@solr.apache.org by Phil Scadden <P....@gns.cri.nz> on 2023/01/16 22:27:05 UTC

Solrj error: You must type correct path

So starting to update ancient solr app to 9.1 and also the SolrJ indexer. When I try to add a document, I am getting Exception in thread "main" org.apache.solr.client.solrj.impl.BaseHttpSolrClient$RemoteSolrException: Error from server at http://my.host:8983/solr/qmap: Searching for Solr You must type the correct path Solr will respond

I can see the qmap core in the solr admin and solr is running.

Code is:

public class DocumentIndexer {

private final  String fileToIndex;

private final ConcurrentUpdateHttp2SolrClient solrClient;

private final Http2SolrClient http2Client;



public DocumentIndexer(String solrUrl, String fileToIndex) {

    this.fileToIndex =fileToIndex;

    http2Client = new Http2SolrClient.Builder().build();

    solrClient = new ConcurrentUpdateHttp2SolrClient.Builder(solrUrl, http2Client).build();

}



public void indexDocuments() throws IOException, SolrServerException{

  ContentStreamUpdateRequest req = new ContentStreamUpdateRequest("/update/extract");

  req.setAction(AbstractUpdateRequest.ACTION.COMMIT, true, true);

  req.addFile(new File(fileToIndex),"application/xml");

  req.setParam("id", fileToIndex);

  req.process(solrClient);

  solrClient.commit(true, true);

}

}


________________________________________________
Ngā mihi, Nā Phil Scadden
Te Raraunga me te Tātaritanga Mokowā Aronuku (Geospatial Data and Analysis)
GNS Science Te Pῡ Ao
764 Cumberland St, Private Bag 1930,
Dunedin, New Zealand Ph +64 3 4799663, 027 3463185

“Whāia te iti kahurangi ki te tūohu koe me he maunga teitei”

Notice: This email and any attachments are confidential and may not be used, published or redistributed without the prior written consent of the Institute of Geological and Nuclear Sciences Limited (GNS Science). If received in error please destroy and immediately notify GNS Science. Do not copy or disclose the contents.

RE: Solrj error: You must type correct path

Posted by Phil Scadden <P....@gns.cri.nz>.
Wow - thanks very much for that. I had tried against techproducts but then scratched my head about failed id. I will look closely at these now.

Again, really appreciate your prompt and helpful response.

-----Original Message-----
From: Shawn Heisey <ap...@elyograg.org>
Sent: Tuesday, 17 January 2023 1:43 PM
To: users@solr.apache.org
Subject: Re: Solrj error: You must type correct path



CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe:

On 1/16/23 15:27, Phil Scadden wrote:
> So starting to update ancient solr app to 9.1 and also the SolrJ
> indexer. When I try to add a document, I am getting Exception in
> thread "main"
> org.apache.solr.client.solrj.impl.BaseHttpSolrClient$RemoteSolrExcepti
> on: Error from server at http://my.host:8983/solr/qmap: Searching for
> Solr You must type the correct path Solr will respond
>
> I can see the qmap core in the solr admin and solr is running.

Does the qmap core have the /update/extract handler defined?

When I try your code against a core using sample_techproducts_config (which DOES have the /update/extract handler defined) I get a different
error:

Caused by:
org.apache.solr.client.solrj.impl.BaseHttpSolrClient$RemoteSolrException:
Error from server at http://localhost:8983/solr: Document is missing mandatory uniqueKey field: id

If I change the setParam from "id" to "literal.id" then it works.

Thanks,
Shawn
Notice: This email and any attachments are confidential and may not be used, published or redistributed without the prior written consent of the Institute of Geological and Nuclear Sciences Limited (GNS Science). If received in error please destroy and immediately notify GNS Science. Do not copy or disclose the contents.

Re: Solrj error: You must type correct path

Posted by Shawn Heisey <ap...@elyograg.org>.
On 1/16/23 15:27, Phil Scadden wrote:
> So starting to update ancient solr app to 9.1 and also the SolrJ indexer. When I try to add a document, I am getting Exception in thread "main" org.apache.solr.client.solrj.impl.BaseHttpSolrClient$RemoteSolrException: Error from server at http://my.host:8983/solr/qmap: Searching for Solr You must type the correct path Solr will respond
> 
> I can see the qmap core in the solr admin and solr is running.

Does the qmap core have the /update/extract handler defined?

When I try your code against a core using sample_techproducts_config 
(which DOES have the /update/extract handler defined) I get a different 
error:

Caused by: 
org.apache.solr.client.solrj.impl.BaseHttpSolrClient$RemoteSolrException: 
Error from server at http://localhost:8983/solr: Document is missing 
mandatory uniqueKey field: id

If I change the setParam from "id" to "literal.id" then it works.

Thanks,
Shawn