Search Queries and text with spaces

519 views
Skip to first unread message

Jeffrey Satz

unread,
Feb 18, 2016, 1:14:48 AM2/18/16
to PHRETS
When creating a query, I am getting a search syntax error when my string criteria has spaces in it.

Here is what I tried


(SUBDIVISION=Ridgemont Sec 4) produces ERROR

Adding single quotes doesn't help
(SUBDIVISION='Ridgemont Sec 4') produces ERROR

Using wildcard and quotes:
(SUBDIVISION='Ridgemont*') produces ERROR

Using wildcard without quotes
(SUBDIVISION=Ridgemont*) works as expected

My question is while this query is fine, I do have subdivisions that have spaces in them. How can I get those to run? I saw a DMQL tutorial that said the single quotes should work.

Any help?

Should I possibly replace spaces with a "?" character?

Thanks

Mariano Iglesias

unread,
Feb 18, 2016, 7:49:59 AM2/18/16
to phr...@googlegroups.com
That looks like a field with predefined values. Try:

(SUBDIVISION=|Ridgemont Sec 4)
--
You received this message because you are subscribed to the Google Groups "PHRETS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phrets+un...@googlegroups.com.
To post to this group, send email to phr...@googlegroups.com.
Visit this group at https://groups.google.com/group/phrets.
For more options, visit https://groups.google.com/d/optout.

Jeffrey Satz

unread,
Feb 18, 2016, 2:28:47 PM2/18/16
to PHRETS
Thanks. Newbie question, but what does the "|" character do in the query?


On Thursday, February 18, 2016 at 6:49:59 AM UTC-6, Mariano Iglesias wrote:
That looks like a field with predefined values. Try:

(SUBDIVISION=|Ridgemont Sec 4)

On Wednesday, 17 February 2016, Jeffrey Satz <jeffr...@gmail.com> wrote:
When creating a query, I am getting a search syntax error when my string criteria has spaces in it.

Here is what I tried


(SUBDIVISION=Ridgemont Sec 4) produces ERROR

Adding single quotes doesn't help
(SUBDIVISION='Ridgemont Sec 4') produces ERROR

Using wildcard and quotes:
(SUBDIVISION='Ridgemont*') produces ERROR

Using wildcard without quotes
(SUBDIVISION=Ridgemont*) works as expected

My question is while this query is fine, I do have subdivisions that have spaces in them. How can I get those to run? I saw a DMQL tutorial that said the single quotes should work.

Any help?

Should I possibly replace spaces with a "?" character?

Thanks

--
You received this message because you are subscribed to the Google Groups "PHRETS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phrets+unsubscribe@googlegroups.com.

Mariano Iglesias

unread,
Feb 18, 2016, 3:04:35 PM2/18/16
to phr...@googlegroups.com
Did it work?

Well, that means that you are specifying a set of values for a Lookup Field you want to match. Check http://www.exacthelp.com/2012/01/dmql-or-dmql2-search-conditions-on-look.html

I did find that most of the time (MyLookupField=Value1,Value2) would work, but when the Values being queried contain special chars (such as -), then | is definitely needed.

On Thu, Feb 18, 2016 at 4:28 PM, Jeffrey Satz <jeffr...@gmail.com> wrote:
Thanks. Newbie question, but what does the "|" character do in the query?

On Thursday, February 18, 2016 at 6:49:59 AM UTC-6, Mariano Iglesias wrote:
That looks like a field with predefined values. Try:

(SUBDIVISION=|Ridgemont Sec 4)

On Wednesday, 17 February 2016, Jeffrey Satz <jeffr...@gmail.com> wrote:
When creating a query, I am getting a search syntax error when my string criteria has spaces in it.

Here is what I tried


(SUBDIVISION=Ridgemont Sec 4) produces ERROR

Adding single quotes doesn't help
(SUBDIVISION='Ridgemont Sec 4') produces ERROR

Using wildcard and quotes:
(SUBDIVISION='Ridgemont*') produces ERROR

Using wildcard without quotes
(SUBDIVISION=Ridgemont*) works as expected

My question is while this query is fine, I do have subdivisions that have spaces in them. How can I get those to run? I saw a DMQL tutorial that said the single quotes should work.

Any help?

Should I possibly replace spaces with a "?" character?

Thanks

--
You received this message because you are subscribed to the Google Groups "PHRETS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phrets+un...@googlegroups.com.

To post to this group, send email to phr...@googlegroups.com.
Visit this group at https://groups.google.com/group/phrets.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "PHRETS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phrets+un...@googlegroups.com.

Jeffrey Satz

unread,
Feb 18, 2016, 6:21:11 PM2/18/16
to PHRETS
Thanks! I will try tomorrow on the query.

Jeffrey Satz

unread,
Feb 19, 2016, 4:04:06 PM2/19/16
to PHRETS
Did not seem to work.

I get this

My query:
(CLOSEDDATE=2015-08-23+),(LISTSTATUS=CLOSD),(SUBDIVISION|=Ridgemont*),(YEARBUILT=1972-1980),(SQFTBLDG=1008-1708),(BEDS=3),(BATHSFULL=2)

Taking the "|" out, it runs fine.

Fatal error: Uncaught exception 'PHRETS\Exceptions\RETSException' with message 'Invalid Query Syntax' in Session.php:379 Stack trace: #0 Session.php(297): PHRETS\Session->request('Search', Array) #1 RETS_test.php(172): PHRETS\Session->Search('Property', 'RES', '(CLOSEDDATE=201...') #2 {main} thrown 

On Thursday, February 18, 2016 at 12:14:48 AM UTC-6, Jeffrey Satz wrote:

Mariano Iglesias

unread,
Feb 19, 2016, 4:11:28 PM2/19/16
to phr...@googlegroups.com
The | goes after the =
--

Jeffrey Satz

unread,
Feb 19, 2016, 6:21:22 PM2/19/16
to PHRETS
Same results

(CLOSEDDATE=2015-08-23+),(LISTSTATUS=CLOSD),(SUBDIVISION=|Ridgemont*),(YEARBUILT=1972-1980),(SQFTBLDG=1008-1708),(BEDS=3),(BATHSFULL=2)

Fatal error: Uncaught exception 'PHRETS\Exceptions\RETSException' with message 'Invalid Query Syntax' in /Session.php:379 Stack trace: #0 /vendor/troydavisson/phrets/src/Session.php(297): PHRETS\Session->request('Search', Array) #1 /RETS_test.php(172): PHRETS\Session->Search('Property', 'RES', '(CLOSEDDATE=201...') #2 {main} thrown in/Session.php on line 379



On Thursday, February 18, 2016 at 12:14:48 AM UTC-6, Jeffrey Satz wrote:

Gennadiy Kofman

unread,
Feb 22, 2016, 3:39:33 PM2/22/16
to PHRETS
Can you see if subdivision is a lookup field?  If it's not, | will not work.

Here is a nice tutorial where you can see how to use queries for text fields:
http://www.exacthelp.com/2012/01/dmql-or-dmql2-search-conditions-on.html

vs lookup fields:
http://www.exacthelp.com/2012/01/dmql-or-dmql2-search-conditions-on-look.html

However, that doesn't answer your original question of spaces, and I'm not sure about that and yes, you can try replacing spaces with ? to see if that works.
Reply all
Reply to author
Forward
0 new messages