Skip to content

Commit

Permalink
[locator] split words to get more results in all features locator fil…
Browse files Browse the repository at this point in the history
…ter (#8704)

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

* Update src/app/locator/qgsinbuiltlocatorfilters.cpp

Co-Authored-By: 3nids <denis.rouzaud@gmail.com>

* Update src/app/locator/qgsinbuiltlocatorfilters.cpp

Co-Authored-By: 3nids <denis.rouzaud@gmail.com>

* Update src/app/locator/qgsinbuiltlocatorfilters.cpp

Co-Authored-By: 3nids <denis.rouzaud@gmail.com>
  • Loading branch information
3nids authored Dec 19, 2018
1 parent 0e7427f commit 30b55cc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/app/locator/qgsinbuiltlocatorfilters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,10 @@ 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(), enhancedSearch ) );
req.setLimit( 30 );

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

0 comments on commit 30b55cc

Please sign in to comment.