SRND query

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

SRND query

Boris Galitsky-2
Hello


We need to construct nested span queries, and it seems like SrndQuery
is a good way to do it.

Are there examples available for SrndQueries? How to construct them
(is it using QueryParser?).
Where to get Surround Parser?

How to run them?

Best regards
Boris


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: SRND query

Paul Elschot
On Wednesday 26 April 2006 00:40, Boris Galitsky wrote:

> Hello
>
>
> We need to construct nested span queries, and it seems like SrndQuery
> is a good way to do it.
>
> Are there examples available for SrndQueries? How to construct them
> (is it using QueryParser?).
> Where to get Surround Parser?
>
> How to run them?

Have a look in the svn repository, in the contrib/surround/src/test directory
is junit test code exercising the surround query parser.

Iirc in the contrib area there is also an xml query parser that allows
xml structured queries, but at the moment I don't know precisely
where that is.

Regards,
Paul Elschot

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: SRND query

Erik Hatcher

On Apr 26, 2006, at 2:52 AM, Paul Elschot wrote:
> Iirc in the contrib area there is also an xml query parser that allows
> xml structured queries, but at the moment I don't know precisely
> where that is.

        <http://svn.apache.org/repos/asf/lucene/java/trunk/contrib/xml-query- 
parser/>



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

A problem running two or more negative Span clauses

Boris Galitsky-2
In reply to this post by Paul Elschot
Hello

  I am having problems running span queries with more than one
negative clauses:

Is the span query nested correctly?

spanNear([spanOr([contents:10.1.1.95, contents:10.1.1.81]),
spanNot(spanNear([contents:translated], 5000, false),
                                                  //positive part
                spanNear([contents:replace, contents:permit], 5000,
false))], 10000, true)    //negative part

Number of hits: 7

Exception in thread "main" java.lang.NullPointerException
        at org.apache.lucene.search.spans.NearSpans.doc(NearSpans.java:227)
        at
org.apache.lucene.search.spans.SpanNotQuery$1.next(SpanNotQuery.java:75)
        at
org.apache.lucene.search.spans.NearSpans$SpansCell.next(NearSpans.java:86)
        at
org.apache.lucene.search.spans.NearSpans.initList(NearSpans.java:241)
        at org.apache.lucene.search.spans.NearSpans.next(NearSpans.java:142)
        at org.apache.lucene.search.spans.SpanScorer.next(SpanScorer.java:50)
        at org.apache.lucene.search.Scorer.score(Scorer.java:47)
        at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:132)
        at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:99)
        at org.apache.lucene.search.Hits.getMoreDocs(Hits.java:65)
        at org.apache.lucene.search.Hits.<init>(Hits.java:44)
        at org.apache.lucene.search.Searcher.search(Searcher.java:44)
        at org.apache.lucene.search.Searcher.search(Searcher.java:36)

Is the code required?
Thanks a lot
Boris

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: A problem running two or more negative Span clauses

Chris Hostetter-3

:   I am having problems running span queries with more than one
: negative clauses:

i believe you mean when the exclude clause contains a SpanNear query
correct?

: Is the span query nested correctly?

I'm not very good at reading SpanQuery.toString() output ... but i believe
i encountered the same bug independently over the weekend.  I just filed
it this morning (once i had a chance to consult LIA and verify how a
SpanNot was suppose to work)

http://issues.apache.org/jira/browse/LUCENE-560



-Hoss


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: A problem running two or more negative Span clauses

Paul Elschot
On Monday 01 May 2006 20:17, Chris Hostetter wrote:

>
> :   I am having problems running span queries with more than one
> : negative clauses:
>
> i believe you mean when the exclude clause contains a SpanNear query
> correct?
>
> : Is the span query nested correctly?
>
> I'm not very good at reading SpanQuery.toString() output ... but i believe
> i encountered the same bug independently over the weekend.  I just filed
> it this morning (once i had a chance to consult LIA and verify how a
> SpanNot was suppose to work)
>
> http://issues.apache.org/jira/browse/LUCENE-560

This could be a duplicate of an earlier bug concerning SpanNotQuery.
There is a fix in jira, but not yet in the trunk. I can't connect to
issues.apache.org at the moment,  but one could try later and search for
SpanNotQuery in jira for the fix.
Iirc the fix was about initializing one of the Spans used by the SpanNotQuery.

Regards,
Paul Elschot



>
>
> -Hoss
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: A problem running two or more negative Span clauses

Paul Elschot
In reply to this post by Chris Hostetter-3
See also here:
http://issues.apache.org/jira/browse/LUCENE-433

Regards,
Paul Elschot


On Monday 01 May 2006 20:17, Chris Hostetter wrote:

>
> :   I am having problems running span queries with more than one
> : negative clauses:
>
> i believe you mean when the exclude clause contains a SpanNear query
> correct?
>
> : Is the span query nested correctly?
>
> I'm not very good at reading SpanQuery.toString() output ... but i believe
> i encountered the same bug independently over the weekend.  I just filed
> it this morning (once i had a chance to consult LIA and verify how a
> SpanNot was suppose to work)
>
> http://issues.apache.org/jira/browse/LUCENE-560
>
>
>
> -Hoss
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]