Last post Jul 24, 2014 05:52 PM by AidyF
Jul 24, 2014 01:02 PM|macupryk|LINK
I am searching for an address
221 Smith or 221 Smith St
in the database it is stored as 221-B Smith St.
how can I fix the query to pickup the instances. It should exclude -B
if (String.IsNullOrEmpty(query) == false)
properties = properties.Where(p => p.CombinedAddress.Contains(query));
If I have 45-10 Dutch St
I should the person will not be able to search on appartment just street number and steet name
Ex: 45 Dutch St
Jul 24, 2014 01:38 PM|PatriceSc|LINK
So for now my understanding is that you would like to search for words found inside the search string rather than for an exact match. Is this the case ?
Or you could consider to split the info ie the street number, appartement number, street name should be likely in separate columns and should be likely be entered as separate search fields. It would "guide" a bit the search.
Or at some point you may want to consider using SQL full text search:
Jul 24, 2014 02:09 PM|macupryk|LINK
There has to be an easy way.
Given a string with a 45-10 Smith Ave.
user should be able to search
45 Smith Ave
and the unit number is excluded
so if there is a - than exclude the number and the "-"
Jul 24, 2014 05:52 PM|AidyF|LINK
Use an advanced indexing technology like Lucene, or SQL Full Text search, or (better) change how you store your data and store both the full display version and also the version you want to search on. Doing the search you want procedurally in either code
or T-SQL will perform very badly.