You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by "Simon Svensson (JIRA)" <ji...@apache.org> on 2015/04/01 09:25:53 UTC

[jira] [Commented] (LUCENENET-552) Boolean NOT is not working with Date Range Query in Lucene.net v3.0.3.0

    [ https://issues.apache.org/jira/browse/LUCENENET-552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14390136#comment-14390136 ] 

Simon Svensson commented on LUCENENET-552:
------------------------------------------

Is this your only query in the search request? You can't just provide a negative query, you need some matching queries too. Add a MatchAllDocsQuery to your BooleanQuery, the result should end up as {{**:** -CreateDateTime:[ ... ]}}

You've confirmed that this issue exists in Luke too, which means this "limitation" is also present in Lucene. This is not really a bug, but just how the queries work.

> Boolean NOT is not working with Date Range Query in Lucene.net v3.0.3.0
> -----------------------------------------------------------------------
>
>                 Key: LUCENENET-552
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-552
>             Project: Lucene.Net
>          Issue Type: Bug
>          Components: Lucene.Net Core
>    Affects Versions: Lucene.Net 3.0.3
>         Environment: Windows 7, Intel core i3 , 4 GB Ram
>            Reporter: Pravin Thokal
>
> I am using Lucene.net v3.0.3.0 for indexing and searching, I have "CreateDateTime" field which store document creation datetime.I would like to Create DateTime range query with boolean "NOT" condition. Means I would like to retrieve all those documents whose CreateDate should not be in the range which I have given, I am able to create query but the query is not returning any results.
> Date is mmddyyyyhhmmss format.
> my date range is 7/15/2014 12:00:00 AM To 3/31/2015 11:59:59 PM
> My final query is as follows,
> -CreateDateTime:[20140715000000000 TO 20150331235959000]
> I had tried same query with the help of Luke tool as well it is also not returning any result. The indexing was created normally and I am able to fire all types of quires on it except DateRange query with NOT Boolean condition. NOT is working perfectly fine on other fields.
> Any Suggestions ?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)