Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9007315
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:39:20+00:00 2026-06-16T01:39:20+00:00

I have a rather JSON response coming back from a solr instance…. {responseHeader: {status:0,QTime:1,params:{sort:score

  • 0

I have a rather JSON response coming back from a solr instance….

{"responseHeader":
  {"status":0,"QTime":1,"params":{"sort":"score asc","fl":"*,score",
    "q":"{! score=distance}","wt":"json","fq":"description:motor","rows":"1"}},
        "response":{"numFound":9,"start":0,"maxScore":6.8823843,"docs":
                  [{"workspaceId":2823,"state":"MN","address1":"1313 mockingbird Lane",
                    "address2":"","url":"http://mydomain.com/","city":"Minneapolis",
                    "country":"US","id":"399068","guid":"","geo":["45.540239, -98.580473"],
                    "last_modified":"2012-12-12T20:40:29Z","description":"ELEC MOTOR",
                    "postal_code":"55555","longitude":"-98.580473","latitude":"45.540239",
                    "identifier":"1021","_version_":1421216710751420417,"score":0.9288697}]}}

And I’m trying to map that to a java object:

public class Item extends BaseModel implements Serializable {
    private static final long serialVersionUID = 1L;

    protected Integer workspaceId;
    protected String name;
    protected String description;
    protected String identifier;
    protected String identifierSort;
    protected Address address;
    protected String url;

        /** getters and setters eliminated for brevity **/
}

public class Address implements Serializable {
    private static final long serialVersionUID = 1L;

    protected String address1;
    protected String address2;
    protected String city;
    protected String state;
    protected String postalCode;
    protected String country;
            /** getters and setters eliminated for brevity **/
    }

How do I map the address1, address2, city, state, etc… into the Address object in the Item object? I’ve been reading about Jackson annotations but nothing really jumps out at me as to where to begin.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T01:39:21+00:00Added an answer on June 16, 2026 at 1:39 am

    We ended up using Solrj – sort of.

    We wrote our own SolrResult object that we fed to SolrJ like so:

    List<SolrResult> solrResults = rsp.getBeans(SolrResult.class);
    

    And then in SolrResult.java where we had complex or nested objects we just first used SolrJ annotation to get the field and then just set the value as needed…

    @Field("address1")
    public void setAddress1(String address1) {
        this.item.getAddress().setAddress1(address1);
    }
    

    It wasn’t hard just feels a bit messy, but it does work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have data from JSON response that I am transferring to an array as
I have a rather complicated lookup for an option. It comes from a separate
I have a rather complicated (and very inefficient) way of getting utilisation from a
I am new to JSON and I have a rather basic question.... Here is
I want to have only review from this JSON. var json = { provider:
I'm trying to put content from a JSON feed I have into an ListView,
I have rather large project that uses ICU regex classes. Basically it might run
Have a rather simple question. Does anyone knows if i can use jparallax both
I have some rather odd behavior in my D program that I've narrowed down
I have a rather large text corpus, of which I would like to check

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.