}
BooleanQuery q = new BooleanQuery();
if ( StringUtils.isNotBlank( searchFields.getGroupId() ) )
{
q.add( indexer.constructQuery( MAVEN.GROUP_ID, new StringSearchExpression( searchFields.getGroupId() ) ),
Occur.MUST );
}
if ( StringUtils.isNotBlank( searchFields.getArtifactId() ) )
{
q.add(
indexer.constructQuery( MAVEN.ARTIFACT_ID, new StringSearchExpression( searchFields.getArtifactId() ) ),
Occur.MUST );
}
if ( StringUtils.isNotBlank( searchFields.getVersion() ) )
{
q.add( indexer.constructQuery( MAVEN.VERSION, new StringSearchExpression( searchFields.getVersion() ) ),
Occur.MUST );
}
if ( StringUtils.isNotBlank( searchFields.getPackaging() ) )
{
q.add( indexer.constructQuery( MAVEN.PACKAGING, new StringSearchExpression( searchFields.getPackaging() ) ),
Occur.MUST );
}
if ( StringUtils.isNotBlank( searchFields.getClassName() ) )
{
q.add(
indexer.constructQuery( MAVEN.CLASSNAMES, new StringSearchExpression( searchFields.getClassName() ) ),
Occur.MUST );
}
if ( StringUtils.isNotBlank( searchFields.getBundleSymbolicName() ) )
{
q.add( indexer.constructQuery( OSGI.SYMBOLIC_NAME,
new StringSearchExpression( searchFields.getBundleSymbolicName() ) ),
Occur.MUST );
}
if ( StringUtils.isNotBlank( searchFields.getBundleVersion() ) )
{
q.add(
indexer.constructQuery( OSGI.VERSION, new StringSearchExpression( searchFields.getBundleVersion() ) ),
Occur.MUST );
}
if ( StringUtils.isNotBlank( searchFields.getBundleExportPackage() ) )
{
q.add( indexer.constructQuery( OSGI.EXPORT_PACKAGE,
new StringSearchExpression( searchFields.getBundleExportPackage() ) ),
Occur.MUST );
}
if ( StringUtils.isNotBlank( searchFields.getBundleExportService() ) )
{
q.add( indexer.constructQuery( OSGI.EXPORT_SERVICE,
new StringSearchExpression( searchFields.getBundleExportService() ) ),
Occur.MUST );
}
if ( StringUtils.isNotBlank( searchFields.getBundleImportPackage() ) )
{
q.add( indexer.constructQuery( OSGI.IMPORT_PACKAGE,
new StringSearchExpression( searchFields.getBundleImportPackage() ) ),
Occur.MUST );
}
if ( StringUtils.isNotBlank( searchFields.getBundleName() ) )
{
q.add( indexer.constructQuery( OSGI.NAME, new StringSearchExpression( searchFields.getBundleName() ) ),
Occur.MUST );
}
if ( StringUtils.isNotBlank( searchFields.getClassifier() ) )
{
q.add(
indexer.constructQuery( MAVEN.CLASSIFIER, new StringSearchExpression( searchFields.getClassifier() ) ),
Occur.MUST );
}
if ( q.getClauses() == null || q.getClauses().length <= 0 )
{