Search code examples
apachesolrlucenesolr-query-syntax

Solr - Successful query with numfound > 0 but docs returned are empty?


I'm pretty new to Solr but something is not working as expected...

I'm searching for documents where the name = 'the*'. This query is working since I'm getting a numFound > 0. But the docs in the response are empty even though I have set &fl=*

I would like to display all the fields available for the documents in the response. (I also tried with &fl=name but it doesn't change anything.

My query:

http://localhost:8983/solr/collection1/select q=name%3Athe*&rows=5&fl=*&wt=json&indent=true

The response:

{
  "responseHeader": {
    "status": 0,
    "QTime": 0,
    "params": {
      "q": "name:the*",
      "indent": "true",
      "fl": "*",
      "rows": "5",
      "wt": "json",
      "_": "1409803190693"
    }
  },
  "response": {
    "numFound": 257052,
    "start": 0,
    "docs": [
      {},
      {},
      {},
      {},
      {}
    ]
  }
}

Solution

  • My problem was that when the index was created the fields were not stored in the schema.xml file so I couldn't access them after (even with the stored attribut set to true).