Skip to content

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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

jonenst
Copy link
Member

@jonenst jonenst commented Jun 18, 2018

No description provided.

@@ -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>( );
Copy link
Member Author

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 );
}

Copy link
Member Author

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 ) )
Copy link
Member Author

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 );
Copy link
Member Author

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 );
Copy link
Member Author

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;
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replace the old system

@jonenst
Copy link
Member Author

jonenst commented Jun 18, 2018

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

@fcoue fcoue changed the title IDEATION-753 : Migration lutece 6.1.0 SOLR-110 : Allow multiple filter queries in SearchApp confs Jun 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants