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

Forums / Developing with Sitefinity / How does Sitefinity search works?

How does Sitefinity search works?

13 posts, 0 answered
  1. Stanimira
    Stanimira avatar
    12 posts
    Registered:
    30 Jan 2009
    05 Feb 2009
    Link to this post
    When I search content in the sitefinity website, I meet the following difficulties:

    1. When I search 2 or more words I have to concatenate them with AND, or put them in "". Otherwise I get too many results where these words are met separately in the text. (In other search engines, like google, the best results come first, but this is not the case with the search in Sitefinity.)

    2. When I search, for example, for .pdf file, I do not get the link to it, but a link to the page.


    What can be done to help the users find easily exactly what they search for?
  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    09 Feb 2009
    Link to this post
    Hi Stanimira,

    Here are the answers to your questions:

    1. When I search 2 or more words I have to concatenate them with AND, or put them in "". Otherwise I get too many results where these words are met separately in the text. (In other search engines, like google, the best results come first, but this is not the case with the search in Sitefinity.)


    By default, all the special characters are stripped. That is why you cannot use quotes. Please check the attached screenshot, showing you how to disable this. When you disable the stripping, please take a look at the web.config file:
    <searchInputValidation> 
        <add matchPattern="\A[\*\?\~][^\s]*" replacementString="" enabled="true" matchAlert="You can not start your query using wildcards, modify your query and try again.."/> 
        <add matchPattern="[\!\^\(\)\{\}\[\]]" replacementString="" enabled="true" matchAlert="Strange characters should be enclosed between double quotation, modify your query and try again.."/> 
        <add matchPattern="a" replacementString="" enabled="true" matchAlert="a is not allowed"/> 
    </searchInputValidation> 

    These are the regular expressions controlling the input characters. You can change them as you wish. This will allow you to use *,quotes or question mark for wildcard searches. As for the best results, you can tweak the fieldsInfoProvider.xml file, which you may find in the App_Data\Search\[YourIndexName]\ directory. This file describes how the different tags are indexed, and what weight do they have. The higher weight has the container, the better rank will have tha page which contains it. There is a forum thread here in our forums about this.

    2. When I search, for example, for .pdf file, I do not get the link to it, but a link to the page.
    This is because we do not have a pdf/document index, but a page index. Therefore, the links are to the indexed pages, rather than the indexed links. There are two thinks you could do:
    • Create a pdf search indexing provider. We have an example posted in the thread Indexing Troubles. There is another example, provided by Josh Morales - Events Indexing. The same approach could be used for creating custom indexing providers.
    • Create custom search by using the code:
      int count;  
      IList<Telerik.Search.Engine.ResultItem> results = Telerik.Search.Engine.SearchManager.Search(q, "SearchTerm", 0, 10, "AnyWord"out count);  
      if (count == 0)  
           rptResults.Visible = false;  
      else  
      {  
           rptResults.DataSource = results;  
           rptResults.DataBind();  
      }  
    Where the SearchTerm is what you have searched for, and the rptResults - the repeater which is showing the results. The result list will be filled with your Search Results items. Each item has the Snippet property, in which the url to the PDF document should be provided. You can extract the link, and strip the rest of the Snippet. Then if you hide the Title from the ItemTemplate of the Repeater, you will only have the Snippet (from which we stripped the text).

    We are going to implement a document indexing provider, which will work for some of the MS Office documents, as well for PDF files. This will most probably happen for 4.0 version or shortly after that release comes out.

    Greetings,
    Georgi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Stanimira
    Stanimira avatar
    12 posts
    Registered:
    30 Jan 2009
    23 Mar 2009
    Link to this post
    One more question about the search: Can I search information that is in the file (.doc, etc.)?
  4. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    23 Mar 2009
    Link to this post
    Hi Stanimira,

    This option will be available out of the box in Sitefinity 4.0.
    Since the indexer is only working with plain text, you could create search providers (which you register in the web.config file) for all the file formats you need. Here is a sample Search Provider, you could see the idea from it.

    Best wishes,
    Georgi
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
  5. david
    david avatar
    5 posts
    Registered:
    25 Feb 2010
    14 Dec 2010
    Link to this post
    I have created ProductIndexProvider and it works well indexing my products, but what i need it's to display product picture in search result, is there any way to do this?

    Thanks
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    14 Dec 2010
    Link to this post
    Hi david,

    You have to add the item ID in  fieldsInfoProvider.xml that is generated in the folder of each search index. You could take a look at this post. Then you have to extract the ID from the snippet as shown in the post and get the metadata by using GetMetaData method of the content item. The picture path (ID) should be represented by a metakey.

    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
  7. david
    david avatar
    5 posts
    Registered:
    25 Feb 2010
    14 Dec 2010
    Link to this post
    Thanks for reply, have solved this problem in another way, indexed url includes product id so i can get picture with it
  8. Kevin
    Kevin avatar
    20 posts
    Registered:
    14 Jun 2010
    12 Jan 2011
    Link to this post
    Is this still planned to be available out of the box in Sitefinity 4.0?   Is it available in the release candidate?

    Thanks.
  9. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    13 Jan 2011
    Link to this post
    Hi Kevin,

    Searching inside documents will be implemented in one of the SP of Sitefinity 4.0. This feature will not be included in the official release.

    Best wishes,
    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
  10. Rohan
    Rohan avatar
    4 posts
    Registered:
    22 Nov 2010
    24 Mar 2011
    Link to this post
    Hi team....
    i am facing problem with Google search...
    we are using SF 3.7
    i want to avoid some folder to be search by Google...
    eg.
    my site is wwww.sitename.com/Main-folder/sub-folder/

    in side sub-folder there are many pages that will be created using SF. right now sub-folder hold my news articles which will be added and updated daily..
    i want to avoid google not to search under this folder....
    i have done some entry in robots.txt using  "Disallow: /Main-folder/sub-folder/" but its seems to be not working...
    Please help in this.
    Thanks
  11. david
    david avatar
    5 posts
    Registered:
    25 Feb 2010
    24 Mar 2011
    Link to this post
    Hi Rohan
    I have had the same problem. "Disallow" directive does not work for google search engine, conversely you said to google that there is such url to index. I have solved this problem with custom routing module that check referrer domain.
  12. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    24 Mar 2011
    Link to this post
    Hi ,

    I do not see how Sitefinity could affect this. This will behave in the same way for each other ASP.NET application. I suggest that you should google about how to hide folder from the crawler request.

    Greetings,
    Ivan Dimitrov
    the Telerik team
  13. Tim Hoffman
    Tim Hoffman avatar
    1 posts
    Registered:
    30 Apr 2010
    11 Oct 2011
    Link to this post
    Using disallow with your robots.txt file should correctly exclude those files from the google search.  Are you correctly setting the user agent and the other necessary data?  You can go to google and use their webmaster tools to generate a valid robots.txt the way you need it.  Then it should conform to there standards and work for sure. 

    Hope that helps.
    Tim
Register for webinar
13 posts, 0 answered