Skip to content
Permalink
Browse files

[locator] split words to get more results in all features locator filter

  • Loading branch information
3nids committed Dec 18, 2018
1 parent a12bc5f commit c5011df2c7a492a6545f94b7eba9ddd1fd2693b5
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/app/locator/qgsinbuiltlocatorfilters.cpp
@@ -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() );

0 comments on commit c5011df

Please sign in to comment.
You can’t perform that action at this time.