How to perform an In-Place-Update in Solr?

Viewed 12

I currently try to perform an In-Place Update in Solr 8.11.1 (https://solr.apache.org/guide/8_11/updating-parts-of-documents.html#in-place-updates). But the update does not seem to be successful even though my field to be updated fulfills all the listed criteria as well as the version field and there are no copy fields.

I recreated it with a minimal schema with a local Solr docker container and still can't make it work.

  1. started a new solr container: docker run -d -p 8983:8983 --name my_solr -t solr:8.11.1-slim (using this version because this version is used in our project)

  2. created core: docker exec -it my_solr solr create_core -c gettingstarted

  3. created a non-indexed, non-stored, single-valued, numeric docValued field popularity

  4. this leads to a minimal schema with the following fields: http://localhost:8983/solr/gettingstarted/schema/fields

    {
      "responseHeader":{
        "status":0,
        "QTime":0},
      "fields":[{
          "name":"_nest_path_",
          "type":"_nest_path_"},
        {
          "name":"_root_",
          "type":"string",
          "docValues":false,
          "indexed":true,
          "stored":false},
        {
          "name":"_text_",
          "type":"text_general",
          "multiValued":true,
          "indexed":true,
          "stored":false},
        {
          "name":"_version_",
          "type":"plong",
          "indexed":false,
          "stored":false},
        {
          "name":"id",
          "type":"string",
          "multiValued":false,
          "indexed":true,
          "required":true,
          "stored":true},
        {
          "name":"popularity",
          "type":"pint",
          "uninvertible":false,
          "docValues":true,
          "indexed":false,
          "stored":false}]}
    
  5. I created a document with ID "1"

  6. I perform the in-place update and enforce the in-place update as suggested in the documentation:

    http://localhost:8983/solr/gettingstarted/update?commit=true&update.partial.requireInPlace=true' --data-binary '[{"id":"1", "popularity":{"set":99}}] 
    

    with a successful response so I would expect that the in-place update was successful:

    {"responseHeader":{"status":0,"QTime":1}}
    
  7. However, the update was not performed as I can't retrieve the popularity-value via the field list (https://solr.apache.org/guide/6_6/docvalues.html#DocValues-RetrievingDocValuesDuringSearch)

  8.     {
      "responseHeader":{
        "status":0,
        "QTime":2,
        "params":{
          "q":"*:*",
          "indent":"true",
          "fl":"id,popularity",
          "q.op":"OR",
          "_":"1662731041895"}},
      "response":{"numFound":1,"start":0,"numFoundExact":true,"docs":[
          {
            "id":"1"}]
      }}
    

Can anyone explain this behavior as I would expect this in-place-update to work as it is.

Best regards,

Jonas

0 Answers
Related