Indexing hierarchy of embedded records

7 views
Skip to first unread message

Александр Окунев

unread,
Sep 3, 2014, 2:27:18 PM9/3/14
to lily-d...@googlegroups.com
I have record, one of it's field is list of embedded records, some fields of these records are list records too and deeper. I need to index this data by solr and get feelds of the deepest embedded records. But solr mixes everything and i see field values of all deepest record inspite of the fact that i make a solr query to get only one deep record.
For example:
{
        "type": "ns1$Table",
        "fields": {
                "ns1$name": "archivarius",
                "ns1$securityInfo": {
                        "type": "ns1$SecurityInfo",
                        "fields": {
                                "ns1$datastore": "USER.datastore/ARCHIVARIUS",
                                "ns1$user": "USER.user/dev",
                                "ns1$securityLevel": "DISABLE_DEFAULT",
                                "ns1$shared": "FALSE",
                                "ns1$controlledOperations": ["CREATE", "UPDATE", "DELETE"],
                                "ns1$objectInDatastores": [{
                                        "type": "ns1$ObjectInDatastore",
                                        "fields": {
                                                "ns1$datastore": "USER.datastore/ARCHIVARIUS",
                                                "ns1$grantableOperations": ["CREATE", "UPDATE", "DELETE"],
                                                "ns1$userPrivileges": [{
                                                        "type": "ns1$UserPrivileges",
                                                        "fields": {
                                                                "ns1$userInDatastore": "USER.user/ARCHIVARIUS/admin",
                                                                "ns1$privileges": [{
                                                                        "type": "ns1$Privilege",
                                                                        "fields": {
                                                                                "ns1$grantedOperation": "CREATE",
                                                                                "ns1$grantOption": "FALSE"
                                                                        }
                                                                },{
                                                                        "type": "ns1$Privilege",
                                                                        "fields": {
                                                                                "ns1$grantedOperation": "UPDATE",
                                                                                "ns1$grantOption": "TRUE"
                                                                        }
                                                                },{
                                                                        "type": "ns1$Privilege",
                                                                        "fields": {
                                                                                "ns1$grantedOperation": "DELETE",
                                                                                "ns1$grantOption": "FALSE"
                                                                        }
                                                                }]
                                                        }
                                                },{
                                                        "type": "ns1$UserPrivileges",
                                                        "fields": {
                                                                "ns1$userInDatastore": "USER.user/ARCHIVARIUS/user",
                                                                "ns1$privileges": [{
                                                                        "type": "ns1$Privilege",
                                                                        "fields": {
                                                                                "ns1$grantedOperation": "CREATE"
                                                                        }
                                                                },{
                                                                        "type": "ns1$Privilege",
                                                                        "fields": {
                                                                                "ns1$grantedOperation": "DELETE"
                                                                        }
                                                                }]
                                                        }
                                                }]
                                        }
                                }]
                        }
                }
        },
        "namespaces": {"ru.perm.ics.c2rcloudsecurity": "ns1"}
}
If i write in query smth like userInDatastore:USER.user/ARCHIVARIUS/user, i get not only CREATE and DELETE, i also get UPDATE, but mustn't.
Then i tried to undex using forEach. 
Using fields of records of different levels is forbidden or i don't know how to do it.
<forEach expr="ns1:securityInfo">
                <forEach expr="ns1:objectInDatastores">
                      <forEach expr="ns1:userPrivileges">
                             <field name="privileges.${ns1:datastore}_${userInDatastore}string" value="ns1:datastore=>ns1:name"/>
                      </forEach>
                </forEach>
</forEach>
Fields datastore and userInDatastore belong to differet records, so i can't use them both. 
What can i do to solve my problem?
Reply all
Reply to author
Forward
0 new messages