Ask Your Question
0

Whitespace in query searches for property

asked 2019-10-14 19:54:32 -0500

For some reason when I search the database for city’s or other fields that contain multiple strings eg; San Francisco, Pleasant Hill, etc I always get a “no records found”, while searching for the zip codes will list those cities. I have an idea that it could have something to do with the way it handles whitespace characters, does anybody know what the solution is for this?

I'm using rets-npm client with Node,

edit retag flag offensive close merge delete

Comments

What RETS URL and Login name (NO PASSWORDS).

bwolven gravatar imagebwolven ( 2019-10-15 06:25:29 -0500 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2019-10-15 11:42:08 -0500

You need to look at the metadata for the field to determine how to search the field.
If the field is a lookup then you would use the "Value" from the associated lookup in the search.

For example for MAXEBRDI field L_City:
<lookup>
<longvalue>SAN FRANCISCO</longvalue>
<shortvalue>SANFRCISCO</shortvalue>
<value>SANFRCISCO</value>
</lookup>

The query would be: (L_City=SANFRCISCO)
You can also try wildcard on character type fields like: SANF*

Searching is by the value returned when searching and returning COMPACT format data.
COMPACT-DECODED would return the "LongValue" from the lookup.

edit flag offensive delete link more

Comments

Ahh I see thank you so much! That worked, so should I"m trying to build a search engine, is the best route to just create a lookup table for all the city's and to use that for my query's or is there actually a way to query based on the long value?

Adeola13 gravatar imageAdeola13 ( 2019-10-15 12:08:44 -0500 )edit

For lookup type fields, the search is always based on the lookup Value.
The Short and Long values are really more for display purposes in a client.
In some fields it may just be a numeric value that translates to text using the lookup.

bwolven gravatar imagebwolven ( 2019-10-15 13:15:59 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2019-10-14 19:54:32 -0500

Seen: 21 times

Last updated: Oct 15 '19