lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emir Arnautović <emir.arnauto...@sematext.com>
Subject Re: Updating a single field using Solrj ContentStreamUpdateRequest
Date Thu, 01 Feb 2018 11:25:19 GMT
Hi Joris,
I doubt that you can do that. That would require extracting request handler to support incremental
updating and I don’t thing it does. In order to update existing doc, you would have to extract
content and send it as incrementa update request.
You can still use extracting handler to extract content by sending extractOnly=true and get
extraction results in response, but maybe better to invoke Tika on client side.

HTH,
Emir
--
Monitoring - Log Management - Alerting - Anomaly Detection
Solr & Elasticsearch Consulting Support Training - http://sematext.com/



> On 1 Feb 2018, at 11:54, Joris De Smedt <joris.desmedt@chapoo.com> wrote:
> 
> Hi
> 
> I'd like to update a single field of an existing document with the content
> of a file.
> My current setup looks like this:
> 
>   final File file = new File("path to file");
>   ContentStreamUpdateRequest req = new
> ContentStreamUpdateRequest("/update/extract");
>   req.addContentStream(new ContentStreamBase.FileStream(file));
>   req.setParam("literal.id", id);
>   req.setParam("uprefix","ignored_");
>   req.setParam("fmap.content", "content");
>   req.setParam("captureAttr","true");
>   req.setParam("lowernames","true");
>   solrClient.request(req, "collection");
>   solrClient.commit("collection");
> 
> The problem with it is that it overwrites the existing file instead of
> adding a content field.
> Is there a way to solve this?
> -- 
> Joris De Smedt


Mime
View raw message