lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Charlie <>
Subject Span Query NLE
Date Mon, 24 Jul 2006 02:31:10 GMT
Would anyone give me a hint regarding the natural language expression
of the following span query?

------------if creating queries programmatically (it is in Lucene scr)

    SpanTermQuery t1 = new SpanTermQuery(new Term("field","six"));
    SpanTermQuery t2 = new SpanTermQuery(new Term("field","hundred"));
    SpanNearQuery tt1 = new SpanNearQuery(new SpanQuery[] {t1, t2}, 0,true);

    SpanTermQuery t3 = new SpanTermQuery(new Term("field","seven"));
    SpanTermQuery t4 = new SpanTermQuery(new Term("field","hundred"));
    SpanNearQuery tt2 = new SpanNearQuery(new SpanQuery[] {t3, t4}, 0,true);
    SpanTermQuery t5 = new SpanTermQuery(new Term("field","seven"));
    SpanTermQuery t6 = new SpanTermQuery(new Term("field","six"));

    SpanOrQuery to1 = new SpanOrQuery(new SpanQuery[] {tt1, tt2});
    SpanOrQuery to2 = new SpanOrQuery(new SpanQuery[] {t5, t6});
    SpanNearQuery query = new SpanNearQuery(new SpanQuery[] {to1, to2},
                                            100, true);
------------and it becomes:

spanNear([spanOr([spanNear([field:six, field:hundred], 0, true), spanNear([field:seven, field:hundred],
0, true)]), spanOr([field:seven, field:six])], 100, true)

------------what's its equivalence in natural language?

(something we can write in one line and can be parsed by QueryParser)
(if we have default field already)


(("six hundred"~0 "six hundred"~0) AND (seven six))~100




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

View raw message