What are the ways to Index nested json objects in solr?
-
I have a json object like this, { "id" : "123", "name" : "aaa", "loc" : { "city" : "xyz", "state" : "abc" }, } In solr i added a field like, <field name="loc" type="string" indexed="true" stored="true" multiValued="true"/> Then i tried adding the json doc to solr But i couldn't see the 'loc' object being indexed in solr. Am i doing wrong? Do i need to add anything in schema.xml Can someone help me out of this pls?
-
Answer:
I think multi-valued fields would be most appropriate for representing a list kind of structure. You can try to flatten the "loc" array and make separate fields like loc_city, loc_state etc. If the "city, state" fields are not fixed, you can probably mark them as dynamic fields.
Piyush Goel at Quora Visit the source
Other answers
Look at "Transforming and Indexing JSON" section in the SOLR programming guide. SOLR allows you to flatten and then make them searchable.... SOLR 5 and others have even better features in this area..
Sarnath Kannan
Related Q & A:
- What are some ways to make extra money while in college?Best solution by Yahoo! Answers
- What are some ways to make money?Best solution by Yahoo! Answers
- What are the ways to determine the credibility of online information?Best solution by Yahoo! Answers
- What are some ways i can style my hair?Best solution by Yahoo! Answers
- What knot can I use to lash two objects together that will tighten on itself and not release?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.