lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lukáš Vlček <lukas.vl...@gmail.com>
Subject Re: Querying across object relationships
Date Thu, 30 Jul 2009 19:40:51 GMT
Don,
To me it seems as if there is only one document in your index, and moreover
the only document has mutifield courseName and mandatory fields (this means
you will get the same result even if you query +courseName:art +mandatory:N).
Do you think you can share how you create your domain objects and how you
push them into index?

Did you check you transaction logic? Are you sure you indexed all the domain
objects you wanted?

Lukas

http://blog.lukas-vlcek.com/


On Thu, Jul 30, 2009 at 9:10 PM, Donal Murtagh <domurtag@yahoo.co.uk> wrote:

> Basically the classes I'm indexing have the following relationships:
>
> Student 1------* Attendance 1------* Course
>
> The
> only root class is Student, i.e. only instances of this class can be
> returned from a search. I have a Student object graph that could be
> represented in JSON as follows:
>
> {
>  name: Bob,
>  attendances: [
>    {mandatory: N, course: {name: cooking}},
>    {mandatory: Y, course: {name: art}}]
> }
>
> When I search for an instance of Student using the query:
>
>  "+courseName:cooking +mandatory:Y"
>
> Bob
> is returned because, because he attends a course named "cooking" and he
> attends a mandatory course (named "art).. But what I really want to
> search for is students that attend a mandatory cooking course. It
> doesn't appear to be possible to do this based on the responses
> provided here:
>
> http://stackoverflow.com/questions/1202422/lucene-query-syntax/1203186#1203186
>
> I
> opened the Student index in Luke, exported it to XML and have appended
> the results here:
> http://pastebin.com/m6e5bbcf3
>
> I don't really know how to interpret this
> myself, but thanks in advance for any further help you can provide.
>
> - Don
>
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message