lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LUCENE-7481) SpanPayloadCheckQuery and PayloadScoreQuery are missing rewrite methods
Date Thu, 27 Apr 2017 19:47:04 GMT

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

ASF subversion and git services commented on LUCENE-7481:
---------------------------------------------------------

Commit 64caf176ba92beeadf6856bfeac5cf8043d8251b in lucene-solr's branch refs/heads/master
from [~ehatcher]
[ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=64caf17 ]

LUCENE-7481: fix rewrite methods
LUCENE-7808: fix .equals/.hashCode methods


> SpanPayloadCheckQuery and PayloadScoreQuery are missing rewrite methods
> -----------------------------------------------------------------------
>
>                 Key: LUCENE-7481
>                 URL: https://issues.apache.org/jira/browse/LUCENE-7481
>             Project: Lucene - Core
>          Issue Type: Bug
>    Affects Versions: 6.x
>            Reporter: Roman Chyla
>            Assignee: Erik Hatcher
>             Fix For: master (7.0), 6.6
>
>
> If used with a wildcard query, the result is a failure saying: "Rewrite query first"
> The SpanNearQuery has the rewrite method; however the SpanPayloadCheckQuery just returns
the query itself. 
> this works:
> ```
> spanNear([vectrfield:ebyuugz, SpanMultiTermQueryWrapper(vectrfield:e*), SpanMultiTermQueryWrapper(vectrfield:m*),
SpanMultiTermQueryWrapper(vectrfield:f*)], 0, true)
> ```
> code to generate the query:
> ```
> private Query getSpanQuery(String[] parts, int howMany, boolean truncate) throws UnsupportedEncodingException
{
> 		SpanQuery[] clauses = new SpanQuery[howMany+1];
> 		clauses[0] = new SpanTermQuery(new Term("vectrfield", parts[0])); // surname
> 		for (int i = 0; i < howMany; i++) {
> 			if (truncate) {
> 			  SpanMultiTermQueryWrapper<WildcardQuery> q = new SpanMultiTermQueryWrapper<WildcardQuery>(new
WildcardQuery(new Term("vectrfield", parts[i+1].substring(0, 1) + "*")));
> 				clauses[i+1] = q;
> 			}
> 			else {
> 				clauses[i+1] = new SpanTermQuery(new Term("vectrfield", parts[i+1]));
> 			}
> 		}
> 		SpanNearQuery sq = new SpanNearQuery(clauses, 0, true); // match in order
> 		return sq;
> 	}
> ```
> and this fails:
> ```
> spanPayCheck(spanNear([vectrfield:ebyuugz, SpanMultiTermQueryWrapper(vectrfield:e*),
SpanMultiTermQueryWrapper(vectrfield:m*), SpanMultiTermQueryWrapper(vectrfield:f*)], 1, true),
payloadRef: 0;1;2;3;)
> ```
> each clause is made of:
> ```
> new SpanMultiTermQueryWrapper<WildcardQuery>(new WildcardQuery(new Term("vectrfield",
parts[i+1].substring(0, 1) + "*")));
> ```
> It is a regression; the code was working well in SOLR4.x



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

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


Mime
View raw message