Skip to content

Commit

Permalink
make fuzzy search case insensitive, fix pid search
Browse files Browse the repository at this point in the history
  • Loading branch information
dbarkowsky committed Jul 9, 2024
1 parent 14cc37f commit 54a6740
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions express-api/src/services/properties/propertiesServices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ const propertiesFuzzySearch = async (keyword: string, limit?: number, agencyIds?
.leftJoinAndSelect('parcel.Classification', 'classification')
.where(
new Brackets((qb) => {
qb.where(`parcel.pid::text like '%${keyword}%'`)
.orWhere(`parcel.pin::text like '%${keyword}%'`)
.orWhere(`agency.name like '%${keyword}%'`)
.orWhere(`adminArea.name like '%${keyword}%'`)
.orWhere(`parcel.address1 like '%${keyword}%'`);
qb.where(`parcel.pid::text ILIKE '%${parseInt(keyword.replaceAll('-', ''))}%'`)
.orWhere(`parcel.pin::text ILIKE '%${keyword}%'`)
.orWhere(`agency.name ILIKE '%${keyword}%'`)
.orWhere(`adminArea.name ILIKE '%${keyword}%'`)
.orWhere(`parcel.address1 ILIKE '%${keyword}%'`);
}),
)
.andWhere(`classification.Name in ('Surplus Encumbered', 'Surplus Active')`);
Expand Down

0 comments on commit 54a6740

Please sign in to comment.