Skip to content
Permalink
Browse files

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

…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 committed Dec 19, 2018
1 parent 0e7427f commit 30b55cc68fb2494da1f5d601fbe1e63eb51cf4ec
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/app/locator/qgsinbuiltlocatorfilters.cpp
@@ -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() );

0 comments on commit 30b55cc

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