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 committed Dec 19, 2018
1 parent 565d999 commit 01f6ced
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 @@ -361,8 +361,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 01f6ced

Please sign in to comment.