More in this section

Forums / Developing with Sitefinity / Inconsistent search results

Inconsistent search results

9 posts, 0 answered
  1. Chris Jensen
    Chris Jensen avatar
    6 posts
    Registered:
    15 Jul 2009
    22 Mar 2010
    Link to this post
    I am working on a custom searchresult page.  I need to have the Article ID to access the record do provide more information.  I've added

    <field name="guid" weight="1" indexAttribute="" filterTag="guid" filterAttributes="" />

    to the fieldsInfoProvider.xml file and re-ran the index.  Most search results come with the GUID as the first 36 bytes of the Snippet field, as expected.  A small number of the search results do not have the GUID in the snippet.  I thought it may be something to do with the records themselves, but if I search for other terms it will give me the GUID for the problem records and different records will be a problem. 

    What could cause guids for some records (but not all) to be missing?  I am working with version 3.6 of Sitefinity.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    22 Mar 2010
    Link to this post
    Hello Chris Jensen,

    I am not able to reproduce suck problems with adding the Guid to the snippet. You could try to restart the application and then run the index again.

    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.
  3. Chris Jensen
    Chris Jensen avatar
    6 posts
    Registered:
    15 Jul 2009
    22 Mar 2010
    Link to this post
    I restarted the app, recycled the app pool and re-ran the index with no luck.

    One thing that I am noticing that may be relevant: If I am searching for the term 'cheddar', for example, the good results always have as the snippet:
    74181008-1085-435a-acd4-0284da647598
    <strong>...</strong>
    First line of the article that includes <strong>cheddar</strong> in the

    The bad results always have:
    a snippet from the body of the article where <strong>cheddar</strong> is found

    In summary, if the result contains the beginning of the article, I will get the ID.  If the result does not contain the beginning of the article, I don't get the ID.  I've verified that this is always the case.

    More information on my setup: 
    A custom news provider is being used to store the articles.  The application name is /WhatsNew.
    Accessing the /WhatsNew provider through sitefinity works properly. 


  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    23 Mar 2010
    Link to this post
    Hello Chris Jensen,

    The fieldsInfoProvider.xml determine what will be added to the snippet. You can observer the ResultItem.Snippet to see the whole string.

    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.
  5. Chris Jensen
    Chris Jensen avatar
    6 posts
    Registered:
    15 Jul 2009
    23 Mar 2010
    Link to this post
    Thanks for your reply.  I have that file configured.  As my previous post pointed out, if the snippet contains the first sentence of the article, it will also contain the GUID.  If the snippet does not contain the first sentence, it will not contain the GUID.  Below is an actual listing using the out-of-the-box sitefinity search result page.  Note that items 1, 2 and 3 contain the ID, but item 4 does not.  I can provide my sf_CmsContentBase, sf_CmsTextContent, sf_GCMetaData and sf_ContentVersion tables (or any others you may need) if that would help in pinpointing the issue.  Thanks you!

    Found 45 pages for "cheddar"

    AGED CHEDDAR "KRAFTED" IN WISCONSIN
    e0191c49-a792-44b8-b055-55aebe4ce1d6 ... Kraft Foods, Inc., one of the country’s leading cheese producers, is marketing shredded cheese made in Wisconsin in new packaging that touts the Cheddar’s Wisconsin origin. The KRAFT Aged Wisconsin Sharp Cheddar cheese was named one of the top ten Cheddars at the recent 2009 Wisconsin State Fair. Packaged in convenient resealable bags ... -Bacon Macaroni and Cheese, that showcases the KRAFT Aged Wisconsin Sharp Cheddar cheese. Available ...
    /foodservice/whatsnew/09-09-01/AGED_CHEDDAR_KRAFTED_IN_WISCONSIN.aspx
    BLACK CREEK® CHEDDAR EXPANDS LINE
    0db13e65-6b2f-4b4e-bd53-7d5ff6c51848 ... Saputo Cheese USA has added White Cheddar to its highly regarded Black Creek® line. Similar to other Black Creek Cheddars, the white style carries on the tradition of hands-on craftsmanship and natural aging that have been a hallmark ... of Wisconsin Master Cheesemakers who have completed a rigorous certification program. The aged White Cheddar is available in 9 month, 2 year and 3 year, as is Black Creek’s Yellow Cheddar. The 9-month old type ...
    /foodservice/whatsnew/09-12-01/BLACK_CREEK_CHEDDAR_EXPANDS_LINE.aspx
    BLACK CREEK® CHEDDAR AGES BEAUTIFULLY
    cc3efab7-8975-4783-bf9a-2865c6d8bcef ... For more than 100 years, Black Creek® has handcrafted cheese from their farm-fresh milk into classic, naturally aged cheeses. Black Creek’s certified Wisconsin Master Cheesemakers continue the time-honored tradition of creating quality cheeses with Black Creek Classic. This rich and nutty Cheddar is offered in three ages: nine months, two years and three years. It becomes increasingly sharp and tangy as it ages, and its smooth, firm ...
    /foodservice/whatsnew/09-03-01/BLACK_CREEK_CHEDDAR_AGES_BEAUTIFULLY.aspx
    BLACK CREEK INTRODUCES PASTURE-GRAZED WHITE CHEDDAR
    the cows to pasture with its Black Creek® Classic Pasture-Grazed White Cheddar Cheese. The delicate, creamy and rich flavor of this Cheddar comes from the milk of a herd that spends 20 hours each day ... Pasture-Grazed White Cheddar is best enjoyed during spring and summer months, when the cows are still grazing on the pasture and before the natural aging process of this fine Cheddar begins to sharpen its mild flavor. The Cheddar can be sliced and served as is or enjoyed with fruit, crackers ...
    /foodservice/whatsnew/07-06-01/BLACK_CREEK_INTRODUCES_PASTURE-GRAZED_WHITE_CHEDDAR.aspx
  6. Chris Jensen
    Chris Jensen avatar
    6 posts
    Registered:
    15 Jul 2009
    23 Mar 2010
    Link to this post
    I've eliminated the custom modules in an attempt to get to the bottom of this issue.  Even with the out-of-the-box News module with the out-of-the-box SearchResult and the out-of-the-box NewsIndex, I am seeing the exact same problem.  The only thing custom now is the guid entry in the fieldsInfoProvider.xml.

    Actual search result (note that results 1 and 3 have a guid, but 2 does not):

    Found 535 pages for "cheddar"

    Cheddar Cheese
    fb4b7621-66b5-4315-a595-2c41a6cf2f19 ... Carr Valley Wild Flower Cheddar ... stuff, but the real deal. The CheddarCheese featured here is produced by Carr Valley Cheese in Wisconsin. It is called Wildflower Cheddar Cheese, because their cows "graze on spring and wild flower pastures". According to Wikipedia, "Cheddar cheese is a relatively hard pale-yellow to off-white, and sometimes sharp-tasting cheese originating in the English village of Cheddar, in Somerset.Cheddar ...
    /foodservice/whatsnew/09-07-04/Cheddar_Cheese.aspx
    AGED CHEDDAR "KRAFTED" IN WISCONSIN
    packaging that touts the Cheddar’s Wisconsin origin. The KRAFT Aged Wisconsin Sharp Cheddar cheese ... , such as Spinach-Bacon Macaroni and Cheese, that showcases the KRAFT Aged Wisconsin Sharp Cheddar cheese ... shredded cheese made in Wisconsin in new packaging that touts the Cheddar’s Wisconsin origin. The KRAFT Aged Wisconsin Sharp Cheddar cheese was named one of the top ten Cheddars at the recent 2009 ... the KRAFT Aged Wisconsin SharpCheddar cheese. 8/31/2009 5:00:00 PM 12/30/2099 5:00:00 PM Current ...
    /foodservice/whatsnew/09-09-01/AGED_CHEDDAR_"KRAFTED"_IN_WISCONSIN.aspx
    Explore the world of American cheddar
    0acf4381-c5ff-4c41-b33e-5caf0b3d8ad3 ... Explore the world of American cheddar ... , they brought cheddar cheese with them. Originally made in Cheddar, a village in southwest England ... style. Because it's so widely available, you might think you know cheddar; you're familiar ... to cheddar. "It's not just a big orange log that you pick up at the grocery store," says Jeanette Hurt, Villa ... ). "Good cheddar doesn't have to be that color." In the beginning Cheddar cheese didn't just get its ...
    /foodservice/whatsnew/08-07-16/Explore_the_world_of_American_cheddar.aspx
  7. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    25 Mar 2010
    Link to this post
    Hi Chris Jensen,

    I sent a reply the the support ticket you had opened.

    Sincerely yours,
    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.
  8. Chris Jensen
    Chris Jensen avatar
    6 posts
    Registered:
    15 Jul 2009
    25 Mar 2010
    Link to this post
    Thank you very much.  Since you mentioned in the support ticket response that adding the guid to the fieldsInfoProvider.xml is a hack and not guaranteed to work 100% of the time, I took a different approach.  Now, I am using the URL and the Application name to retrieve the guid from the sf_CmsContentBase table.  I'm working on the assumption that the combination of Url and Application name will be unique.  I know that the database doesn't enforce that uniqueness, but am I safe in making that assumption?  I can't think of a scenario where you would have two records with the same application and url.
  9. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    30 Mar 2010
    Link to this post
    Hi Chris Jensen,

    You could get the ResultItem from the SearchResults control by subscribing for ItemDatabound event of the Results repeater as shown below

    protected void Page_Load(object sender, EventArgs e)
    {
        this.rptResults.ItemDataBound += new RepeaterItemEventHandler(rptResults_ItemDataBound);
         
    }
     
    void rptResults_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
        {
     
            Telerik.Search.Engine.ResultItem resultItem = (Telerik.Search.Engine.ResultItem)e.Item.DataItem;
        }


    1. You could take a look at the snippet to see whether the guid will be presented there. You could use RegEx to match Guids. so, if the first 36 symbols are not a valid guid, proceed with title and url of the ResultItem

    here is a Guild validator

    public static bool IsGUID(string expression)
    {
        if (expression != null)
        {
            Regex guidRegEx = new Regex(@"^(\{{0,1}([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}\}{0,1})$");
     
            return guidRegEx.IsMatch(expression);
        }
        return false;
    }


    2. If there is no Guid, you could use url and title properties of the ResultItem with combination with ContentManager or CmsManager to find the item you are looking for.


    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
9 posts, 0 answered