Main Overview Wiki Issues Forum Build Fisheye

Welcome, Guest
Guest Settings

Compass Support Forums » Compass » Compass Users

Thread: indexing multilevel object graph

This question is not answered. Helpful answers available: 2. Correct answers available: 1.

Permlink Replies: 1 - Pages: 1 - Last Post: Aug 18, 2006 8:08 AM Last Post By: Aleksei Valikov

Posts: 27
Registered: 8/14/06
indexing multilevel object graph
Posted: Aug 18, 2006 7:23 AM
  Click to reply to this thread Reply
I've moved this post out of the isNull query question, does not really belong there...

I have a question on indexing 2+ level hierarchy. Seems I can index, but not The query I use for that is:
session.queryBuilder().term("", lobName).setAliases(new String[] {"Server"})

Doing so raises:
java.lang.IllegalArgumentException: Failed to find mapping for alias [Server] and path []
at org.compass.core.mapping.CompassMapping.getResourcePropertyMappingByPath(Compas
at org.compass.core.mapping.CompassMapping$ResourcePropertyLookup.<init>(Com
at org.compass.core.mapping.CompassMapping.getResourcePropertyLookup(CompassMappin
at org.compass.core.impl.DefaultCompassQueryBuilder.term(DefaultCompassQueryBuilde
at com.compassplayground.dao.CompassDaoImpl$2.doInCompass(
at org.compass.core.CompassTemplate.execute(
at org.compass.core.CompassTemplate.execute(
Aleksei Valikov

Posts: 46
Registered: 3/6/06
Re: indexing multilevel object graph
Posted: Aug 18, 2006 8:08 AM   in response to: darnok in response to: darnok
  Click to reply to this thread Reply
First of all, try $/parent/child/grandchild/name or $/parent/child/
However, this depends on the mapping, the expression above is for the case where child and grandchild are mapped as components.

General advice: set a brackpoint in DefaultCompassSession.create or save and make two steps in the debugger. You'll have the resource object which will be saved in the index. In this resource, you can easily see the indexed properties - together with their names and values.

I usually do this trick what I can't find something that theoretically must be found.
Guru: 2001 + pts
Expert: 501 - 2000 pts
Super-star: 101 - 500 pts
Assistant: 51 - 100 pts
Participant: 0 - 50 pts
Helpful Answer (5 pts)
Correct Answer (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums