Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Lucene: Java-User

surround parser match-all query

 

 

Lucene java-user RSS feed   Index | Next | Previous | View Threaded


sokolov at ifactory

May 6, 2012, 2:26 PM

Post #1 of 6 (173 views)
Permalink
surround parser match-all query

does anybody know how to express a MatchAllDocsQuery in surround query
parser language? I've tried

*

and()

but those don't parse. I looked at the grammar and I don't think there
is a way. Please let us all know if you know otherwise!

Thanks

-Mike Sokolov

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
For additional commands, e-mail: java-user-help [at] lucene


xonixx at gmail

May 6, 2012, 3:10 PM

Post #2 of 6 (173 views)
Permalink
Re: surround parser match-all query [In reply to]

Do you mean

*:*

?

On Mon, May 7, 2012 at 1:26 AM, Mike Sokolov <sokolov [at] ifactory> wrote:
> does anybody know how to express a MatchAllDocsQuery in surround query
> parser language?  I've tried
>
> *
>
> and()
>
> but those don't parse.  I looked at the grammar and I don't think there is a
> way.  Please let us all know if you know otherwise!
>
> Thanks
>
> -Mike Sokolov
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
> For additional commands, e-mail: java-user-help [at] lucene
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
For additional commands, e-mail: java-user-help [at] lucene


sokolov at ifactory

May 6, 2012, 3:56 PM

Post #3 of 6 (173 views)
Permalink
Re: surround parser match-all query [In reply to]

No, that doesn't work either - it works for the lucene query parser, but
not for the *surround* query parser, which I'm using because it has a
syntax for span queries.

On 5/6/2012 6:10 PM, Vladimir Gubarkov wrote:
> Do you mean
>
> *:*
>
> ?
>
> On Mon, May 7, 2012 at 1:26 AM, Mike Sokolov<sokolov [at] ifactory> wrote:
>> does anybody know how to express a MatchAllDocsQuery in surround query
>> parser language? I've tried
>>
>> *
>>
>> and()
>>
>> but those don't parse. I looked at the grammar and I don't think there is a
>> way. Please let us all know if you know otherwise!
>>
>> Thanks
>>
>> -Mike Sokolov
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
>> For additional commands, e-mail: java-user-help [at] lucene
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
> For additional commands, e-mail: java-user-help [at] lucene
>


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
For additional commands, e-mail: java-user-help [at] lucene


rcmuir at gmail

May 6, 2012, 4:28 PM

Post #4 of 6 (168 views)
Permalink
Re: surround parser match-all query [In reply to]

Hi Mike: wheres for the normal queryparser this Query doesn't consult
the positions file and is trivial, how would such a query be
implemented for the surround parser? As a single span that matches all
positions for the whole document? Maybe it could be a "fake span" for
each document of 0 ... Integer.MAX_VALUE?

I think it would be nice to have as long as its not going to be too
inefficient...

On Sun, May 6, 2012 at 5:26 PM, Mike Sokolov <sokolov [at] ifactory> wrote:
> does anybody know how to express a MatchAllDocsQuery in surround query
> parser language?  I've tried
>
> *
>
> and()
>
> but those don't parse.  I looked at the grammar and I don't think there is a
> way.  Please let us all know if you know otherwise!
>
> Thanks
>
> -Mike Sokolov
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
> For additional commands, e-mail: java-user-help [at] lucene
>



--
lucidimagination.com

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
For additional commands, e-mail: java-user-help [at] lucene


sokolov at ifactory

May 6, 2012, 5:04 PM

Post #5 of 6 (175 views)
Permalink
Re: surround parser match-all query [In reply to]

I think what I have in mind would be purely an artifact of the parser; a
term that would always be optimized away, either vanishing or gobbling
up the whole query. So if you had n(A,*), you would just get "A". If
you had and(A, not(*)) (is that the surround syntax for not?) you would
get nothing, if you had * you would get all the documents. Maybe this
could be done without having to actually generate a query internally,
but could happen during parsing. It's kind of a weird case, but I am
trying to translate from one query language to another, and it would be
convenient to have this as an option.

-Mike

On 5/6/2012 7:28 PM, Robert Muir wrote:
> Hi Mike: wheres for the normal queryparser this Query doesn't consult
> the positions file and is trivial, how would such a query be
> implemented for the surround parser? As a single span that matches all
> positions for the whole document? Maybe it could be a "fake span" for
> each document of 0 ... Integer.MAX_VALUE?
>
> I think it would be nice to have as long as its not going to be too
> inefficient...
>
> On Sun, May 6, 2012 at 5:26 PM, Mike Sokolov<sokolov [at] ifactory> wrote:
>> does anybody know how to express a MatchAllDocsQuery in surround query
>> parser language? I've tried
>>
>> *
>>
>> and()
>>
>> but those don't parse. I looked at the grammar and I don't think there is a
>> way. Please let us all know if you know otherwise!
>>
>> Thanks
>>
>> -Mike Sokolov
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
>> For additional commands, e-mail: java-user-help [at] lucene
>>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
For additional commands, e-mail: java-user-help [at] lucene


sokolov at ifactory

May 6, 2012, 5:22 PM

Post #6 of 6 (166 views)
Permalink
Re: surround parser match-all query [In reply to]

Hmm - I looked at Spans more carefully, and it appears as if your idea
about a "fake" Query (some kind of SpanAllQuery would be called for)
would work well, and would probably be much simpler to implement. It
wouldn't preclude the kind of optimization I was talking about either,
but I don't know if it would be worth the trouble.

It turns out in my very specific case I have a term that appears in
every document in a particular field, so I am just using a search for
that at the moment.

-Mike

On 5/6/2012 8:04 PM, Mike Sokolov wrote:
> I think what I have in mind would be purely an artifact of the parser;
> a term that would always be optimized away, either vanishing or
> gobbling up the whole query. So if you had n(A,*), you would just
> get "A". If you had and(A, not(*)) (is that the surround syntax for
> not?) you would get nothing, if you had * you would get all the
> documents. Maybe this could be done without having to actually
> generate a query internally, but could happen during parsing. It's
> kind of a weird case, but I am trying to translate from one query
> language to another, and it would be convenient to have this as an
> option.
>
> -Mike
>
> On 5/6/2012 7:28 PM, Robert Muir wrote:
>> Hi Mike: wheres for the normal queryparser this Query doesn't consult
>> the positions file and is trivial, how would such a query be
>> implemented for the surround parser? As a single span that matches all
>> positions for the whole document? Maybe it could be a "fake span" for
>> each document of 0 ... Integer.MAX_VALUE?
>>
>> I think it would be nice to have as long as its not going to be too
>> inefficient...
>>
>> On Sun, May 6, 2012 at 5:26 PM, Mike Sokolov<sokolov [at] ifactory>
>> wrote:
>>> does anybody know how to express a MatchAllDocsQuery in surround query
>>> parser language? I've tried
>>>
>>> *
>>>
>>> and()
>>>
>>> but those don't parse. I looked at the grammar and I don't think
>>> there is a
>>> way. Please let us all know if you know otherwise!
>>>
>>> Thanks
>>>
>>> -Mike Sokolov
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
>>> For additional commands, e-mail: java-user-help [at] lucene
>>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
> For additional commands, e-mail: java-user-help [at] lucene
>


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
For additional commands, e-mail: java-user-help [at] lucene

Lucene java-user RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.