You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Billow Gao (JIRA)" <ji...@apache.org> on 2009/04/13 18:46:14 UTC

[jira] Created: (LUCENE-1599) SpanRegexQuery and SpanNearQuery is not working with MultiSearcher

SpanRegexQuery and SpanNearQuery is not working with MultiSearcher
------------------------------------------------------------------

                 Key: LUCENE-1599
                 URL: https://issues.apache.org/jira/browse/LUCENE-1599
             Project: Lucene - Java
          Issue Type: Bug
          Components: contrib/*
    Affects Versions: 2.4.1
         Environment: lucene-core 2.4.1, lucene-regex 2.4.1
            Reporter: Billow Gao


MultiSearcher is using:
queries[i] = searchables[i].rewrite(original);
to rewrite query and then use combine to combine them.

But SpanRegexQuery's rewrite is different from others.
After you call it on the same query, it always return the same rewritten queries.

As a result, only search on the first IndexSearcher work. All others are using the first IndexSearcher's rewrite queries.
So many terms are missing and return unexpected result.

Billow

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Commented: (LUCENE-1599) SpanRegexQuery and SpanNearQuery is not working with MultiSearcher

Posted by "Billow Gao (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12718958#action_12718958 ] 

Billow Gao commented on LUCENE-1599:
------------------------------------

I rewrote the MultiSearcher for my system. Actually, we rewrote most lucene analyzer/parser/search functions...
So my patch won't work for others.

I will look into the SpanQuery function when I get a chance. I believe that our patch should be applied there.
Also, I don't like MultiSearcher's combine function.

> SpanRegexQuery and SpanNearQuery is not working with MultiSearcher
> ------------------------------------------------------------------
>
>                 Key: LUCENE-1599
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1599
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: contrib/*
>    Affects Versions: 2.4.1
>         Environment: lucene-core 2.4.1, lucene-regex 2.4.1
>            Reporter: Billow Gao
>             Fix For: 2.9
>
>         Attachments: TestSpanRegexBug.java
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> MultiSearcher is using:
> queries[i] = searchables[i].rewrite(original);
> to rewrite query and then use combine to combine them.
> But SpanRegexQuery's rewrite is different from others.
> After you call it on the same query, it always return the same rewritten queries.
> As a result, only search on the first IndexSearcher work. All others are using the first IndexSearcher's rewrite queries.
> So many terms are missing and return unexpected result.
> Billow

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Assigned: (LUCENE-1599) SpanRegexQuery and SpanNearQuery is not working with MultiSearcher

Posted by "Mark Miller (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-1599?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Miller reassigned LUCENE-1599:
-----------------------------------

    Assignee: Mark Miller

> SpanRegexQuery and SpanNearQuery is not working with MultiSearcher
> ------------------------------------------------------------------
>
>                 Key: LUCENE-1599
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1599
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: contrib/*
>    Affects Versions: 2.4.1
>         Environment: lucene-core 2.4.1, lucene-regex 2.4.1
>            Reporter: Billow Gao
>            Assignee: Mark Miller
>             Fix For: 2.9
>
>         Attachments: TestSpanRegexBug.java
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> MultiSearcher is using:
> queries[i] = searchables[i].rewrite(original);
> to rewrite query and then use combine to combine them.
> But SpanRegexQuery's rewrite is different from others.
> After you call it on the same query, it always return the same rewritten queries.
> As a result, only search on the first IndexSearcher work. All others are using the first IndexSearcher's rewrite queries.
> So many terms are missing and return unexpected result.
> Billow

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Commented: (LUCENE-1599) SpanRegexQuery and SpanNearQuery is not working with MultiSearcher

Posted by "Billow Gao (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12718948#action_12718948 ] 

Billow Gao commented on LUCENE-1599:
------------------------------------

Not there.
If you use the query one those two IndexSearcher one by one, then you will find that only the first search has a match.
The second one always fail.

For example:

SpanRegexQuery srq = new SpanRegexQuery(new Term("field", "a.*"));
        SpanRegexQuery stq = new SpanRegexQuery(new Term("field", "b.*"));
        SpanNearQuery query = new SpanNearQuery(new SpanQuery[] { srq, stq },
                6, true);
IndexSearcher[] arrSearcher = new IndexSearcher[2];
        arrSearcher[0] = new IndexSearcher(indexStoreA);
        arrSearcher[1] = new IndexSearcher(indexStoreB);

Hits hits = arrSearcher[0].search(query);
assertEquals(1, hits.length());

hits = arrSearcher[1].search(query);

//fail here because query rewrite will not use new term.
//The problem should sit inside spanquery, maybe it only call rewrite function once.
//Anyway, I didn't check its source code yet.
assertEquals(1, hits.length()); 

arrSearcher[0].close();
arrSearcher[1].close();




> SpanRegexQuery and SpanNearQuery is not working with MultiSearcher
> ------------------------------------------------------------------
>
>                 Key: LUCENE-1599
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1599
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: contrib/*
>    Affects Versions: 2.4.1
>         Environment: lucene-core 2.4.1, lucene-regex 2.4.1
>            Reporter: Billow Gao
>             Fix For: 2.9
>
>         Attachments: TestSpanRegexBug.java
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> MultiSearcher is using:
> queries[i] = searchables[i].rewrite(original);
> to rewrite query and then use combine to combine them.
> But SpanRegexQuery's rewrite is different from others.
> After you call it on the same query, it always return the same rewritten queries.
> As a result, only search on the first IndexSearcher work. All others are using the first IndexSearcher's rewrite queries.
> So many terms are missing and return unexpected result.
> Billow

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Updated: (LUCENE-1599) SpanRegexQuery and SpanNearQuery is not working with MultiSearcher

Posted by "Mark Miller (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-1599?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Miller updated LUCENE-1599:
--------------------------------

    Attachment: LUCENE-1599.patch

Test + Fix (properly implement clone on near,or,not span queries)

> SpanRegexQuery and SpanNearQuery is not working with MultiSearcher
> ------------------------------------------------------------------
>
>                 Key: LUCENE-1599
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1599
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: contrib/*
>    Affects Versions: 2.4.1
>         Environment: lucene-core 2.4.1, lucene-regex 2.4.1
>            Reporter: Billow Gao
>            Assignee: Mark Miller
>             Fix For: 2.9
>
>         Attachments: LUCENE-1599.patch, TestSpanRegexBug.java
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> MultiSearcher is using:
> queries[i] = searchables[i].rewrite(original);
> to rewrite query and then use combine to combine them.
> But SpanRegexQuery's rewrite is different from others.
> After you call it on the same query, it always return the same rewritten queries.
> As a result, only search on the first IndexSearcher work. All others are using the first IndexSearcher's rewrite queries.
> So many terms are missing and return unexpected result.
> Billow

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Updated: (LUCENE-1599) SpanRegexQuery and SpanNearQuery is not working with MultiSearcher

Posted by "Billow Gao (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-1599?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Billow Gao updated LUCENE-1599:
-------------------------------

    Attachment: TestSpanRegexBug.java

Sorry, I should write the test case earlier.
Forgot to check my email on this account.

Here is the testcase.

The problem is very clear.
When there is a SpanNearQuery query which have SpanRegexQuery in it.
And MultiSearcher is used, the query will only be rewritten once on the first IndexSearcher in the MultiSearcher.
So only terms in the first IndexSearcher are used.
And of course, it will fail on other IndexSearchers since it didn't use terms in those IndexSearchers.

Billow

> SpanRegexQuery and SpanNearQuery is not working with MultiSearcher
> ------------------------------------------------------------------
>
>                 Key: LUCENE-1599
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1599
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: contrib/*
>    Affects Versions: 2.4.1
>         Environment: lucene-core 2.4.1, lucene-regex 2.4.1
>            Reporter: Billow Gao
>         Attachments: TestSpanRegexBug.java
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> MultiSearcher is using:
> queries[i] = searchables[i].rewrite(original);
> to rewrite query and then use combine to combine them.
> But SpanRegexQuery's rewrite is different from others.
> After you call it on the same query, it always return the same rewritten queries.
> As a result, only search on the first IndexSearcher work. All others are using the first IndexSearcher's rewrite queries.
> So many terms are missing and return unexpected result.
> Billow

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Commented: (LUCENE-1599) SpanRegexQuery and SpanNearQuery is not working with MultiSearcher

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12718955#action_12718955 ] 

Michael McCandless commented on LUCENE-1599:
--------------------------------------------

Hmm... do you have a patch in mind (to Lucene's sources) to fix this?

> SpanRegexQuery and SpanNearQuery is not working with MultiSearcher
> ------------------------------------------------------------------
>
>                 Key: LUCENE-1599
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1599
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: contrib/*
>    Affects Versions: 2.4.1
>         Environment: lucene-core 2.4.1, lucene-regex 2.4.1
>            Reporter: Billow Gao
>             Fix For: 2.9
>
>         Attachments: TestSpanRegexBug.java
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> MultiSearcher is using:
> queries[i] = searchables[i].rewrite(original);
> to rewrite query and then use combine to combine them.
> But SpanRegexQuery's rewrite is different from others.
> After you call it on the same query, it always return the same rewritten queries.
> As a result, only search on the first IndexSearcher work. All others are using the first IndexSearcher's rewrite queries.
> So many terms are missing and return unexpected result.
> Billow

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Commented: (LUCENE-1599) SpanRegexQuery and SpanNearQuery is not working with MultiSearcher

Posted by "Billow Gao (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12718419#action_12718419 ] 

Billow Gao commented on LUCENE-1599:
------------------------------------

Just uploaded the testcase  	TestSpanRegexBug.java.

Sorry, I should write the test case earlier.
Forgot to check my email on this account.

Here is the testcase.

The problem is very clear.
When there is a SpanNearQuery query which have SpanRegexQuery in it.
And MultiSearcher is used, the query will only be rewritten once on the first IndexSearcher in the MultiSearcher.
So only terms in the first IndexSearcher are used.
And of course, it will fail on other IndexSearchers since it didn't use terms in those IndexSearchers.

Billow

> SpanRegexQuery and SpanNearQuery is not working with MultiSearcher
> ------------------------------------------------------------------
>
>                 Key: LUCENE-1599
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1599
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: contrib/*
>    Affects Versions: 2.4.1
>         Environment: lucene-core 2.4.1, lucene-regex 2.4.1
>            Reporter: Billow Gao
>         Attachments: TestSpanRegexBug.java
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> MultiSearcher is using:
> queries[i] = searchables[i].rewrite(original);
> to rewrite query and then use combine to combine them.
> But SpanRegexQuery's rewrite is different from others.
> After you call it on the same query, it always return the same rewritten queries.
> As a result, only search on the first IndexSearcher work. All others are using the first IndexSearcher's rewrite queries.
> So many terms are missing and return unexpected result.
> Billow

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Commented: (LUCENE-1599) SpanRegexQuery and SpanNearQuery is not working with MultiSearcher

Posted by "Mark Miller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12718396#action_12718396 ] 

Mark Miller commented on LUCENE-1599:
-------------------------------------

Hey Billow, do you have anything to add to help us track this down? If not, I'm going to close it as incomplete eventually.

> SpanRegexQuery and SpanNearQuery is not working with MultiSearcher
> ------------------------------------------------------------------
>
>                 Key: LUCENE-1599
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1599
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: contrib/*
>    Affects Versions: 2.4.1
>         Environment: lucene-core 2.4.1, lucene-regex 2.4.1
>            Reporter: Billow Gao
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> MultiSearcher is using:
> queries[i] = searchables[i].rewrite(original);
> to rewrite query and then use combine to combine them.
> But SpanRegexQuery's rewrite is different from others.
> After you call it on the same query, it always return the same rewritten queries.
> As a result, only search on the first IndexSearcher work. All others are using the first IndexSearcher's rewrite queries.
> So many terms are missing and return unexpected result.
> Billow

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Commented: (LUCENE-1599) SpanRegexQuery and SpanNearQuery is not working with MultiSearcher

Posted by "Mark Miller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12721052#action_12721052 ] 

Mark Miller commented on LUCENE-1599:
-------------------------------------

Well yuck.

SpanNearQuery does this clone call in its rewrite method but there is no clone impl - so it looks like it returns a SpanNearQuery with the same clauses instance. So it looks like this gets tangled up with the real query, and the real query gets modified to the rewritten form for the rewrite on searchable2.

I think anyway. I wanted to just test a fix to if that was right, but SpanNearQuery can contain any span queries, so I guess all of them might need clone impls and we may have to clone the whole chain?

A little tired to think about it at the moment ;) Looks like the issue is with the cloning in SpanNearQuery though.

> SpanRegexQuery and SpanNearQuery is not working with MultiSearcher
> ------------------------------------------------------------------
>
>                 Key: LUCENE-1599
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1599
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: contrib/*
>    Affects Versions: 2.4.1
>         Environment: lucene-core 2.4.1, lucene-regex 2.4.1
>            Reporter: Billow Gao
>            Assignee: Mark Miller
>             Fix For: 2.9
>
>         Attachments: TestSpanRegexBug.java
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> MultiSearcher is using:
> queries[i] = searchables[i].rewrite(original);
> to rewrite query and then use combine to combine them.
> But SpanRegexQuery's rewrite is different from others.
> After you call it on the same query, it always return the same rewritten queries.
> As a result, only search on the first IndexSearcher work. All others are using the first IndexSearcher's rewrite queries.
> So many terms are missing and return unexpected result.
> Billow

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Commented: (LUCENE-1599) SpanRegexQuery and SpanNearQuery is not working with MultiSearcher

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12718962#action_12718962 ] 

Michael McCandless commented on LUCENE-1599:
--------------------------------------------

bq. I rewrote the MultiSearcher for my system. Actually, we rewrote most lucene analyzer/parser/search functions...

Sounds interesting!  Anything that could be contributed back?

bq. Also, I don't like MultiSearcher's combine function.

I don't either!  It seems like Lucene should rewrite then search, against each searcher, rather than rewriting all up front and combining.

> SpanRegexQuery and SpanNearQuery is not working with MultiSearcher
> ------------------------------------------------------------------
>
>                 Key: LUCENE-1599
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1599
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: contrib/*
>    Affects Versions: 2.4.1
>         Environment: lucene-core 2.4.1, lucene-regex 2.4.1
>            Reporter: Billow Gao
>             Fix For: 2.9
>
>         Attachments: TestSpanRegexBug.java
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> MultiSearcher is using:
> queries[i] = searchables[i].rewrite(original);
> to rewrite query and then use combine to combine them.
> But SpanRegexQuery's rewrite is different from others.
> After you call it on the same query, it always return the same rewritten queries.
> As a result, only search on the first IndexSearcher work. All others are using the first IndexSearcher's rewrite queries.
> So many terms are missing and return unexpected result.
> Billow

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Commented: (LUCENE-1599) SpanRegexQuery and SpanNearQuery is not working with MultiSearcher

Posted by "Mark Miller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12700596#action_12700596 ] 

Mark Miller commented on LUCENE-1599:
-------------------------------------

Could you write a quick test case? I just give it a simple go, and for the case I used, I didn't see the problem. If you can provide some sample code that shows exactly what tickles it, I'll work on fixing it.

> SpanRegexQuery and SpanNearQuery is not working with MultiSearcher
> ------------------------------------------------------------------
>
>                 Key: LUCENE-1599
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1599
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: contrib/*
>    Affects Versions: 2.4.1
>         Environment: lucene-core 2.4.1, lucene-regex 2.4.1
>            Reporter: Billow Gao
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> MultiSearcher is using:
> queries[i] = searchables[i].rewrite(original);
> to rewrite query and then use combine to combine them.
> But SpanRegexQuery's rewrite is different from others.
> After you call it on the same query, it always return the same rewritten queries.
> As a result, only search on the first IndexSearcher work. All others are using the first IndexSearcher's rewrite queries.
> So many terms are missing and return unexpected result.
> Billow

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Commented: (LUCENE-1599) SpanRegexQuery and SpanNearQuery is not working with MultiSearcher

Posted by "Billow Gao (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12718964#action_12718964 ] 

Billow Gao commented on LUCENE-1599:
------------------------------------

The system is specially designed for special requirement. So they are not for general purpose.
Added many limitation and extended some search features.
I will re-organize and extract those useful for public, and then contribute them.
But not a good time to do that now. Will wait until they are stable enough.

> SpanRegexQuery and SpanNearQuery is not working with MultiSearcher
> ------------------------------------------------------------------
>
>                 Key: LUCENE-1599
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1599
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: contrib/*
>    Affects Versions: 2.4.1
>         Environment: lucene-core 2.4.1, lucene-regex 2.4.1
>            Reporter: Billow Gao
>             Fix For: 2.9
>
>         Attachments: TestSpanRegexBug.java
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> MultiSearcher is using:
> queries[i] = searchables[i].rewrite(original);
> to rewrite query and then use combine to combine them.
> But SpanRegexQuery's rewrite is different from others.
> After you call it on the same query, it always return the same rewritten queries.
> As a result, only search on the first IndexSearcher work. All others are using the first IndexSearcher's rewrite queries.
> So many terms are missing and return unexpected result.
> Billow

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Resolved: (LUCENE-1599) SpanRegexQuery and SpanNearQuery is not working with MultiSearcher

Posted by "Mark Miller (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-1599?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Miller resolved LUCENE-1599.
---------------------------------

       Resolution: Fixed
    Lucene Fields: [New, Patch Available]  (was: [New])

> SpanRegexQuery and SpanNearQuery is not working with MultiSearcher
> ------------------------------------------------------------------
>
>                 Key: LUCENE-1599
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1599
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: contrib/*
>    Affects Versions: 2.4.1
>         Environment: lucene-core 2.4.1, lucene-regex 2.4.1
>            Reporter: Billow Gao
>            Assignee: Mark Miller
>             Fix For: 2.9
>
>         Attachments: LUCENE-1599.patch, TestSpanRegexBug.java
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> MultiSearcher is using:
> queries[i] = searchables[i].rewrite(original);
> to rewrite query and then use combine to combine them.
> But SpanRegexQuery's rewrite is different from others.
> After you call it on the same query, it always return the same rewritten queries.
> As a result, only search on the first IndexSearcher work. All others are using the first IndexSearcher's rewrite queries.
> So many terms are missing and return unexpected result.
> Billow

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Commented: (LUCENE-1599) SpanRegexQuery and SpanNearQuery is not working with MultiSearcher

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12718945#action_12718945 ] 

Michael McCandless commented on LUCENE-1599:
--------------------------------------------

MultiSearcher seems to rewrite against all its searchers, and then uses Query.combine to merge all the the results?  Maybe the issue is in Query.combine?

Seems like we should fix this for 2.9.

> SpanRegexQuery and SpanNearQuery is not working with MultiSearcher
> ------------------------------------------------------------------
>
>                 Key: LUCENE-1599
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1599
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: contrib/*
>    Affects Versions: 2.4.1
>         Environment: lucene-core 2.4.1, lucene-regex 2.4.1
>            Reporter: Billow Gao
>             Fix For: 2.9
>
>         Attachments: TestSpanRegexBug.java
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> MultiSearcher is using:
> queries[i] = searchables[i].rewrite(original);
> to rewrite query and then use combine to combine them.
> But SpanRegexQuery's rewrite is different from others.
> After you call it on the same query, it always return the same rewritten queries.
> As a result, only search on the first IndexSearcher work. All others are using the first IndexSearcher's rewrite queries.
> So many terms are missing and return unexpected result.
> Billow

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Commented: (LUCENE-1599) SpanRegexQuery and SpanNearQuery is not working with MultiSearcher

Posted by "Mark Miller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LUCENE-1599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12719619#action_12719619 ] 

Mark Miller commented on LUCENE-1599:
-------------------------------------

Something is modifying the original query itself.

In MultiSearcher.rewrite:

  public Query rewrite(Query original) throws IOException {
    Query[] queries = new Query[searchables.length];
    for (int i = 0; i < searchables.length; i++) {
      queries[i] = searchables[i].rewrite(original);
    }
    return queries[0].combine(queries);
  }

On the first time through the loop, the SpanRegexQuery will contain the regex pattern, but the first time it hits rewrite, it will be changed to the expanded query. This shouldnt happen.
On the next time through the loop, original query will not contain a regex pattern, but will instead be the first time through the loop's rewritten query. Oddness.

I'll dig in and try and fix for 2.9.

> SpanRegexQuery and SpanNearQuery is not working with MultiSearcher
> ------------------------------------------------------------------
>
>                 Key: LUCENE-1599
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1599
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: contrib/*
>    Affects Versions: 2.4.1
>         Environment: lucene-core 2.4.1, lucene-regex 2.4.1
>            Reporter: Billow Gao
>             Fix For: 2.9
>
>         Attachments: TestSpanRegexBug.java
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> MultiSearcher is using:
> queries[i] = searchables[i].rewrite(original);
> to rewrite query and then use combine to combine them.
> But SpanRegexQuery's rewrite is different from others.
> After you call it on the same query, it always return the same rewritten queries.
> As a result, only search on the first IndexSearcher work. All others are using the first IndexSearcher's rewrite queries.
> So many terms are missing and return unexpected result.
> Billow

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


[jira] Updated: (LUCENE-1599) SpanRegexQuery and SpanNearQuery is not working with MultiSearcher

Posted by "Michael McCandless (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENE-1599?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael McCandless updated LUCENE-1599:
---------------------------------------

    Fix Version/s: 2.9

> SpanRegexQuery and SpanNearQuery is not working with MultiSearcher
> ------------------------------------------------------------------
>
>                 Key: LUCENE-1599
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1599
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: contrib/*
>    Affects Versions: 2.4.1
>         Environment: lucene-core 2.4.1, lucene-regex 2.4.1
>            Reporter: Billow Gao
>             Fix For: 2.9
>
>         Attachments: TestSpanRegexBug.java
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> MultiSearcher is using:
> queries[i] = searchables[i].rewrite(original);
> to rewrite query and then use combine to combine them.
> But SpanRegexQuery's rewrite is different from others.
> After you call it on the same query, it always return the same rewritten queries.
> As a result, only search on the first IndexSearcher work. All others are using the first IndexSearcher's rewrite queries.
> So many terms are missing and return unexpected result.
> Billow

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org