-
Notifications
You must be signed in to change notification settings - Fork 11
SOLR-110 : Allow multiple filter queries in SearchApp confs #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
@@ -52,6 +52,7 @@ | |||
private String _strTemplate = SolrConstants.CONSTANT_DEFAULT_TEMPLATE; | |||
private boolean _bExtraMappingQuery = SolrConstants.CONSTANT_DEFAULT_EXTRA_MAPPING_QUERY; | |||
private List<String> _listAddonBeanNames = new ArrayList<String>( ); | |||
private List<String> _listFilterQuery = new ArrayList<String>( ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should replace the old system (_strFilterQuery)
{ | ||
getListFilterQuery( ).add( strFilterQuery ); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should replace the old system
@@ -80,6 +81,10 @@ public static SolrSearchAppConf loadConfiguration( String code ) | |||
{ | |||
conf.setFilterQuery( referenceItemName ); | |||
} | |||
else if ( referenceItemCode.matches( DSKEY_FQ_REGULAR_EXPR ) ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency, it's better to do it the same way as the addonBeans, ie computing the full prefix and use startsWith instead of a regexp
@@ -80,6 +81,10 @@ public static SolrSearchAppConf loadConfiguration( String code ) | |||
{ | |||
conf.setFilterQuery( referenceItemName ); | |||
} | |||
else if ( referenceItemCode.matches( DSKEY_FQ_REGULAR_EXPR ) ) | |||
{ | |||
conf.addFilterQuery( referenceItemName ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to update SaveConfiguration as well even though it's not called yet.
Adding tests would be an even better bonus :)
facetQueryTmp.addAll( conf.getListFilterQuery( ) ); | ||
} | ||
facetQuery = new String[ facetQueryTmp.size( ) ]; | ||
facetQuery = facetQueryTmp.toArray( facetQuery ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should replace the previous code for a single filter query
*/ | ||
public void setListFilterQuery(List<String> listFilterQuery) { | ||
this._listFilterQuery = listFilterQuery; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replace the old system
Also please create a dedicated JIRA for this on the plugin-solr project and use it in the commit message. You should also link this new JIRA to the IDEATION-753 one |
No description provided.