teradome
Oct 10 2002, 02:10 PM
When you use the new search as is, the search results will return all the blogs you have on your site and return the results. While the documentation talked about changing the style of the results, it said nothing about selectively choosing which blogs were to be searched with which template... or did I miss something? I've been looking over it, but I see no MT tags to accomplish this.
What I want: 1 install, feeding 2 blogs into their own seperate sites (one via https and one via http)... and each blog's search ONLY searching that site, and not the other.
I could pump in an "exclude blog" hidden input, but anyone who looks at source can get around that.
girlie
Oct 10 2002, 04:29 PM
What you can do is use an Include instead:
CODE
<input type="hidden" name="IncludeBlogs" value="<$MTBlogID$>" />
And that is most definitely noted in the
Public Search section of the manual:
QUOTE
The above form also includes the ability to exclude certain blogs from the search. This is useful if a visitor wishes to search only in one of your blogs. As an alternative to the Exclude Blogs, you could instead use the following:
<b>Include Blogs:</b>
<MTBlogs>
<input type="checkbox" name="IncludeBlogs" value="<$MTBlogID$>" /> <$MTBlogName$>
</MTBlogs><br />
This is essentially the inverse of the Exclude Blogs setting, but may be preferable to you for whatever reason. For example, it makes it easier to create blog-specific search results pages--instead of maintaining the lists of blogs to exclude, you need only add this to the form:
<input type="hidden" name="IncludeBlogs" value="<$MTBlogID$>" />
<$MTBlogID$> always references the current blog, so this search will always be restricted to just the blog being viewed.
almuhajabah
Oct 10 2002, 04:33 PM
If you don't want the blogs to ever show up in any search, then you can exclude them in the search configuration file (which should now be part of mt.cfg).
Add a line like:
ExcludeBlogs 2,3,4
Where the numbers are the blog ID numbers that MT assigns.
If you want to have these blogs indexed but not accessible from this particular search, then you'll have to use the hidden input field method.
On edit: girlie gave a better answer. I'm basically using the same set-up I did before 2.5 in which you use the ExcludeBlogs in the config to permanently exclude blogs from being indexed and hidden fields to exclude blogs from a given search template
girlie
Oct 10 2002, 05:09 PM
I actually combine both methods. =)
One thing I discovered during testing (which users who weren't using MT Search before its integration into MT might want to know):
Initially, I used an IncludeBlogs statement in mt.cfg, because I figured I may add a test blog at any time, and I'd rather not have to go back and edit the ExcludeBlogs statement in mt.cfg to add that blog ID.
However, if you use an IncludeBlogs in mt.cfg, and then create a search form intended to return results from only one blog, any input type="hidden" in the form used to include that one blog will be overridden by the statement in mt.cfg, and the search will still return results from all the blogs you've specified in mt.cfg.
So I switched to the ExcludeBlogs instead, and set up MT to where I can edit my mt.cfg file from within the interface instead of having to reupload a changed copy.
Works much better that way! =)
Benoit
Nov 5 2002, 09:45 PM
Oddly enough, after updating to 2.51, the ExcludeBlog in my mt-search.cfg doesn't appear to do anything. All blogs show up in the search result. Any idea why?
I did use the hidden input method, which does the job just fine. Thanks for mentioning the Blog ID always referred to the current blog, that's what led me to try that alternative.
teradome
Nov 13 2002, 09:46 AM
Thanks for the suggestions, but none of these would work (except for the mt.cfg suggestion which isn't selective enough) for me.
There's going to be two blogs out of this install which would be in https space -- one https: site and one http: site -- and there cannot be any way in the clear to see posts in the one behind https.
Someone modifying the search form in the clear to include other blogs (by very predictable ids, of course) could get titles and excerpts and anything else in the search result template for the private feed. On the flip side, if I used the mt-search.cfg suggestion then that would make the private blog permanently unsearchable even from the https: site.
Making a seperate install for each would be insane as they would not share user/permissions data and would have to be seperately maintained and updated without some major shell level trickery.
Clearly, this is a setting that needs to go into the system in a blog-per-blog fashion somehow.
girlie
Nov 13 2002, 04:58 PM
I am having trouble understanding what you mean when saying it won't work to use the include statement to have two separate search forms.
Who's going to modify your search templates other than you?
And what do you mean by "in the clear"?? You used that term twice and I don't quite get it's meaning. Maybe my aching head is slowing down my cognitive skills.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.