Giter VIP home page Giter VIP logo

Comments (12)

mgoren avatar mgoren commented on July 30, 2024 2

That works. So I think I figured this out. In my testing outside of my app I was searching with code such as the following:

client.list_leads(email: "[email protected]")
# total_results == 0

But actually email: needs to be in quotes as well, as follows:

client.list_leads("email: [email protected]")
# total_results == 4 (though only one lead actually has that exact email)

This despite the fact that it seems to work either way for a name query:

client.list_leads(name: "Test")
client.list_leads("name: Test")
# These 2 queries return the same results.

An additional piece of why I had difficulty troubleshooting this is because even though my production app does the email query the way that works, all of the emails I was using for testing began returning more than one result (a recent change it seems), and my code expects total_results to equal 1 when doing an email query. For some reason Close (even in the app) often returns extraneous results even when searching for a specific email (results with similar emails for example), but I believe that in the past when querying via the API with an email query it actually did formerly return just the 1 result.

Thanks so much for your help and your work on this! If you know of a way to query Close to get it to only return the results with exact matching email, that would be great to know. I suppose I could just limit to 1 result and assume the first one is the one that matches most closely.

Thanks again for your help.

from closeio.

nickpersico avatar nickpersico commented on July 30, 2024 2

@taylorbrooks @quantummachina @mgoren Thanks. I've pinged the team about this and we'll chime in soon.

from closeio.

taylorbrooks avatar taylorbrooks commented on July 30, 2024

I assume that at one point, this call returned results as expected?

client.list_leads(email: "[email protected]") 

from closeio.

taylorbrooks avatar taylorbrooks commented on July 30, 2024

I just tested against my Close.io instance and it works as expected.

If you paste the email you're searching for into the Close.io app, do you get results? Maybe the email you're searching for was removed or the contact itself was removed.

from closeio.

mgoren avatar mgoren commented on July 30, 2024

Weird! Thanks so much for looking into that for me.

Yes, that call did work fine in the past, and it still works fine searching for that email within the Close.io app and using the sample python code provided by Close. Is there maybe an alternate syntax I can use with your gem to test finding a lead by email? Maybe client.get(...)?

Thanks!

from closeio.

taylorbrooks avatar taylorbrooks commented on July 30, 2024

What's the result of this?

client.list_leads('[email protected]')

from closeio.

quantummachina avatar quantummachina commented on July 30, 2024

I am tracking the same issue, it stopped working for us yesterday or so. Our code also was running fine before, and I just tested that solution @mgoren came with. Thank you. Even it is a workaround, it will help. Still looking for what changed back there.

from closeio.

taylorbrooks avatar taylorbrooks commented on July 30, 2024

Something must've changed on the API side then.

Any changes in the service that would have an effect here?

cc @philfreo @nickpersico

from closeio.

jkemp101 avatar jkemp101 commented on July 30, 2024

We are in the middle of migrating to some new infrastructure and it looks like it created this change in the search behavior. I will give another update shortly once we get to the bottom of this.

from closeio.

mgoren avatar mgoren commented on July 30, 2024

Upon further experimentation, I figured out a fix.

Originally I had been searching as follows:

client.list_leads(email: "[email protected]")
# worked in the past but now returns 0 results

When that stopped working, I changed to the code I mentioned above:

client.list_leads("email: [email protected]")
# returns multiple results, including extraneous ones

This successfully returned results, but included extraneous ones. To retrieve only exact matches I included quotes around the entire query but also around the email within the query:

client.list_leads('email: "[email protected]"')
# returns just the exact match

from closeio.

jkemp101 avatar jkemp101 commented on July 30, 2024

Following-up on this issue. We are in the middle of adding some more sophisticated email searching functionality by parsing addresses around the @ symbol. But this actually got inadvertently triggered in this particular case because the search terms are being single quoted instead of double quoted.

I believe all that needs to be done is change this line

query.map { |k,v| "#{k}:'#{v}'" }.join(' ')

to query.map { |k,v| "#{k}:\"#{v}\"" }.join(' ') so it uses double quotes.

Should probably also check if it is already wrapped in quotes just to be safe.

from closeio.

taylorbrooks avatar taylorbrooks commented on July 30, 2024

I believe this issue has been fixed, but in the event that it hasn't, please open a new issue.

from closeio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.