lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <hossman_luc...@fucit.org>
Subject Re: Span Query NLE
Date Mon, 24 Jul 2006 07:04:35 GMT

: > Would anyone give me a hint regarding the natural language expression
: > of the following span query?

: I'm sorry, but all queries are not supported by the QueryParser. Spans
: beeing one of them. See QueryParser.jj to add your syntax.

I think one of us is missunderstanding the question ... in my mind the
"natural language expression" for this query...

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

...is...

  Either "six" followed by "hundred" with no gap between them, or "seven"
  followed by "hundred" with no gap between them; followed by either
  "seven" or "six" with a gap of no more no more then 100 tokens in
  between them.

It's a fairly contrived test case from TestSpansAdvanced if i'm not
mistaken, constructed purely to test some complex combinations.

An example that might make a little more sense is something like...

   spanNear([spanOr([spanNear([field:Erik, field:Hatcher], 0, true),
                     spanNear([field:Otis, field:Gospodnetic], 0, true)
                    ]),
            spanOr([field:Apache, field:Lucene])],
            100, false)

...which I would translate as...

  Either "Erik" followed by "Hatcher" with no gap between them, or "Otis"
  followed by "Gospodnetic" with no gap between them; near either
  "Apache" or "Lucene" with a gap of no more no more then 100 tokens in
  between them.


-Hoss


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


Mime
View raw message