Association and Search

cancel
Showing results for 
Search instead for 
Did you mean: 
koulritesh98
Active Member

Association and Search

Jump to solution

I have two types assuming Type A and Type B and both of them are associated with each other. Now in the node browser when I search for some property in Type A and another in Type B together, it does not produce any result but when I use the OR keyword, it shows the content of both types. Is there any way to achieve this? 

1 Solution

Accepted Solutions
jpotts
Professional

Re: Association and Search

Jump to solution

Associations are not relevant to search at all because they are not indexed. What you are seeing is the correct behavior because you are trying to AND properties on two different types and there will be no node that matches that query. The OR works because the search engine is returning hits that match the first clause or the second.

You did not include your type definitions or your query, so I am forced to assume, but, if, for example, you want to find results that match a query and you want to find the documents associated to those hits that also match a query, you will have to find the first set, then iterate over the set inspecting all associated nodes to see if the associated nodes match the query.

This is of course very inefficient and is why ECM repositories like Alfresco (and many others) start to break down when you need to do relational queries. It simply isn't a relational system.

Importing your data into another repository that allows more query flexibility (like a relational database or a JSON document store) is often a good approach when you have a need to do queries on node relationships.

View solution in original post

2 Replies
jpotts
Professional

Re: Association and Search

Jump to solution

Associations are not relevant to search at all because they are not indexed. What you are seeing is the correct behavior because you are trying to AND properties on two different types and there will be no node that matches that query. The OR works because the search engine is returning hits that match the first clause or the second.

You did not include your type definitions or your query, so I am forced to assume, but, if, for example, you want to find results that match a query and you want to find the documents associated to those hits that also match a query, you will have to find the first set, then iterate over the set inspecting all associated nodes to see if the associated nodes match the query.

This is of course very inefficient and is why ECM repositories like Alfresco (and many others) start to break down when you need to do relational queries. It simply isn't a relational system.

Importing your data into another repository that allows more query flexibility (like a relational database or a JSON document store) is often a good approach when you have a need to do queries on node relationships.

koulritesh98
Active Member

Re: Association and Search

Jump to solution

Thank you Jeff. Here is my table. Student details is one type and Sports activity is another. Each row of Student detail is and Sports activity represent a content so multiple content in sports activity is associated with student details. For example the rows cricket-wicketkeeper-3-state, football-goalkeeper-5-national, hockey-defender-2-district are associated with the row Niraj. I get that associations are not indexed, and if I search for Name:"Niraj" AND Sport:"Cricket", I would not get any result. Storing in a relational system is not possible. So can you provide a solution for this?hub-alfresco-sc (1).PNG