Coder Social home page Coder Social logo

Comments (6)

AtmaMani avatar AtmaMani commented on August 27, 2024

@bixb0012 yes this is a result of optimization in search logic, not by the Python API, but by the REST API. Searching returns results from an index that captures only certain fields and size is not part of it. However when you use get, you query and obtain the full item. Hence the disparity.

After filtering your search result, you could call the _hydrate() method on the item of interest to get its size among other information.

This is not documented because they hydration logic happens transparently to the user when you request for a property that is not initialized.

from arcgis-python-api.

bixb0012 avatar bixb0012 commented on August 27, 2024

@AtmaMani , thanks for the prompt reply and additional information.

I get what you are saying about the REST API doing the optimization, and why that would be beneficial.

I tried calling _hydrate() and it does do the trick. That said, I am a bit confused with your comment about hydration, not the logic/concept but the results I am seeing. If hydration "happens transparently to the user when you request for a property that is not initialized," why doesn't it happen when I try to retrieve the size initially?

from arcgis-python-api.

AtmaMani avatar AtmaMani commented on August 27, 2024

@bixb0012 good point, I anticipated that question from you. Interestingly size property was not uninitialized in the response from portal when you did a search query. Instead, it was set to -1, hence the hydration logic did not kick in when you queried for that property.
I will discuss this over with the portal team and see if the server can drop this key value pair in the JSON response for search query since its not indexed anyway.

from arcgis-python-api.

bixb0012 avatar bixb0012 commented on August 27, 2024

Any updates from the Portal team? If, for whatever reason the Portal team doubles down on -1, do you think the hydration logic could be updated to trigger with invalid/nonsensical values like -1?

from arcgis-python-api.

rohitgeo avatar rohitgeo commented on August 27, 2024

@bixb0012, thanks for the suggestion. We will fix this in the next update.

from arcgis-python-api.

AtmaMani avatar AtmaMani commented on August 27, 2024

Fixed in v1.0.1 of arcgis package

from arcgis-python-api.

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.