Skip to content

Commit

Permalink
[locator] split words to get more results in all features locator filter
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Dec 18, 2018
1 parent a12bc5f commit c5011df
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/app/locator/qgsinbuiltlocatorfilters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,11 @@ void QgsAllLayersFeaturesLocatorFilter::prepare( const QString &string, const Qg
req.setSubsetOfAttributes( expression.referencedAttributeIndexes( layer->fields() ).toList() );
if ( !expression.needsGeometry() )
req.setFlags( QgsFeatureRequest::NoGeometry );
QString enhancedSearch = string;
enhancedSearch.replace( " ", "%" );
req.setFilterExpression( QStringLiteral( "%1 ILIKE '%%2%'" )
.arg( layer->displayExpression(), string ) );
.arg( layer->displayExpression() )
.arg( enhancedSearch ) );
req.setLimit( 30 );

std::shared_ptr<PreparedLayer> preparedLayer( new PreparedLayer() );
Expand Down

0 comments on commit c5011df

Please sign in to comment.