Copied to clipboard

Flag this post as spam?

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


  • Cliff Fenwick Gibb 3 posts 74 karma points
    Oct 13, 2017 @ 20:37
    Cliff Fenwick Gibb
    0

    Examine And() does not work for Range

    Greetings all,

    I am having an issue with v7.7.0 performing an Examine search.

    Here is a sample of the Range query: queryNodes = queryNodes.And().Range("createDate", Convert.ToDateTime(model.FromDate), DateTime.Now);

    The generated lucence query does not include the "+" before this, so it isn't filtering as expected. Here is the lucene query: (-umbracoNaviHide:1) createDate:[20110223165338441 TO 20110225165338441]

    (returns all results)

    If I manually add the "+" in Luke, I get the expected results: (-umbracoNaviHide:1) +createDate:[20110223165338441 TO 20110225165338441]

    (returns the expected 5 results)

    When using "And" for other types of queries (other than Range), the "+" sign is added as expected.

    Any thoughts?

    Cheers

    Cliff

  • Cliff Fenwick Gibb 3 posts 74 karma points
    Oct 13, 2017 @ 20:46
    Cliff Fenwick Gibb
    1

    Answering my own question... (at least this was my fix)

    I changed: ISearchCriteria searchCriteria = ExamineManager.Instance.CreateSearchCriteria(BooleanOperation.Or);

    to

    ISearchCriteria searchCriteria = ExamineManager.Instance.CreateSearchCriteria(BooleanOperation.And);

    And the "+" sign is now added for my Range searches.

    Cheers

Please Sign in or register to post replies

Write your reply to:

Draft