<div dir="ltr">Back with QGIS 2 I wrote a plugin that would do a search on all attributes and all layers (Search Layers plugin) I ported it to QGIS 3 to satisfy user requests despite the Locator service being available. I currently have a request to update this plugin to allow another search string with AND, OR, NOT operations. <div><br></div><div>The questonI have is what is the fastest way to search through the attributes? The current implementation in the Search Layers plugin when searching all attributes is to iterate through each feature and test the search string on a string representation of each attribute field. If there is a match it is reported.</div><div><br></div><div>If I am searching a single attribute then I set up a QgsFeatureRequest and set the filter expression and then I can just iterate through all the features that match the expression.</div><div><br></div><div>With all the enhancements to QGIS, is there a better way to do these searches? The result of the search needs to include which feature matched and which attribute(s) matched. I am looking for the fastest method of searching a vector layer.</div><div><br></div><div>Thanks,</div><div><br></div><div>Calvin</div><div><br></div><div><br></div></div>