Answered

RecordSearchArg's Search field

Hello,

I'm currently writing a search to go through UGC as shown in this post (under Agility.UGC.API.SearchRecords (.NET)). However, it seems to fail with the following exception: There was a syntax problem with the search element.

The Search field was set to a string of about ~6000 characters, but when I shortened that to around ~1100, I didn't get an error. I guess my questions are whether there is a limitation on the Search field's length, and whether there are any workarounds. Thanks for your help.

0

Comments

3 comments
  • Official comment

    Hi Andrew,

    Unfortunately, you will run into string length issues in this case. One way you could work around this would be to have a separate database of long/lats for your locations and then compute what locations are nearest using math. Each location in your db would then have an ID that corresponds to the UGC record.

    Comment actions Permalink
  • Hi Andrew

    There very well could be a limit on the search query - we haven't had a use case where the search field had that many characters. If you don't mind me asking, what are you searching for here?

     

    1
    Comment actions Permalink
  • Basically, the records correspond to an event/social occasion, with a date, time, location, etc. I'm attempting to implement a page where a visitor could enter a zip code and we would find a list of zip codes within a certain radius using a separate database, and display the UGC/events that matched the zip codes.

    The initial radius was 100 miles, which generated about 750 zip codes in the list. Then the Search field was set to "ZipCode In ('11111', '22222', '33333', ...)" which was why the string was so large.

    I can think of a couple workarounds on my end, but I'm curious what the limit is, so I can find a reasonable upper bound to the radius if I decide to keep the current implementation.

    0
    Comment actions Permalink

Please sign in to leave a comment.

Didn't find what you were looking for?

New post