One would think that a JSON output handler in Solr/Lucene would create a: "fieldname": null
for missing fields. Is it possible to set that as a parameter to a json-requested output? In PHP, NULL and missing are ALMOST the exact same thing. In databases, they actually are, in my limited experience. Dennis Gearon Signature Warning ---------------- EARTH has a Right To Life, otherwise we all die. Read 'Hot, Flat, and Crowded' Laugh at http://www.yert.com/film.php --- On Sat, 10/2/10, Khai Doan <khaitd...@gmail.com> wrote: > From: Khai Doan <khaitd...@gmail.com> > Subject: Re: How to tell Solr to return all fields including empty fields? > To: solr-user@lucene.apache.org > Date: Saturday, October 2, 2010, 10:36 PM > Thanks for replying. I need to > have the empty fields because if the field > is not there, the Java library ( > http://www.json.org/javadoc/org/json/JSONObject.html) > that I use to parse > the result will throw an exception. Quite > inconvenient. > > Thanks, > Khai > > On Fri, Oct 1, 2010 at 6:45 PM, Erick Erickson <erickerick...@gmail.com>wrote: > > > Nope. If a field is empty, it's just not in the > document. You could index > > an empty value (some unique value for empty) if you > really need this. > > > > But a more interesting question is why you need this. > What is it about > > returning an empty field that's important? Couldn't > you detect this through > > the absence of the field? > > > > Best > > Erick > > > > On Fri, Oct 1, 2010 at 3:44 PM, Khai Doan <khaitd...@gmail.com> > wrote: > > > > > Hello everyone, > > > > > > Right now, I am using fl=*,score to get all > fields from Solr. However > > > empty > > > fields are not returned. Is there a way for > me to tell Solr to return > > all > > > fields including empty fields? > > > > > > Thanks, > > > Khai > > > > > >