bjunior

Mt5, search in all blogs of a website

Vote 0 Votes

I'm running mt5.12, with a single website configured and about 100 blogs. I plan to grow my blog community to 500 blogs.

In the website level I want to provide search capability of all blogs in that particular website. So in the mt-search script, I'm providing as argument to blog_id something like this:

,

The problem is the long list of Ids being passed... I guess that with 500 blogs, the URL will too much long.

Anyone has some advise/ experience running large mt installations?

Thanks

Reported on Movable Type 5

14 Replies

| Add a Reply
  • Apologies... The code is:

      <input type="hidden" name="IncludeBlogs" value="<mt:WebsiteHasBlog><mt:Blogs include_blogs="children"><mt:BlogID>,</mt:Blogs></mt:WebsiteHasBlog>" />
    
  • If most of the blogs can be included, how about to specify excluded blogs by ExcludeBlogs config directive ? and remove <input name="IncludeBlogs" > from your search form.

    http://www.movabletype.org/documentation/appendices/config-directives/excludeblogs.html

    On the other hand, I think that this is a very good feature request. So I created a feature request case.

    https://movabletype.fogbugz.com/default.asp?107335

  • Hello Jun,

    Thank you for your reply. Unfortunally, when I try to use the Excludeblogs but I get an error from mt: Invalid blog_id parameter.

    The sintax I'm using is:

    in the search box:


    <form method="get" action="http://cms5.obviousmag.org/mt-search.cgi" name="tools" class="search">
    <input type="hidden" name="ExcludeBlogs" value="1" />
    <input type="hidden" name="limit" value="40" />
    <input class="search_box" id="search" name="search" value="pesquisar" onfocus="if(this.value=='pesquisar')this.value=''" onblur="if(this.value=='')this.value='pesquisar'"/>
    <input class="search_button" class="submit" type="submit" value="" />
    </form>

    and in the index page:

       <$mt:CGIPath$><$mt:SearchScript$>?excludeBlogs=1 
       &template_id= 3557
       &limit=<$mt:Var name="per_page"$> 
       &archive_type=Index 
    


    The blog ID 1 is the blog that belongs to the mainwebsite that I don't use... and don't mind of exclude from the search & index pagination

    Any tip?

  • I believe you need to provide a blog_id number because MT need to know which blogs to use to render the search results page. Try to provide one ID along with the list of excluded blogs (make sure that ID isn't on both ;-).

  • Hello François... in both cases I pass the blog_id... in the second example is excludeBlogs=1.

    In this case the blog_id is "1".

    Am I missing something?

  • Err, you pass both blog_id=1 and excludeBlogs=1? That cannot work.

    But I'm not sure passing something like blog_id=1 and excludeBlogs=2 will search through everything but blog #2 either. Have you tested that?

  • No... I *only* pass excludeBlogs=1 on both cases. Of course that the number "1" is the blogid I want to exclude from the search.

    What's your suggestion in concrete?

  • Well, my suggestions are already above. Add a blog_id pointing to a blog that's not in the excluded ones (MT will render the search results using that blog templates).

  • Hello François... didn't work :(

    No Articles have been returned... of course the error has vanished :/

    Any ideas?

  • I tried that on MT5.12 and I couldn't make it work either. Jun, there seems to be a bug here, where results returned all come from the site/blog referenced by the blog_id parameter and only that one, while the ExcludeBlogs parameter is ignored (it seems to have no effect whatsoever). Do you have a working example somewhere?

  • I believe that you need to specify ExcludeBlogs in mt-config.cgi as a configuration directive.
    For example, you will see the search results from all blogs in your MT installation with the following search form.

    <form method="get" action="<$mt:CGIPath$><$MTSearchScript$>">
              <input type="text" id="search" name="search" value="<$mt:SearchString$>" />
              <input type="submit" value="GO" />
    </form>
    

    But you can filter blogs which have blog_id 1 and 2 by specifying the following config directive in mt-config.cgi

    ExcludeBlogs 1,2
    

    Have you tried this directive in mt-config.cgi ?

    http://www.movabletype.org/documentation/appendices/config-directives/excludeblogs.html

  • Ah no, my bad, for some reason I thought that was a URL parameter you could use within a template. I should have seen that it was a config directive right from the URL, sorry :o).

    @bjunior: this means it's a setting that is forced upon all hosted blogs on that MT installation, i.e. those excluded blogs will never be searched regardless how you configure the search on any of those blogs. You'll also have to maintain that list manually in your mt-config.cgi file.

  • Decrease the amount of blogs you want to add to 350 blogs and see that the problem will be solved

  • Not just the amount of dimunuir blog, you must use Sintexe aggregating all blogs without drastically increasing server utilization...

Add a Reply

If you need to share template code, replace all the "<" signs with "&lt;" or use this utility.

Forum Groups

1774 6167

Last Topic: Template modules by Zielun on Feb 16, 2012

86 302

Last Topic: website entries by masoud on Oct 26, 2011

1434 5088

Last Topic: Maintenance announcement by Nick on Feb 17, 2012

695 2912

Last Topic: Insert Image / File Fails by Russ Miller on Feb 10, 2012

84 291

Last Topic: How to have some other characters in entry basename automatically written by Afshin Haghighatnia on Dec 22, 2011

174 740

Last Topic: Captcha images rendering slowly by ScottM on Feb 12, 2012

190 568

Last Topic: Analytics Reporting by michael webster on Feb 5, 2012

48 210

Last Topic: An idea and also a request by Afshin Haghighatnia on Jun 29, 2011

64 246

Last Topic: jQuery in MT 5.1 still at 1.4 - why? by perlmonkey on May 25, 2011

code.sixapart.com

137 478

Last Topic: Getting a thumbnail with xpath by Peter on Mar 13, 2011

222 720

Last Topic: Custom Field for Asset Not Appearing by android on Feb 9, 2012