Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to deal with nested objects #14

Closed
drmeph opened this issue Dec 14, 2012 · 2 comments
Closed

how to deal with nested objects #14

drmeph opened this issue Dec 14, 2012 · 2 comments

Comments

@drmeph
Copy link

drmeph commented Dec 14, 2012

Hi folks,
I'm having trouble to import nested objects into solr. my mongodb object has this form:

rs0:PRIMARY> x
{
"_id" : ObjectId("50c44df9058f6fe4cb69335e"),
"date" : ISODate("2012-12-09T05:00:00Z"),
"nid" : 3,
"sid" : 17411,
"siteRef" : "3-17411",
"total" : {
"a" : 311119,
"ab" : 248929,
"aw" : 4308,
"c" : 1.9857989999999885,
"r" : 0.2903688648648634
},
"web" : {
"a" : 311119,
"ab" : 248929,
"aw" : 4308,
"c" : 1.9857989999999885,
"r" : 0.2903688648648634
}
}

SEVERE: org.apache.solr.common.SolrException: ERROR: [doc=50c44df9058f6fe4cb69335e] Error adding field 'total'='[a, c, ab, r, aw]'

this is the error from solr... but it's only to highlight that solr see "total" as an Array, but it's supposed to be a JSON Object.

Anyway about the schema.xml in Solr I put a bad parameter to raise an error to show that structure.
But with the following configuration :

there is no error but the structures "web" "total" doesn't show up in solr

@bobend
Copy link
Contributor

bobend commented Dec 14, 2012

I don't think the current stable version of solr support complex object or
lists of complex objects. Have you tried elastic search? (I have the same
problem, but I'm stuck with Solr at the moment).

Best regards
Bo Bendtsen
Den 14/12/2012 19.33 skrev "drmeph" notifications@github.com:

Hi folks,
I'm having trouble to import nested objects into solr. my mongodb object
has this form:

rs0:PRIMARY> x
{
"_id" : ObjectId("50c44df9058f6fe4cb69335e"),
"date" : ISODate("2012-12-09T05:00:00Z"),
"nid" : 3,
"sid" : 17411,
"siteRef" : "3-17411",
"total" : {
"a" : 311119,
"ab" : 248929,
"aw" : 4308,
"c" : 1.9857989999999885,
"r" : 0.2903688648648634
},
"web" : {
"a" : 311119,
"ab" : 248929,
"aw" : 4308,
"c" : 1.9857989999999885,
"r" : 0.2903688648648634
}
}

SEVERE: org.apache.solr.common.SolrException: ERROR:
[doc=50c44df9058f6fe4cb69335e] Error adding field 'total'='[a, c, ab, r,
aw]'

this is the error from solr... but it's only to highlight that solr see
"total" as an Array, but it's supposed to be a JSON Object.

Anyway about the schema.xml in Solr I put a bad parameter to raise an
error to show that structure.
But with the following configuration :

there is no error but the structures "web" "total" doesn't show up in solr


Reply to this email directly or view it on GitHubhttps://github.com//issues/14.

@ghost ghost assigned tjj5036 Jul 16, 2013
@tjj5036
Copy link
Contributor

tjj5036 commented Jul 22, 2013

Currently at the moment Solr doesn't support nested json. You can have lists though. So if you have something like:

In your schema.xml, you can do something like:

db.insert({'cat' : ['foo', 'bar']})

I think at the moment this is as close as you can get unfortunately. If this changes I will reopen the issue and add support.

@tjj5036 tjj5036 closed this as completed Jul 22, 2013
lnader pushed a commit to lnader/mongo-connector that referenced this issue Feb 27, 2020
SEAR-137, add one oplog timestamp file per index
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants