Omit fields from search results

I would like to search in certain fields only.

Currently to achieve this I am adding all fields necessary as per below, however thinking about keeping this up-to-date in the future (if more fields are added to blueprints), I was wondering if there is a way to actually just pass the fields that I do not want to search in, instead of all that I do want to search in?

$results = $databaseItems->bettersearch($query, 'title|firstName|lastName|pronouns|city|state|country|basedCity|basedState|basedCountry|basedCitySecond|basedStateSecond|basedCountrySecond|languageGroup|link|bio|themes|year|secondaryYear|dimensions|medium|description|collectionBody|artworkType|languageGroup|artist|curator|exhibitionType|venue|externalArtist|publications', ['words' => true]);

Thank you!

There is no option, but you could achieve this programmatically, by looping through all blueprints, fetching the fields into an array, then get the intersection between the full array and an array of the fields you want to ignore.

Or you create your own version of the plugin with an additional ignore option.

Thank you :slight_smile: