+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / search separate sitefinity installations on subdomain

search separate sitefinity installations on subdomain

6 posts, 0 answered
  1. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    18 Dec 2009
    Link to this post
    Is there any way to search other sitefinity sites using the search engine? We have a main site on our primary domain, but we want to at at least a few sitefinity installations on our subdomains for some of the bigger departments. however, we would like to be able to search them all from our main site.

    is this possible? or are the indexes completely limited to the sitefinity installation under which they are created?
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    19 Dec 2009
    Link to this post
    Hello SelArom,

    3.x do not support this feature. What we could suggest.

    1. Use domain mapping - very useful solution that event does not require second installation for the subdomain. More information at Domain-Page mapping

    2. Create a new index in the subdomain - say "Pages". One the website is indexed get the folder that is generated under Sitefinity/App_Data folder called Pages. Afterwords copy this folder to the same location of domain project.
    Note that you should have a search index called "Pages" ( with the same name) in the domain website. So you just get the segment files from the subdomain and paste them to the domain search folder.
    Then create a custom SearchResults control, override CreateChildControls method create two generic lists of type ResultItem, merge the both list in a new one  say NewDataSource and bind the SearchResults repeater to this list (this.layoutCnt.ResultsList).

    3. The Telerik.Lucene.Net to make your custom logic - provider and indexer to merge the subdomain/domain segments.


    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Richard Baugh
    Richard Baugh avatar
    201 posts
    Registered:
    22 Aug 2012
    11 May 2010
    Link to this post
    I've got a question relating to Domain Mapping and search indexes.

    We have setup a 3.7 SP3 site and setup domain mapping. We have 4 domains that are mapped to the site. Each domain is mapped to it's on group page in Sitefinity. So in the admin section under pages, you just see 4 page groups.

    We have also setup an index for each site. In order to select the group page, for each index, we had to add an alternate domain/host header to the IIS site so that we could access the site without mapping. This also works when accessing the site via localhost. Example:
    Grouppage1.aspx
    GroupPage2.aspx
    GroupPage3.aspx
    GroupPage4.aspx

    Index 1: Starting node = ~/grouppage1.aspx
    Index 2: Starting node = ~/grouppage2.aspx

    The problem we are having is in the index itself. When running a search result, we are getting results from all four group pages rather than just from the group page specified in the index. So when running a search on the "Index 1" index, we are getting results from all pages in the whole site. If I run an index on my PC using localhost, then the index is created from the page group only. If I log into the site using one of the mapped domains, each index is being built from all pages in the SF DB.

    I know this might seem a little confusing. It sure is trying to document it and make sense. Is there a workaround for this behavior? I know we can access the site with a non-mapped domain and run the index, but I am afraid that someone will log into SF through a mapped domain and the index will get overwritten.
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    12 May 2010
    Link to this post
    Hello Richard Baugh,

    If there is a starting node specified the index cannot loop through the whole website. In GetContentToIndex()  method of Telerik.Cms.Search.PageIndexProvider we get the starting node Id and recursively loop only through the child. Therefore it looks not possible for Lucene to add all pages to its segemens file which is used by SearchResults control. You should ensure that all indexes have  Starting Node set and all SearchBox controls use the correct index.

    When there is not starting node we call manager.GetRootPage(); which gets the whole SiteMap. The index does not work with the host it checks only Sitemap and its nodes.

    Greetings,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  5. Richard Baugh
    Richard Baugh avatar
    201 posts
    Registered:
    22 Aug 2012
    12 May 2010
    Link to this post
    There is no root page on the site since all four domains are mapped to a Group page. As for selecting the starting node, we had issues with this also. Like I mentioned before, in order to access the specific group page in the dialog, for selecting the starting node, we had to access the site via localhost or some other non-mapped domain. Otherwise, the page listing in the dialog is built off of the current domains mapped page, which in selecting "All Pages", returns an empty string. This empty string causes the site to index all pages.

    Here is an example of what is setup and then a test I ran that simulates the problem.
    web.config =>
    <urlMappings>
    <add key="domain1.com"
    value="domain1"
    shared="false" />
    <add key="domain2.com"
    value="domain2"
    shared="false" />
    <add key="domain3.com"
    value="domain3"
    shared="false" />
    </urlMappings>

    Sitefinity Admin => Pages
    All Pages -> //root of the site
    domain1 (domain1.aspx)  //Setup as a group page
    -> sub page
    domain2 (domain2.aspx)  //Setup as a group page
    -> sub page
    domain3 (domain3.aspx)  //Setup as a group page
    -> sub page

    Sitefinity admin => Administration/Services/Search
    1. Create an index and named it "Test"
    2. Add a PageIndex -> Set auto index to true, Index Non-public pages to false, starting node url to ~/domain1.aspx
    4. Save and run "Start Indexing now". Results show as index x number of words and 3 pages

    This is a mock setup of what we had when I submitted this post. After your reply, I looked through the code to try and understand the domain mapping a bit and came to the conclusion that if the starting node url is the same as a mapped page, then the value returned to the indexing provider is the root or the "All Pages" for the whole Sitefinity site. So I thought of a way to test this. I changed the value of the mapping entry for domain1.com from domain1 to domain11. I then went back to the index "Test" and ran the "Start Indexing Now". This time the results came back with indexed x words and 1 page.

    Since the site is setup with just the three pages, which are all page groups, in the root of the site and these pages are mapped to the domain mapping in the web.config, we are getting indexes with all pages. If the starting node url for the index is not mapped via domain mapping, then the index will function in the manner you described. It is only when the page is mapped via domain mapping that the index is returning all pages in the site.

    Richard
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    17 May 2010
    Link to this post
    Hi Richard Baugh,

    You could use the permissions tab to restrict the access to the search service, so that only certain users will be able to run the index. The second option is running the index from a not mapped domain.

    We will try to fix the issue for the next SP of Sitefinity 3.7

    All the best,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Register for webinar
6 posts, 0 answered