You can use the Luke request handler to request all the fields in the index, in case that helps with your UI. Solr's Schema Browser uses that request handler to introspect. And Solr Flare also uses it to figure out which fields to show as facets.

        Erik

On Jan 28, 2010, at 10:08 AM, Turner, Robbin J wrote:

We've been building a UI which displays the results in a tabular formate, so each of the fields that are available for search are presented to the user. We still discussing where it's best to sort this out in our overall system design, such as the UI or application layer. Given our current thought is to do it at the UI level, check if the tag is returned or not, I still wanted to check if it's at all possible to make Solr return empty field tags.

We have several data sets within our index that we've fitted into our schema, so that even though the field is indexed and stored, documes may not have data for that field and may be empty when indexed.

So hence my query to the group.

Robbin

-----Original Message-----
From: Erick Erickson [mailto:erickerick...@gmail.com]
Sent: Wednesday, January 27, 2010 9:21 PM
To: solr-user@lucene.apache.org
Subject: Re: Can Solr be forced to return all field tags for a document even if the field is empty?l

This is kind of an unusual request, what higher-level problem are you trying to solve here? Because the field just *isn't there* in the underlying Lucene index for that document.

I suppose you could index a "not there" token and just throw those values out from the response...

Erick

On Wed, Jan 27, 2010 at 6:19 PM, Turner, Robbin J < robbin.j.tur...@boeing.com > wrote:

I have a field Title and Summary.  I've currently not set a default
value for the Summary in my schema, it's just a text field with
indexed=true and stored=true, but not required.  When the data is
indexed sometimes the documents don't have a summary so then Solr doesn't index that field.

When a query is sent and we get the results for those documents
returned, if they did not have a summary then there is no tagged in
the xml for that field.

Is there a way to have the xml always return the field tags for each
document in the result set even if the field has no data?

I apologize ahead of time if this has been answered, but after doing a
bit of search have not been able to find the answer elsewhere.

Thanks
Robbin




Reply via email to