You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Michael Joyner <mi...@newsrx.com> on 2016/11/15 16:18:13 UTC

Issue with empty strings not being indexed/stored?

Hello all,

We've been indexing documents with empty strings for some fields.

After our latest round of Solr/SolrJ updates to 6.3.0 we have discovered 
that fields with empty strings are no longer being stored, effectively 
storing documents with those fields as being NULL/NOT-PRESENT instead of 
EMPTY. (Most definitely not the same thing!)

We are using SolrInputDocuments.

Documents indexed before our latest round of updates have the fields 
with empty strings just fine, new documents indexed since the updates don't.

Example field that is in the input document that isn't showing up as 
populated in the query results:

"mesh_s" : {
     "boost" : 1.0,
     "firstValue" : "",
     "name" : "mesh_s",
     "value" : "",
     "valueCount" : 1,
     "values" : [ "" ]
   }

-Mike



Re: Issue with empty strings not being indexed/stored?

Posted by Chris Hostetter <ho...@fucit.org>.
You'll have to give us more details on what exactly you are doing to 
reproduce the problem you are seeing, and more detals on how exactly 
you upgraded (and what version you upgraded from) ...

    https://wiki.apache.org/solr/UsingMailingLists

When i launch 6.3.0 using "bin/solr -e techproducts" I can index a 
document with a blank string value, see the stored field in the result, 
and search on that blank value just fine (see below)

Wild guess: perhaps when you upgraded you also changed the configs you are 
using, and now have RemoveBlankFieldUpdateProcessorFactory in your default 
updateRequestProcessorChain ?


What i tried with 6.3.0 ...

$ bin/solr -e techproducts
$ curl -H "Content-Type: application/json" 
'http://localhost:8983/solr/techproducts/update?commit=true' --data-binary 
'[{"id":"HOSS","blank_s":""}]'
{"responseHeader":{"status":0,"QTime":48}}
$ curl 'http://localhost:8983/solr/techproducts/query?q=id:HOSS'
{
  "responseHeader":{
    "status":0,
    "QTime":5,
    "params":{
      "q":"id:HOSS"}},
  "response":{"numFound":1,"start":0,"docs":[
      {
        "id":"HOSS",
        "blank_s":"",
        "_version_":1551101798705528832}]
  }}
$ curl 'http://localhost:8983/solr/techproducts/query?q=blank_s:""'
{
  "responseHeader":{
    "status":0,
    "QTime":1,
    "params":{
      "q":"blank_s:\"\""}},
  "response":{"numFound":1,"start":0,"docs":[
      {
        "id":"HOSS",
        "blank_s":"",
        "_version_":1551101798705528832}]
  }}







-Hoss
http://www.lucidworks.com/