lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Allison (JIRA)" <>
Subject [jira] [Commented] (LUCENE-5331) nested SpanNearQuery with repeating groups does not find match
Date Mon, 28 Apr 2014 19:14:30 GMT


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

   private final static String FIELD = "f";

   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));
      doc = new Document();
      doc.add(new TextField(FIELD, "foo biz and biz buz", Store.YES));
      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 =;
      IndexSearcher searcher = new IndexSearcher(reader);
      TopScoreDocCollector coll = TopScoreDocCollector.create(100,  true);, coll);
      ScoreDoc[] scoreDocs = coll.topDocs().scoreDocs;
      assertEquals(1, scoreDocs.length);      

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:
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Jerry Zhou
>         Attachments:
> 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

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message