215 Posts
iliil
9 years ago
2
Topic

Hello everybody.

I need to search across multiple content types. I know this functionality works well. But it doesn't work when searching across multiple content types with a different skeleton (for example users and articles).

I need to combine search results of one type of user profiles and one type of articles.

PS: So far I temporarily managed to solve this with 2 search type modules. The results I populate into 2 JavaScript arrays which I concat and output the final result on page. I would appreciate to manage it with just one search type as this is not really elegant solution

Thanks so much for help

Michal

Get a Book for SEBLOD
9 years ago
1
Level 1

Hello michalmarianek,

can you explain why you need to search in the two differents objects (Article, Users) ?


If you just need to find some informations on the author of each article, you can can do that by differents ways.

One way is to use the search join plugin to make a bridge between article and user (created_by / id)

An other way is to use the search query plugin to write your own query.


Regards.

Lionel

 

215 Posts
iliil
9 years ago
0
Level 2

Hi Lionel

Thank you for your quick reply. I know it's a bit unusual, but I need to search accros two types,  1. Institutions  (articles based on Seblod user content type managed by website users) and  other places (articles based on Seblod article type managed by the administrator of the site). They both share some searching criteria.

So basicly I just need to list articles from two different content types. But even if my search form contains only the CCK field (with selected multiple types as live value), searching is unsuccessful when those selected  types are of different skeleton (profile, article).  It only works if the two (or more) content types have the same skeleton (e.g user ).
Is it a bug?

here is the query ( profil is the user based type and msta is the user based type )

SELECT t0.id AS pid,t0.pk AS pk,t0.pkb AS pkb,t0.parent_id as parent,t0.cck AS cck,t0.storage_location AS loc,tt.id AS type_id,tt.alias AS type_alias
FROM `#__cck_core` AS t0
LEFT JOIN `#__content` AS t1 ON t1.id = t0.pk
LEFT JOIN `#__cck_core_types` AS tt ON tt.name = t0.cck
WHERE t1.state = 1 AND t1.access IN (1,1,5) AND ( t1.publish_up = '0000-00-00 00:00:00' OR t1.publish_up <= '2015-07-01 13:13:15' ) AND ( t1.publish_down = '0000-00-00 00:00:00' OR t1.publish_down >= '2015-07-01 13:13:15' ) AND t0.cck IN ('profil','msta')
ORDER BY t1.title ASC



Thanks for help

Michal

-----------

Lionel, I have one more quick question. Is there a proved procedure how to get search results asynchronously? I need to display partial results on a google map without reloading the page. I was thinking about using joomla view=raw for ajax call, but i'm not sure if this is good way to go.

Get a VIP membership