Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Seyfullah Tıkıç 23 posts 43 karma points
    Mar 03, 2011 @ 11:34
    Seyfullah Tıkıç
    0

    Searching by date

    Hello,

    I have a content which has a date property.

    I want to search which events exist between 2 dates.

    How can I do this using fluent search API?

    Thanks.

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    Mar 03, 2011 @ 11:49
    Ismail Mayat
    0

    Seyfullah,

    what version of umbraco are you using? Also is this for internal search or search on front end of the website?  If internal search then you will have an index already and you can use examine to search but you will need to write your own dashboard control to do it. If its for front end search you will need to create an index then the search form.  Either way see http://www.farmcode.org/page/Umbraco-Examine.aspx and also search on this forum for regarding how to search using examine.

    Regards

    Ismail

  • Seyfullah Tıkıç 23 posts 43 karma points
    Mar 03, 2011 @ 12:58
    Seyfullah Tıkıç
    0

    I am using umbraco v 4.6.1 (Assembly version: 1.0.4029.25836). 

    It is for on front end of the web site. I created the index also. I only need the query. I have the following code.

                SearchTerm = Request.QueryString["s"];

                if (string.IsNullOrEmpty(SearchTerm)) return;            

                var criteria = ExamineManager.Instance

                        .SearchProviderCollection["DemoSearcher"]

                        .CreateSearchCriteria(UmbracoExamine.IndexTypes.Content);

                var fields = new[]

                                 {

                                     "nodeName", "bodyText", "siteName", "siteDescription",

                                     "file", "publishedYear", "author", "summary", "startDate", "endDate", "phone",

                                     "city", "address", "description", "siteName", "link"

                                 };

                var filter = criteria               .GroupedOr(fields, SearchTerm)               .Not()               .Field("UmbracoNaviHide", "1")               .Compile();

                SearchResultList = ExamineManager.Instance.SearchProviderCollection["DemoSearcher"].Search(filter);

     

    I want to filter the publishedYear.

    Thanks.

Please Sign in or register to post replies

Write your reply to:

Draft