[libRETS-users] Search Query problem in c#

374 views
Skip to first unread message

Eduardo Octavio Lamphar Castro

unread,
Aug 17, 2011, 3:53:14 PM8/17/11
to libret...@crt.realtors.org
When I set the query in c#, i have a RetsReplyException when i:

{"V2.6.0 748: Field County Encountered    *   *    at line 1, column 92. Was expecting one of:      +  ...      |  ...      ~  ...      .EMPTY.  ...      .ANY.  ...      STRING_LITERAL  ...     "}

this is my code:

SearchRequest search = this.Session.CreateSearchRequest(searchType, searchClass.ToString(), "(ListingModificationDate=2011-07-01T00:00:00+),(ListingStatus=|Active),(State=|CA),(County=*Los Angeles*)");
search.SetQueryType(SearchRequest.QueryType.DMQL2);
search.SetStandardNames(false);
search.SetOffset(offset);
results = this.Session.Search(search);
return results;

i am having problems with the query in the parameter County=*Los Angeles*

how should the query be?

thanks.

ATTE.: Eduardo

Dylan Thompson

unread,
Aug 17, 2011, 4:06:36 PM8/17/11
to For discussion and help for and by the users of the libRETS C++ library
Try quoting the string, e.g.

(County="*Los Angeles*")

I think the issue is the white space.

_______________________________________________
libRETS-users mailing list
libRET...@crt.realtors.org
http://mail.crt.realtors.org/mailman/listinfo/librets-users


Dylan Thompson

unread,
Aug 17, 2011, 4:19:56 PM8/17/11
to For discussion and help for and by the users of the libRETS C++ library
rather try putting the asterisks outside of the quotes.

(County=*"Los Angeles"*)

Tony Manhollan

unread,
Aug 17, 2011, 5:02:19 PM8/17/11
to libret...@crt.realtors.org
Looks like County is a lookup field. I don't think you can use wildcards with a lookup. Examine the metadata for lookup types and make sure you supply the correct value without the asterisks. e.g. (County=Los Angeles)

KCZ

unread,
Aug 17, 2011, 5:21:53 PM8/17/11
to For discussion and help for and by the users of the libRETS C++ library
I hope this can help you.

Example:
the field "County" has Lk_County as Lookup ..then  look into lookup class 

It can be:

Lookup Code     Key                  Short Desc       Long Desc
Lk_County        GOSHEN        GOSHEN         Goshen
Lk_County        HOT SPRING HOT SPRING Hot Springs
Lk_County        LOS ANGEL      Los Angeles      Los Angeles


Now, your query should be:
(ListingModificationDate=2011-07-01T00:00:00+),(ListingStatus=|ACT),(State=|CA),(County=LOS ANGEL)

try using the Key instead description.(check ListingStatus as well)

Thanks,

KC




Eduardo Octavio Lamphar Castro

unread,
Aug 17, 2011, 6:34:14 PM8/17/11
to libret...@crt.realtors.org

Thank you very much,

i did it like this (County=LOS ANGELES-CA) and it worked 

thanks


ATTE.: Eduardo




Date: Wed, 17 Aug 2011 15:21:53 -0600
From: kcz...@gmail.com
To: libret...@crt.realtors.org
Subject: Re: [libRETS-users] Search Query problem in c#

Keith T. Garner

unread,
Aug 18, 2011, 10:20:22 AM8/18/11
to For discussion and help for and by the users of the libRETS C++ library
It looks like you got your answer, but for the record, I want to point out that the error your received was from the server and not generated by libRETS. If you looked at the http log you would have seen it come across.

Glad you got the help, but I like people to understand where libRETS begins and ends.

Keith

On Aug 17, 2011, at 2:53 PM, Eduardo Octavio Lamphar Castro wrote:

> When I set the query in c#, i have a RetsReplyException when i:
>
> {"V2.6.0 748: Field County Encountered * * at line 1, column 92. Was expecting one of: + ... | ... ~ ... .EMPTY. ... .ANY. ... STRING_LITERAL ... "}

--
Keith T. Garner - kga...@realtors.org - 312-329-3294 - http://realtor.org/
National Association of REALTORS® - VP - Information Technology Services

Reply all
Reply to author
Forward
0 new messages