More in this section

Forums / Developing with Sitefinity / Using MetaSearchInfo

Using MetaSearchInfo

7 posts, 0 answered
  1. Luc Baeten
    Luc Baeten avatar
    169 posts
    Registered:
    23 Sep 2005
    21 May 2008
    Link to this post

    Hello Sitefinity Team

    I have developed my own custom NewsList control. In this control I defined filters for Publication and Expiration date fields based on MetaSearchInfo:

    filter.Add(
    new MetaSearchInfo(MetaValueTypes.DateTime, this.manager.PublicationDateField, DateTime.Now, SearchCondition.LessOrEqual, JoinType.And));

    filter.Add(new MetaSearchInfo(MetaValueTypes.DateTime, this.manager.ExpirationDateField, DateTime.Now, SearchCondition.GreaterThen, JoinType.And));


    Besides I want newsList items with a publication date less or equal than today and an expiration date greater than today I also want the newslist items presented that have no expiration date. How must I define this filter with MetaSearchInfo?

    Regards
    Luc
  2. Bob
    Bob avatar
    330 posts
    Registered:
    30 Dec 2016
    21 May 2008
    Link to this post
    Hi Luc,

    Unfortunately, the current implementation does not support OR operators. The only way to achieve this is to retrieve all the data and filter in memory. I know this is a very inefficient way but it will work fine for up to a couple of thousands items.

    The good news is that in a few months you will be able filter metadata and content items with LINQ and construct queries with any level of complexity.

    Sincerely yours,
    Bob
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Schneider
    Schneider avatar
    29 posts
    Registered:
    02 Nov 2008
    24 Nov 2008
    Link to this post
    Has this LINQ interface been created yet?
  4. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    26 Nov 2008
    Link to this post
    Hi Schneider,

    It will be implemented for Sitefinity 4.0. It is not available in the current version.

    Regards,
    Georgi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  5. Schneider
    Schneider avatar
    29 posts
    Registered:
    02 Nov 2008
    10 Dec 2008
    Link to this post
    I really hope this feature makes it into 4.0. as its pretty pathetic having to do multiple round trips and then manually 'join' the results.
  6. Ivan
    Ivan avatar
    478 posts
    Registered:
    16 Jun 2015
    11 Dec 2008
    Link to this post
    Hi Schneider,

    we truly agree with you - the proof of that is that we have decided to change the DAL completely. With Sitefinity 4.0 we will integrate Telerik OpenAccess as the ORM tool which is incomparably more powerful and supports OQL and LINQ query among many other features.

    With this capabilities we will also be able to improve the API (at first only the GenericContent API) to be much simpler and at the same time more powerful - and everything will perform much better due to reduced database trips.

    This transition is at the heart of Sitefinity 4.0 and it will surely be included.

    Thank you for your understanding.

    Regards,
    Ivan
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  7. Schneider
    Schneider avatar
    29 posts
    Registered:
    02 Nov 2008
    11 Dec 2008
    Link to this post
    Sounds great.

    We look forward to trying it because with version 3.x we have had mixed results and we are looking to make a decision within the next 3 months on whether to continue to invest in SF or not.
Register for webinar
7 posts, 0 answered