This question about Missing functionality: Answered

Consider adding clear="field1,field2" feature for formatting results?

LDAP search offers a handy clear="field1,field2,..." feature whereby if the field does not exist in the LDAP record you won't get $field1 or $field2 etc. in your output - you'll get a blank instead. Would you consider adding this feature to SOLRSEARCH and SOLRFORMAT too? It would help in cases where - for example, the search is displaying form fields but some of the topics were created before one of the displayed fields existed in the form - so for those topics that form field is not defined and not indexed.

The basic functionality can also be achieved using an IF but clear= is a lot easier to write and read.

-- LeilaPearson - 21 Apr 2014

It is there. Just define the fields you need in the fields parameter. This does two things:

  1. just request those fields specified in the response json
  2. clear the listed $fields from the format string

-- MichaelDaum - 22 Apr 2014

Thanks Michael. I thought the fields parameter was only for efficiency in the json response. I didn't realize it would also help by clearing the fields.

My only other comment would be that since I'm using and displaying about 10 fields but only one of them is likely to be missing from some of the documents, I have a lot more typing to do than if I could just list the one field in a clear parameter. So a clear parameter might be a nice feature to add even if it can be accomplished another way.

-- LeilaPearson - 24 Apr 2014
 

QuestionForm edit

Subject Missing functionality
Extension SolrPlugin
Version Foswiki 1.1.9
Status Answered
Related Topics
Topic revision: r3 - 24 Apr 2014, LeilaPearson
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy