Update Field in Solr

60 views
Skip to first unread message

Vg K222

unread,
Aug 22, 2017, 3:11:55 AM8/22/17
to Datafari
Hi,
Have some pdf stored in file server and use datafari to crawl them and retrieve.
I would like to have some field from external source (ENVIRONNEMENT, EMMETEUR, DESTINATAIRE)

I have create field into SOLR : OK

First I crawl the file on the server in a folder
I can search with full text : OK (exemple : 1110285 which is a word in the document)

Then I try to update the document
curl -X POST -H 'Content-Type: application/xml' http://localhost:8983/solr/FileShare_shard1_replica1/update --data-binary @201410071032_539249_SOLR.xml

201410071032_539249_SOLR.xml:
<add>
    <doc>
        <field name="id">file://///serverfile/Data/Linux/datafari/test/document/201410071032_539249.pdf</field>
        <field name="ENVIRONNEMENT" update="set">TEST</field>
        <field name="EMETTEUR" update="set">ME</field>
        <field name="DESTINATAIRE" update="set">YOU</field>
    </doc>
</add>


The field are added to solr with the existing field : OK
But the full text search do not work anymore (exemple : 1110285 return nothing)
I tried to change content_en, content_fr to stored=true, but this not work
Does anyone have idea about update field in SOLR?


Olivier Tavard

unread,
Aug 29, 2017, 9:01:26 AM8/29/17
to Datafari
Hello,

If I am right, what you try to do is an atomic update in Solr (https://cwiki.apache.org/confluence/display/solr/Updating+Parts+of+Documents) but in order to do that you need that all your Solr fields must be stored. This is not the default Datafari schema configuration.
So if you want to do that, you have two solutions :
- you change the default Datafari schema and put all the fields with stored=true (be aware that your Solr index will be larger because of that)
- or if you do not want to change the default Datafari schema, you have to post to Solr the entire document with all the fields and not just the field that you updated.

Best regards,

Olivier
Message has been deleted

Vg K222

unread,
Sep 7, 2017, 12:08:50 PM9/7/17
to Datafari
Hi
I tried to set all field to stored =  true
I have delete all document and recrawl everything
but after updating one field in solr I lost the full text search
I will try another methode with the updateprocessos
Tanks

Vg K222

unread,
Sep 14, 2017, 9:01:44 AM9/14/17
to Datafari
Hi
I found my mistake.
After changing the solr schema, we need to
Stop Datafari
Change the init_state.properties to initiallized
Start Datafari
Then SOLR take the changes of field configuration.
Reply all
Reply to author
Forward
0 new messages