[
https://issues.apache.org/jira/browse/LUCENE-5331?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13983421#comment-13983421
]
Tim Allison commented on LUCENE-5331:
-------------------------------------
[~speedplane], I was trying to figure out if what you're seeing is the same as
the original issue or the one that I raised.
The example that you posted on the google groups seems to work in pure Lucene
both 4.7 and trunk:
{noformat}
private final static String FIELD = "f";
@Test
public void testSimpleBizBuz() throws Exception {
Analyzer analyzer = new StandardAnalyzer(Version.LUCENE_47);
IndexWriterConfig config = new IndexWriterConfig(Version.LUCENE_47,
analyzer);
RAMDirectory d = new RAMDirectory();
IndexWriter writer = new IndexWriter(d, config);
Document doc = new Document();
doc.add(new TextField(FIELD, "foo biz buz", Store.YES));
writer.addDocument(doc);
doc = new Document();
doc.add(new TextField(FIELD, "foo biz and biz buz", Store.YES));
writer.addDocument(doc);
writer.close();
SpanQuery foo = new SpanTermQuery(new Term(FIELD, "foo"));
SpanQuery biz = new SpanTermQuery(new Term(FIELD, "biz"));
SpanQuery buz = new SpanTermQuery(new Term(FIELD, "buz"));
SpanQuery bizbuz = new SpanNearQuery(new SpanQuery[]{biz, buz}, 0, false);
SpanQuery foobizbuz = new SpanNearQuery(new SpanQuery[]{foo, bizbuz}, 0,
false);
IndexReader reader = DirectoryReader.open(d);
IndexSearcher searcher = new IndexSearcher(reader);
TopScoreDocCollector coll = TopScoreDocCollector.create(100, true);
searcher.search(foobizbuz, coll);
ScoreDoc[] scoreDocs = coll.topDocs().scoreDocs;
assertEquals(1, scoreDocs.length);
}
{noformat}
Are you sure the issue that you reported is the same as one of the ones in this
issue? Is the above test case right?
> nested SpanNearQuery with repeating groups does not find match
> --------------------------------------------------------------
>
> Key: LUCENE-5331
> URL: https://issues.apache.org/jira/browse/LUCENE-5331
> Project: Lucene - Core
> Issue Type: Bug
> Reporter: Jerry Zhou
> Attachments: NestedSpanNearTest.java
>
>
> Nested spanNear queries do not work in some cases when repeating groups are
> in the query.
> Test case is attached ...
--
This message was sent by Atlassian JIRA
(v6.2#6252)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]