MSM and collection issue
I have a MSM site that shares template code and uses low variables to create site specific variables. This MSM site actually stores the all the channels in site1 (each site has a separate channel and a shared channel). But for some reason low search seems to not be working as expected with these variables.
Site A has search/results template:
{exp:low_search:results site="site_1" query="{segment_3}" collection="{var_collections}" loose_ends="yes" search_mode="all" status="not closed" orderby="date" limit="24" disable="categories|member_data"}
<p>{var_collections} - {title} - {low_search_collection_name}<p>
{/exp:low_search:results}
{var_collections} on Site A is a low variable with early parsing:
posts_site1|posts_site1site2
site B has this in it's search/results template:
{embed="site_1:search/results"}
{var_collections} on Site B is a low variable with early parsing:
posts_site2|posts_site1site2
Now when i do a search on Site A it works like expected. It pulls out results from collection posts_site1 and posts_site1site2 but not posts_site2, so makes an output like
posts_site1|posts_site1site2 - EXAMPLE TITLE 1 - posts_site1
posts_site1|posts_site1site2 - EXAMPLE TITLE 2 - posts_site1site2
posts_site1|posts_site1site2 - EXAMPLE TITLE 3 - posts_site1
but on Site B it's pulling in results from posts_site1...
posts_site2|posts_site1site2 - EXAMPLE TITLE 1 - posts_site1 <-- why?
posts_site2|posts_site1site2 - EXAMPLE TITLE 2 - posts_site1site2
posts_site2|posts_site1site2 - EXAMPLE TITLE 4 - posts_site2
In this example the site is showing entries from collection called posts_sites1 even though the low variable doesn't state that?
Any ideas what is going wrong?
Thanks
Replies
Low 10 Oct 2011 07:44
Hi!
Quick question before I dive in: which version of Low Search are you using?
Joobs 10 Oct 2011 13:24
EE v2.2.1
Low Search 1.3.6
I've now tested it by removing all the embeds and variables and hardcoding everything, but it's still not working for me.
The following is in a template on site_2
{exp:low_search:results site="site_1" collection="posts_site2" keywords="something"}
<p>{title} - {low_search_collection_name}<p>
{/exp:low_search:results}
And it's giving results as if it's searching all the collections
Low 10 Oct 2011 18:24
1.3.6 will be the version of Low Variables. What's the Low Search version? Shouldn't be higher than 1.0.6.
Joobs 10 Oct 2011 18:36
oops must of copied the wrong row on the module page.
Low Search: 1.0.6
Low 11 Oct 2011 08:03
Can you turn on the Output Profiler and Template Debugging? Then do a search on both site_1 and site_2. In the output profiler, you'll see a list of queries. What are the queries performed on the exp_low_search... tables for both searches? Also, in the template debugging info, you'll find several lines starting with "Low Search:"... What do those say for both searches?
Joobs 11 Oct 2011 20:25
site 1
SELECT 'collection_id'
FROM ('exp_low_search_collections')
WHERE 'collection_name' IN ('posts_site2')
AND 'site_id' = '1'
SELECT entry_id, collection_id, MATCH(index_text) AGAINST('frank') AS score
FROM ('exp_low_search_indexes')
WHERE 'collection_id' IN ('4')
AND 'site_id' IN (1)
AND MATCH(index_text) AGAINST('frank' IN BOOLEAN MODE)
ORDER BY 'score' DESC
SELECT 'collection_id', 'collection_name', 'collection_label', 'settings'
FROM ('exp_low_search_collections')
WHERE 'collection_id' IN ('4')
(0.124606 / 2.55MB) Low Search: setting hard-coded keywords parameter
(0.124625 / 2.55MB) Low Search: setting hard-coded collection parameter
(0.124639 / 2.55MB) Low Search: setting hard-coded site parameter
(0.156333 / 2.76MB) Low Search: starting search (fulltext)
(0.165162 / 2.77MB) Low Search: caching search results
(0.173337 / 2.77MB) Low Search: Setting fixed_order parameter
(0.173428 / 2.77MB) Low Search: Calling the channel module
Site 2
SELECT 'collection_id'
FROM ('exp_low_search_collections')
WHERE 'collection_name' IN ('posts_site2')
AND 'site_id' = '2'
SELECT entry_id, collection_id, MATCH(index_text) AGAINST('frank') AS score
FROM ('exp_low_search_indexes')
WHERE 'site_id' IN (1)
AND MATCH(index_text) AGAINST('frank' IN BOOLEAN MODE)
ORDER BY 'score' DESC
SELECT 'collection_id', 'collection_name', 'collection_label', 'settings'
FROM ('exp_low_search_collections')
WHERE 'collection_id' IN ('4', '3', '1')
(0.095285 / 2.55MB) Low Search: setting hard-coded keywords parameter
(0.095305 / 2.55MB) Low Search: setting hard-coded collection parameter
(0.095320 / 2.55MB) Low Search: setting hard-coded site parameter
(0.124788 / 2.76MB) Low Search: starting search (fulltext)
(0.126417 / 2.81MB) Low Search: caching search results
(0.128158 / 2.82MB) Low Search: Setting fixed_order parameter
(0.128254 / 2.82MB) Low Search: Calling the channel module
Low 11 Oct 2011 20:55
Thanks for that.
As you probably know, channel entries can belong to multiple search collections. The entries that are showing up for 'posts_sites1' in Site 2, are they *only* present in the 'posts_sites1' collection, or are they also present in the 'posts_sites1site2' collection?
Joobs 11 Oct 2011 22:25
Each channel only belongs to one collection.
I don't know if this has any effect on anything but site_2 doesn't actually have any channels at all. All the channel data is stored in site_1.
The channel names have the same names as the collections.
Low 13 Oct 2011 14:24
Is the site online somewhere so I can take a look myself? You can send superadmin login credentials to hi at gotolow dot com.
Also, I'm off to New York for the ExpressionEngine conference tomorrow (eeciconf.com), so my time to investigate will be somewhat limited the coming 10 days. I'll still try and take a look when I get the chance.
Joobs 15 Oct 2011 21:52
enjoy the conference, I'll send you an email once you get back.