cancel
Showing results for 
Search instead for 
Did you mean: 

Share Forms - force & Advanced Search

mtw999
Champ in-the-making
Champ in-the-making
Hello,

I have Search form for a custom type that has aspect properties. However, until I specified force="true" for the show element for the aspect properties, terms for the aspect property were not being used in the search. By debugging advsearch jsp I did see the terms seemed to be in the query variable and I did not see anything at all as far as SOLR debug (enabled SolrQueryHTTPClient for debug)

After setting force="true" my aspect property terms are now being search.

My Question, I read forms WIKI and I see what force does (below), but what exactl does this mean? Specifically, what is correlation of force attribute and my Advanced Search term? In my case, when force was not true, were no definitions for the aspect properties to those corresponding fields? What does FormService check if force is false vs. true?

There are fields that may be optional for an item i.e. by default they may not be returned by the server. When set to "true" this attribute informs the FormService that it should do everything it can to find and return a definition for the field.

Mike
1 REPLY 1

afaust
Legendary Innovator
Legendary Innovator
Hello,

your search form is configured to serve a specific type of object. By default, only the properties and associations of that type and any of its default aspects will be used to generate the form definition on the Repository tier (which then is used to generate the actual form on the Share tier). If you force a specific field you basically say that "no matter if type X has (or can have) property / association Y, include it". This is almost always useful only for aspects, because they - by design - are typically optional on objects / types and thus would not be included in the form otherwise.

In short:
- if force is false (or not set), FormService will only generate a field if that actually exists on the type (directly or through inheritance)
- if force is true, FormService will generate the field no matter what (it should at least be defined in the data model)

I know this is basically what the wiki says - I can find no way to simplify it more or give more detail without getting to technical.

The problem you describe in the first paragraph sounds like the result of not setting force to true but still including the field in the appearance-section of the form config with a control-template. Whenever you explicitly assign a control-template, that field will be generated in the user interface even if the FormService did not generate a description for it. As a result, it may use an incorrect identifier which - in turn - will lead to the field not being incorporated into the search query (a specific identifier format is expected).

Regards
Axel