Copied to clipboard

Flag this post as spam?

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


  • Remko 118 posts 283 karma points
    Apr 16, 2015 @ 15:44
    Remko
    0

    Examine query question 2 date ranges in OR relation

    Hi there,

    I've got to query in Examine on 2 date fields: startDate and endDate. Startdate OR enddate should be in a certain range..

    I've build up my query with mostly ANDs and finally I do:

    query

     .And()

    .Range(dateField, startDate, endDate);

    But if I'll do this next:

    query

     .Or()

    .Range(dateField2, startDate, endDate);

    It doesn't give the wanted result. I want these two Ranges in a GroupedOr... So it will look like this:

    { SearchIndexType: , LuceneQuery: -umbracoNaviHide:1 -parentID:1 -isPublished:0 +(nodeTypeAlias:productionevent) +lowestPrice:0 -tipped:1 + (startdateRewritten: [20150416000000 TO 20160417235859] enddateRewritten:[20150416000000 TO 20160417235859]) }

     

    Can anyone help me with this one?

     

     

  • Ismail Mayat 4511 posts 10090 karma points MVP 2x admin c-trib
    Apr 16, 2015 @ 17:45
    Ismail Mayat
    0

    Remko,

    You may need todo this one as a raw query not sure if you can do grouped or with Examine fluent api on 2 date fields.

    Regards

    Ismail

Please Sign in or register to post replies

Write your reply to:

Draft